mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 17:25:36 +00:00
Bug 1085119 - Part 2: Add unit tests for css-logic row and column precedence r=tromey
MozReview-Commit-ID: 4zz7hFOQJAj
This commit is contained in:
parent
91ae972521
commit
f392faaf4d
@ -10,6 +10,8 @@
|
||||
.inheritable-rule {
|
||||
font-size: 15px;
|
||||
}
|
||||
/* Has to be on one line, is such for test */
|
||||
.column-rule { font-size: 20px; } .column-rule { font-size: 25px; }
|
||||
.uninheritable-rule {
|
||||
background-color: #f06;
|
||||
}
|
||||
@ -62,7 +64,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Matched checks -->
|
||||
<div id="matched-parent" class="external-rule inheritable-rule uninheritable-rule" style="color: red;">
|
||||
<div id="matched-parent" class="external-rule inheritable-rule column-rule uninheritable-rule" style="color: red;">
|
||||
<div id="matched-test-node" style="font-size: 10px" class="external-rule">
|
||||
Here is the test node.
|
||||
</div>
|
||||
|
@ -52,17 +52,23 @@ addTest(function testMatchedStyles() {
|
||||
is(matched[0].rule.href, gInspectee.defaultView.location.href,
|
||||
"Node style comes from this document");
|
||||
|
||||
is(matched[1].sourceText, ".inheritable-rule", "Second match comes from a rule");
|
||||
is(matched[1].selector, ".inheritable-rule", "Second style has a selector");
|
||||
is(matched[1].value, "15px", "Second match has the expected value");
|
||||
is(matched[1].sourceText, ".column-rule",
|
||||
"Second match comes from a rule");
|
||||
is(matched[1].selector, ".column-rule",
|
||||
"Second match comes from highest line number");
|
||||
is(matched[1].value, "25px", "Second match comes from highest column");
|
||||
is(matched[1].status, CssLogic.STATUS.PARENT_MATCH,
|
||||
"Second match is from the parent");
|
||||
"Second match is from the parent");
|
||||
is(matched[1].rule.parentStyleSheet.href, null,
|
||||
"Inline stylesheet shouldn't have an href");
|
||||
"Inline stylesheet shouldn't have an href");
|
||||
is(matched[1].rule.parentStyleSheet.nodeHref, gInspectee.defaultView.location.href,
|
||||
"Inline stylesheet's nodeHref should match the current document");
|
||||
"Inline stylesheet's nodeHref should match the current document");
|
||||
ok(!matched[1].rule.parentStyleSheet.system,
|
||||
"Inline stylesheet shouldn't be a system stylesheet.");
|
||||
"Inline stylesheet shouldn't be a system stylesheet.");
|
||||
|
||||
// matched[2] is only there to test matched[1]; do not need to test
|
||||
|
||||
is(matched[3].value, "15px", "Third match has the expected value");
|
||||
}).then(runNextTest));
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user