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