mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1181905 - Animation::IsPlaying should check playbackRate != 0 to stop playing on compositor animation. r=bbirtles
This commit is contained in:
parent
eb88e69b1d
commit
96c914a343
@ -246,13 +246,15 @@ public:
|
||||
* still running but we only consider it playing when it is in its active
|
||||
* interval. This definition is used for fetching the animations that are
|
||||
* candidates for running on the compositor (since we don't ship animations
|
||||
* to the compositor when they are in their delay phase or paused).
|
||||
* to the compositor when they are in their delay phase or paused including
|
||||
* being effectively paused due to having a zero playback rate).
|
||||
*/
|
||||
bool IsPlaying() const
|
||||
{
|
||||
// We need to have an effect in its active interval, and
|
||||
// be either running or waiting to run.
|
||||
// be either running or waiting to run with a non-zero playback rate.
|
||||
return HasInPlayEffect() &&
|
||||
mPlaybackRate != 0.0 &&
|
||||
(PlayState() == AnimationPlayState::Running ||
|
||||
mPendingState == PendingState::PlayPending);
|
||||
}
|
||||
|
@ -50,6 +50,23 @@ addAsyncAnimTest(function *() {
|
||||
"at 300ms");
|
||||
done_div();
|
||||
});
|
||||
|
||||
addAsyncAnimTest(function *() {
|
||||
var [ div, cs ] = new_div("animation: anim 10s 1 linear forwards");
|
||||
var animation = div.getAnimations()[0];
|
||||
advance_clock(300);
|
||||
yield waitForPaints();
|
||||
|
||||
animation.playbackRate = 0;
|
||||
|
||||
yield waitForPaintsFlushed();
|
||||
|
||||
omta_is(div, "transform", { tx: 3 }, RunningOn.MainThread,
|
||||
"animation with zero playback rate should stay in the " +
|
||||
"same position and be running on the main thread");
|
||||
|
||||
done_div();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user