mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1224121 - change getRelativeRuleLine to return 0 for line-less rules; r=heycam
This commit is contained in:
parent
044ddb3a84
commit
c8f7d8ae2d
@ -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