Bug 1347270: Rewrite test_media_queries_dynamic.html using restyleGeneration. r?bholley draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Tue, 30 May 2017 00:43:15 +0200
changeset 586409 b90e49b6d7c2fa57ca5970e99a1bf5989fdc743f
parent 586402 45ed06524ff0d53dbaf58d5a5f279379d7019bb3
child 586410 c30c1a3816a9b700458d79c39d722ce9f0a6ae1b
child 586550 b3146d7d81ca1e9d2dd362ff37f9a4e56cd4e0a0
push id61380
push userbmo:emilio+bugs@crisal.io
push dateTue, 30 May 2017 09:40:55 +0000
reviewersbholley
bugs1347270
milestone55.0a1
Bug 1347270: Rewrite test_media_queries_dynamic.html using restyleGeneration. r?bholley MozReview-Commit-ID: 3zPETl6WFyc
layout/style/test/stylo-failures.md
layout/style/test/test_media_queries_dynamic.html
--- 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;