Bug 1471174 - Drop opacity value that was for preventing the animations run on the compositor and check the animation is NOT running on the compositor. r?birtles draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Wed, 27 Jun 2018 09:40:55 +0900
changeset 811149 8fe97c4726750de4a3c855d9376b425533f5dd31
parent 811148 e6fc4b8df4dba8839d041cbd943bbc252d24a335
push id114204
push userhikezoe@mozilla.com
push dateWed, 27 Jun 2018 00:44:53 +0000
reviewersbirtles
bugs1471174
milestone63.0a1
Bug 1471174 - Drop opacity value that was for preventing the animations run on the compositor and check the animation is NOT running on the compositor. r?birtles Because now we don't try to send the animations on visibility:hidden element. MozReview-Commit-ID: IFqIc8ewz5T
dom/animation/test/mozilla/file_restyles.html
--- a/dom/animation/test/mozilla/file_restyles.html
+++ b/dom/animation/test/mozilla/file_restyles.html
@@ -1746,74 +1746,77 @@ waitForAllPaints(() => {
     await ensureElementRemoval(div);
   });
 
   add_task(async function restyling_transform_animations_on_invisible_element() {
     if (isAndroid) {
       // FIXME: Bug 1470798: Enable this test on Android.
       return;
     }
-    // 'opacity: 0' prevents transform animations to be sent to the compositor.
-    const div = addDiv(null, { style: 'visibility: hidden; opacity: 0' });
+    const div = addDiv(null, { style: 'visibility: hidden;' });
 
     const animation =
       div.animate({ transform: [ 'none', 'rotate(360deg)' ] },
                   { duration: 100 * MS_PER_SEC,
                     iterations: Infinity });
 
     await waitForAnimationReadyToRestyle(animation);
 
+    ok(!SpecialPowers.wrap(animation).isRunningOnCompositor);
+
     const markers = await observeStyling(5);
 
     is(markers.length, 0,
        'Transform animations on visibility hidden element should be throttled');
     await ensureElementRemoval(div);
   });
 
   add_task(async function restyling_transform_animations_on_invisible_element() {
     if (isAndroid) {
       // FIXME: Bug 1470798: Enable this test on Android.
       return;
     }
-    // 'opacity: 0' prevents transform animations to be sent to the compositor.
-    const div = addDiv(null, { style: 'visibility: hidden; opacity: 0' });
+    const div = addDiv(null, { style: 'visibility: hidden;' });
 
     const animation =
       div.animate([ { transform: 'rotate(360deg)' } ],
                   { duration: 100 * MS_PER_SEC,
                     iterations: Infinity });
 
     await waitForAnimationReadyToRestyle(animation);
 
+    ok(!SpecialPowers.wrap(animation).isRunningOnCompositor);
+
     const markers = await observeStyling(5);
 
     is(markers.length, 0,
        'Transform animations without 100% keyframe on visibility hidden ' +
        'element should be throttled');
     await ensureElementRemoval(div);
   });
 
   add_task(
     async function restyling_transform_animations_having_abs_pos_child_on_invisible_element() {
       if (isAndroid) {
         // FIXME: Bug 1470798: Enable this test on Android.
         return;
       }
-      // 'opacity: 0' prevents transform animations to be sent to the compositor.
-      const div = addDiv(null, { style: 'visibility: hidden; opacity: 0' });
+      const div = addDiv(null, { style: 'visibility: hidden;' });
       const child = addDiv(null, { style: 'position: absolute; top: 100px;' });
       div.appendChild(child);
 
       const animation =
         div.animate({ transform: [ 'none',  'rotate(360deg)' ] },
                     { duration: 100 * MS_PER_SEC,
                       iterations: Infinity });
 
       await waitForAnimationReadyToRestyle(animation);
 
+      ok(!SpecialPowers.wrap(animation).isRunningOnCompositor);
+
       const markers = await observeStyling(5);
 
       is(markers.length, 0,
          'Transform animation having an absolutely positioned child on ' +
          'visibility hidden element should be throttled');
       await ensureElementRemoval(div);
   });