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
--- 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);
});