mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bug 1224121 - change getRelativeRuleLine to return 0 for line-less rules; r=heycam
This commit is contained in:
parent
362b7a3220
commit
98339c1437
@ -318,7 +318,7 @@ inDOMUtils::GetRelativeRuleLine(nsIDOMCSSRule* aRule, uint32_t* _retval)
|
||||
|
||||
uint32_t lineNumber = rule->GetLineNumber();
|
||||
CSSStyleSheet* sheet = rule->GetStyleSheet();
|
||||
if (sheet) {
|
||||
if (sheet && lineNumber != 0) {
|
||||
nsINode* owningNode = sheet->GetOwnerNode();
|
||||
if (owningNode) {
|
||||
nsCOMPtr<nsIStyleSheetLinkingElement> link =
|
||||
|
@ -34,10 +34,12 @@
|
||||
{ sheetNo: 1, ruleNo: 0, lineNo: 2, columnNo: 15 },
|
||||
{ sheetNo: 1, ruleNo: 1, lineNo: 8, columnNo: 5 },
|
||||
{ sheetNo: 2, ruleNo: 0, lineNo: 1, columnNo: 1 },
|
||||
{ sheetNo: 2, ruleNo: 1, lineNo: 0, columnNo: 1 },
|
||||
{ sheetNo: 3, ruleNo: 0, lineNo: 5, columnNo: 6 },
|
||||
];
|
||||
|
||||
function doTest() {
|
||||
document.styleSheets[2].insertRule("body{}", 1);
|
||||
for (let test of tests) {
|
||||
let sheet = document.styleSheets[test.sheetNo];
|
||||
let rule = sheet.cssRules[test.ruleNo];
|
||||
|
Loading…
Reference in New Issue
Block a user