Bug 1421476 - Change style before waiting for a single requestAnimationFrame. r?birtles draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Wed, 29 Nov 2017 13:05:21 +0900
changeset 704924 ff52efc400c21374fcae39b4df277103418d4b8e
parent 704923 7ccb5ec5f59f7cff6b8a5610c20f04082eed255a
child 704925 9554b31eb3140e7f53cc50402952da86bf33c93a
push id91278
push userhikezoe@mozilla.com
push dateWed, 29 Nov 2017 04:07:53 +0000
reviewersbirtles
bugs1421476
milestone59.0a1
Bug 1421476 - Change style before waiting for a single requestAnimationFrame. r?birtles If we waited for a single requestAnimationFrame and changed the style inside the callback, we have no chance to process the style change there. * Before this change: - Tick: Start observing restyles Process restyling but there is no need to do. - Next tick: Run requestAnimationFrame callbacks set the style finish observing restyles * After this change: - Tick: Set the style Start observing restyles Process restyling the style - Next tick: Run requestAnimationFrame callbacks finish observing restyles MozReview-Commit-ID: JNQLjOXz3AZ
dom/animation/test/mozilla/file_restyles.html
--- a/dom/animation/test/mozilla/file_restyles.html
+++ b/dom/animation/test/mozilla/file_restyles.html
@@ -495,19 +495,18 @@ waitForAllPaints(() => {
       { style: 'overflow-y: scroll; height: 20px;' });
     var div = addDiv(null,
       { style: 'animation: background-color 100s; position: relative; top: 100px;' });
     parentElement.appendChild(div);
     var animation = div.getAnimations()[0];
 
     await animation.ready;
 
-    var markers = await observeStyling(1, () => {
-      parentElement.style.height = '100px';
-    });
+    parentElement.style.height = '100px';
+    var markers = await observeStyling(1);
 
     is(markers.length, 1,
        'Animations running on the main-thread which was in scrolled out ' +
        'elements should update restyling soon after the element moved in ' +
        'view by resizing');
 
     await ensureElementRemoval(parentElement);
   });