Bug 1413817 - Change style before waiting for a single requestAnimationFrame. r?birtles draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Thu, 09 Nov 2017 08:06:36 +0900
changeset 695299 ef9dfbe86259f8a0a8e3fd7a910b67db32e84325
parent 695298 12cac7c126e510046860818aa52fe8d40b36eb9f
child 695300 d6e4cef9742070e1adfe8f2aceba7cf447d006dd
push id88383
push userhikezoe@mozilla.com
push dateThu, 09 Nov 2017 00:26:11 +0000
reviewersbirtles
bugs1413817
milestone58.0a1
Bug 1413817 - 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);
   });