Bug 1419079 - Add a test case for additive animation with a missing keyframe. r?birtles draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Wed, 17 Jan 2018 08:55:00 +0900
changeset 721314 4d2384cbcd11c4f998d1853c451cc9845825da71
parent 721313 4b83a75750ce9f1472a6d187c0cd454c3e376dca
child 721315 25e7583a806b5745a5dca5acbe54a98be5216c16
child 721323 137a3d7d0b08587d3b8c5df2c8c12db91b96383c
push id95792
push userhikezoe@mozilla.com
push dateWed, 17 Jan 2018 01:53:19 +0000
reviewersbirtles
bugs1419079
milestone59.0a1
Bug 1419079 - Add a test case for additive animation with a missing keyframe. r?birtles MozReview-Commit-ID: 5UWfDIx7RVi
dom/animation/test/mozilla/file_restyles.html
--- a/dom/animation/test/mozilla/file_restyles.html
+++ b/dom/animation/test/mozilla/file_restyles.html
@@ -950,16 +950,35 @@ waitForAllPaints(() => {
          '!important rule begins running on the compositor even if the ' +
          '!important rule had been dropped before the target element was ' +
          'removed');
 
       await ensureElementRemoval(div);
     }
   );
 
+  add_task(
+    async function no_throttling_additive_animations_out_of_view_element() {
+      var div = addDiv(null, { style: 'transform: translateY(-400px);' });
+      var animation =
+        div.animate([{ visibility: 'visible' }],
+                    { duration: 100 * MS_PER_SEC, composite: 'add' });
+
+      await animation.ready;
+
+      const expectedRestyleCount = tweakExpectedRestyleCount(animation, 5);
+      var markers = await observeStyling(5);
+
+      is(markers.length, expectedRestyleCount,
+         'Additive animation has no keyframe whose offset is 0 or 1 in an ' +
+         'out-of-view element should not be throttled');
+      await ensureElementRemoval(div);
+    }
+  );
+
   // Tests that missing keyframes animations don't throttle at all.
   add_task(async function no_throttling_animations_out_of_view_element() {
     var div = addDiv(null, { style: 'transform: translateY(-400px);' });
     var animation =
       div.animate([{ visibility: 'visible' }], 100 * MS_PER_SEC);
 
     await animation.ready;