Bug 1419079 - Add a test case for additive animation with a missing keyframe. r?birtles
MozReview-Commit-ID: 5UWfDIx7RVi
--- 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;