Bug 1237454 - An additional check that an animation on visibility: hidden element starts restyling when the element gets visible. r?boris draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Fri, 09 Feb 2018 10:43:10 +0900
changeset 752905 598fb5eda6c8b224826d326da3c99df6051065f9
parent 752904 871aceb3fbc9688e3089b467144ac3ad24fd2673
child 752906 783b483eb0d958cc126a7374e322cb01accdef1e
push id98428
push userbmo:hikezoe@mozilla.com
push dateFri, 09 Feb 2018 10:01:48 +0000
reviewersboris
bugs1237454
milestone60.0a1
Bug 1237454 - An additional check that an animation on visibility: hidden element starts restyling when the element gets visible. r?boris MozReview-Commit-ID: 2Lvk2IqEaXY
dom/animation/test/mozilla/file_restyles.html
--- a/dom/animation/test/mozilla/file_restyles.html
+++ b/dom/animation/test/mozilla/file_restyles.html
@@ -722,29 +722,41 @@ waitForAllPaints(() => {
     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);
   });
 
-  add_task(async function no_restyling_main_thread_animations_in_visibility_hidden_element() {
-    var div = addDiv(null,
-     { style: 'animation: background-color 100s; visibility: hidden' });
-    var animation = div.getAnimations()[0];
+  add_task(
+    async function restyling_animations_on_visibility_hidden_element_which_gets_visible() {
+      var div = addDiv(null,
+       { style: 'animation: background-color 100s; visibility: hidden' });
+      var animation = div.getAnimations()[0];
+
+
+      await animation.ready;
+      var markers = await observeStyling(5);
 
-    await animation.ready;
-    var markers = await observeStyling(5);
+      todo_is(markers.length, 0,
+              'Animations running on visibility hidden element should never ' +
+              'cause restyles');
+
+      div.style.visibility = 'visible';
+      await waitForNextFrame();
 
-    todo_is(markers.length, 0,
-            'Bug 1237454: Animations running on the main-thread in ' +
-            'visibility hidden element should never cause restyles');
-    await ensureElementRemoval(div);
-  });
+      var markers = await observeStyling(5);
+      is(markers.length, 5,
+         'Animations running that was on visibility hidden element which ' +
+         'gets visible should not throttle restyling any more');
+
+      await ensureElementRemoval(div);
+    }
+  );
 
   add_task_if_omta_enabled(async function no_restyling_compositor_animations_after_pause_is_called() {
     var div = addDiv(null, { style: 'animation: opacity 100s' });
     var animation = div.getAnimations()[0];
 
     await animation.ready;
     ok(SpecialPowers.wrap(animation).isRunningOnCompositor);