Bug 1347270: Rewrite test_media_queries_dynamic.html using restyleGeneration. r?bholley
MozReview-Commit-ID: 3zPETl6WFyc
--- a/layout/style/test/stylo-failures.md
+++ b/layout/style/test/stylo-failures.md
@@ -28,17 +28,17 @@ To use this file, you need to add `--fai
to mochitest command.
## Failures
* Media query support:
* "layout.css.prefixes.device-pixel-ratio-webkit" support bug 1366956
* test_media_queries.html `-device-pixel-ratio` [27]
* test_webkit_device_pixel_ratio.html [3]
- * test_media_queries_dynamic.html `restyle count`: support elementsRestyled [6]
+ * test_media_queries_dynamic.html `restyle`: bug 1357461 [4]
* test_media_queries_dynamic_xbl.html: xbl support bug 1290276 [2]
* Animation support:
* OMTA
* test_animations_omta.html: bug 1361938, bug 1340005 [*]
* SMIL Animation
* test_restyles_in_smil_animation.html [2]
* console support bug 1352669
* test_bug413958.html `monitorConsole` [3]
--- a/layout/style/test/test_media_queries_dynamic.html
+++ b/layout/style/test/test_media_queries_dynamic.html
@@ -116,39 +116,39 @@ function run() {
// making the optimizations we expect.
subdoc.body.textContent = "";
subdoc.body.appendChild(subdoc.createElement("div"));
for (var ruleIdx = sheet.cssRules.length; ruleIdx-- != 0; ) {
sheet.deleteRule(ruleIdx);
}
var utils = SpecialPowers.getDOMWindowUtils(subwin);
- var elementsRestyled, framesConstructed, framesReflowed;
+ var restyleGeneration, framesConstructed, framesReflowed;
function reset_change_counters()
{
- elementsRestyled = utils.elementsRestyled;
+ restyleGeneration = utils.restyleGeneration;
framesConstructed = utils.framesConstructed;
framesReflowed = utils.framesReflowed;
}
function flush_and_assert_change_counters(desc, expected) {
subdoc.body.offsetHeight;
if (!("restyle" in expected) ||
!("construct" in expected) ||
!("reflow" in expected)) {
ok(false, "parameter missing expectation");
return;
}
- var restyles = utils.elementsRestyled - elementsRestyled;
+ var didRestyle = utils.restyleGeneration != restyleGeneration;
var constructs = utils.framesConstructed - framesConstructed;
var reflows = utils.framesReflowed - framesReflowed;
- (expected.restyle ? isnot : is)(restyles, 0, "restyle count: " + desc);
+ (expected.restyle ? isnot : is)(didRestyle, false, "restyle: " + desc);
(expected.construct ? isnot : is)(constructs, 0,
"frame construct count: " + desc);
(expected.reflow ? isnot : is)(reflows, 0, "reflow count: " + desc);
reset_change_counters();
}
subdoc.body.offsetHeight;