Bug 1416966 - Add todo for checking the final restyle after Animation.finished. r?birtles draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Tue, 12 Dec 2017 18:44:04 +0900
changeset 710845 711112257bb3c5bc9aab5d931663b8dd349dc260
parent 710844 edcdc89709f0ef20583e73d560672f06d41b24ca
child 710846 844c6c4f03e077bbad19b118bce1e7d50be03a04
push id92911
push userhikezoe@mozilla.com
push dateTue, 12 Dec 2017 10:01:08 +0000
reviewersbirtles
bugs1416966
milestone59.0a1
Bug 1416966 - Add todo for checking the final restyle after Animation.finished. r?birtles If Animation.finished promise was fulfilled in Animation::Tick, at the moment we haven't yet restyled the final animation value. So once we have new micro task checkpoint there we can observe a restyle marker after Animation.finished was fulfilled. MozReview-Commit-ID: LiEl4Iu2Cbr
dom/animation/test/mozilla/file_restyles.html
--- a/dom/animation/test/mozilla/file_restyles.html
+++ b/dom/animation/test/mozilla/file_restyles.html
@@ -249,52 +249,60 @@ waitForAllPaints(() => {
     var div = addDiv(null, { style: 'transition: opacity 1ms; opacity: 0' });
     getComputedStyle(div).opacity;
     div.style.opacity = 1;
 
     var animation = div.getAnimations()[0];
     var initialRect = div.getBoundingClientRect();
 
     await animation.finished;
+    var markers = await observeStyling(1);
+    todo_is(markers.length, 1,
+            'Finished transitions should restyle once after ' +
+            'Animation.finished was fulfilled');
 
     var mouseX = initialRect.left + initialRect.width / 2;
     var mouseY = initialRect.top + initialRect.height / 2;
-    var markers = await observeStyling(5, () => {
+    markers = await observeStyling(5, () => {
       // We can't use synthesizeMouse here since synthesizeMouse causes
       // layout flush.
       synthesizeMouseAtPoint(mouseX++, mouseY++,
                              { type: 'mousemove' }, window);
     });
 
     is(markers.length, 0,
-       'Bug 1219236: Finished transitions should never cause restyles ' +
-       'when mouse is moved on the animations');
+       'Finished transitions should never cause restyles when mouse is moved ' +
+       'on the transitions');
     await ensureElementRemoval(div);
   });
 
   add_task(async function no_restyling_mouse_movement_on_finished_animation() {
     var div = addDiv(null, { style: 'animation: opacity 1ms' });
     var animation = div.getAnimations()[0];
 
     var initialRect = div.getBoundingClientRect();
 
     await animation.finished;
+    var markers = await observeStyling(1);
+    todo_is(markers.length, 1,
+            'Finished animations should restyle once after ' +
+            'Animation.finished was fulfilled');
 
     var mouseX = initialRect.left + initialRect.width / 2;
     var mouseY = initialRect.top + initialRect.height / 2;
-    var markers = await observeStyling(5, () => {
+    markers = await observeStyling(5, () => {
       // We can't use synthesizeMouse here since synthesizeMouse causes
       // layout flush.
       synthesizeMouseAtPoint(mouseX++, mouseY++,
                              { type: 'mousemove' }, window);
     });
 
     is(markers.length, 0,
-       'Bug 1219236: Finished animations should never cause restyles ' +
-       'when mouse is moved on the animations');
+       'Finished animations should never cause restyles when mouse is moved ' +
+       'on the animations');
     await ensureElementRemoval(div);
   });
 
   add_task_if_omta_enabled(async function no_restyling_compositor_animations_out_of_view_element() {
     if (!offscreenThrottlingEnabled) {
       return;
     }