Bug 1253164 - Make nsIFrame allow running async animations once the frame is able able to run animations on the compositor again. r=birtles

For example, we don't run transform animations on large frames but once
the frame size is small enough we should run transform animations on the frame.

MozReview-Commit-ID: DkfB9g2Gcdi

--HG--
extra : rebase_source : 93a884c3063d4a6c2626e6695583664b24fe11c8
This commit is contained in:
Hiroyuki Ikezoe 2018-06-07 09:30:33 +09:00
Родитель ef7cd48646
Коммит c1fc73bb2d
2 изменённых файлов: 6 добавлений и 4 удалений

Просмотреть файл

@ -1195,10 +1195,9 @@ function start() {
animation.effect.target.style = 'width: 100px; height: 100px';
return waitForFrame();
}).then(() => {
// FIXME: Bug 1253164: the animation should get back on compositor.
assert_animation_property_state_equals(
animation.effect.getProperties(),
[ { property: 'transform', runningOnCompositor: false } ]);
[ { property: 'transform', runningOnCompositor: true } ]);
});
}, 'transform on too big element - area');
@ -1231,10 +1230,9 @@ function start() {
animation.effect.target.style = 'width: 100px; height: 100px';
return waitForFrame();
}).then(() => {
// FIXME: Bug 1253164: the animation should get back on compositor.
assert_animation_property_state_equals(
animation.effect.getProperties(),
[ { property: 'transform', runningOnCompositor: false } ]);
[ { property: 'transform', runningOnCompositor: true } ]);
});
}, 'transform on too big element - dimensions');

Просмотреть файл

@ -8724,6 +8724,10 @@ already_AddRefed<Layer> nsDisplayTransform::BuildLayer(nsDisplayListBuilder *aBu
container->SetContentFlags(container->GetContentFlags() & ~Layer::CONTENT_EXTEND_3D_CONTEXT);
}
if (mAllowAsyncAnimation) {
mFrame->SetProperty(nsIFrame::RefusedAsyncAnimationProperty(), false);
}
nsDisplayListBuilder::AddAnimationsAndTransitionsToLayer(container, aBuilder,
this, mFrame,
eCSSProperty_transform);