-
Notifications
You must be signed in to change notification settings - Fork 747
[web-animations-1] Fix play an animation procedure #7148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
037d96d
to
27500f7
Compare
This patch makes the following changes:
|
Fixes w3c#7145. This patch makes the following changes: - Consistently applies auto-rewind seeking only when the auto-rewind flag is set. Previously there was an inconsistency where we would not check the auto-rewind flag when the effective playback rate was zero. - Makes the play procedure play an idle animation even when the auto-rewind flag is set to false. - Makes the procedure to seamlessly update an animation's playback rate immediately apply the playback rate if the animation is running but has an unresolved current time and no pending play task, rather than attempting to play such an animation.
27500f7
to
60df646
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all looks good to me, thanks!
Thanks! I'll wait to hear what @graouts thinks about the testing situation etc. before merging. |
It looks great! |
Thank you! |
…te() and UpdatePlaybackRate(). Based on the spec [1], the unresolved current time should be checked only if the auto-rewind flag is ture. Otherwise, the null timeline with the false auto-rewind flag may get an InvalidStateError DOMException if its effect end is positive infinity. Note: If the animation has no associated timeline, it's current time is unresolved [2]. Besides, we also tweak the handle for unresolved current time based on the spec PR: w3c/csswg-drafts#7148, in UpdatePlaybackRate() and PlayNoUpdate(). Note: CSS animations and CSS transitions set auto-rewind flag to false [3], and the current time is unresolved (because the start time and the hold time are all unresolved), and so the seek time is unresolved as well, especially when we build a new CSS animation or CSS transition. Therefore we have to avoid the unresolved seek time to let PlayNoUpdate() early return. [1] https://drafts.csswg.org/web-animations-1/#playing-an-animation-section [2] https://drafts.csswg.org/web-animations-1/#animation-current-time [3] https://drafts.csswg.org/css-animations-2/#animation-play-state See the spec issue: w3c/csswg-drafts#7145 for more details. Differential Revision: https://phabricator.services.mozilla.com/D140682 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1758527 gecko-commit: e34abd14507f5deb4f3e110a9c07156b5ccc54ea gecko-reviewers: birtles
… in PlayNoUpdate() and UpdatePlaybackRate(). r=birtles Based on the spec [1], the unresolved current time should be checked only if the auto-rewind flag is ture. Otherwise, the null timeline with the false auto-rewind flag may get an InvalidStateError DOMException if its effect end is positive infinity. Note: If the animation has no associated timeline, it's current time is unresolved [2]. Besides, we also tweak the handle for unresolved current time based on the spec PR: w3c/csswg-drafts#7148, in UpdatePlaybackRate() and PlayNoUpdate(). Note: CSS animations and CSS transitions set auto-rewind flag to false [3], and the current time is unresolved (because the start time and the hold time are all unresolved), and so the seek time is unresolved as well, especially when we build a new CSS animation or CSS transition. Therefore we have to avoid the unresolved seek time to let PlayNoUpdate() early return. [1] https://drafts.csswg.org/web-animations-1/#playing-an-animation-section [2] https://drafts.csswg.org/web-animations-1/#animation-current-time [3] https://drafts.csswg.org/css-animations-2/#animation-play-state See the spec issue: w3c/csswg-drafts#7145 for more details. Differential Revision: https://phabricator.services.mozilla.com/D140682
…te() and UpdatePlaybackRate(). Based on the spec [1], the unresolved current time should be checked only if the auto-rewind flag is ture. Otherwise, the null timeline with the false auto-rewind flag may get an InvalidStateError DOMException if its effect end is positive infinity. Note: If the animation has no associated timeline, it's current time is unresolved [2]. Besides, we also tweak the handle for unresolved current time based on the spec PR: w3c/csswg-drafts#7148, in UpdatePlaybackRate() and PlayNoUpdate(). Note: CSS animations and CSS transitions set auto-rewind flag to false [3], and the current time is unresolved (because the start time and the hold time are all unresolved), and so the seek time is unresolved as well, especially when we build a new CSS animation or CSS transition. Therefore we have to avoid the unresolved seek time to let PlayNoUpdate() early return. [1] https://drafts.csswg.org/web-animations-1/#playing-an-animation-section [2] https://drafts.csswg.org/web-animations-1/#animation-current-time [3] https://drafts.csswg.org/css-animations-2/#animation-play-state See the spec issue: w3c/csswg-drafts#7145 for more details. Differential Revision: https://phabricator.services.mozilla.com/D140682 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1758527 gecko-commit: e34abd14507f5deb4f3e110a9c07156b5ccc54ea gecko-reviewers: birtles
…te() and UpdatePlaybackRate(). Based on the spec [1], the unresolved current time should be checked only if the auto-rewind flag is ture. Otherwise, the null timeline with the false auto-rewind flag may get an InvalidStateError DOMException if its effect end is positive infinity. Note: If the animation has no associated timeline, it's current time is unresolved [2]. Besides, we also tweak the handle for unresolved current time based on the spec PR: w3c/csswg-drafts#7148, in UpdatePlaybackRate() and PlayNoUpdate(). Note: CSS animations and CSS transitions set auto-rewind flag to false [3], and the current time is unresolved (because the start time and the hold time are all unresolved), and so the seek time is unresolved as well, especially when we build a new CSS animation or CSS transition. Therefore we have to avoid the unresolved seek time to let PlayNoUpdate() early return. [1] https://drafts.csswg.org/web-animations-1/#playing-an-animation-section [2] https://drafts.csswg.org/web-animations-1/#animation-current-time [3] https://drafts.csswg.org/css-animations-2/#animation-play-state See the spec issue: w3c/csswg-drafts#7145 for more details. Differential Revision: https://phabricator.services.mozilla.com/D140682 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1758527 gecko-commit: e34abd14507f5deb4f3e110a9c07156b5ccc54ea gecko-reviewers: birtles
… in PlayNoUpdate() and UpdatePlaybackRate(). r=birtles Based on the spec [1], the unresolved current time should be checked only if the auto-rewind flag is ture. Otherwise, the null timeline with the false auto-rewind flag may get an InvalidStateError DOMException if its effect end is positive infinity. Note: If the animation has no associated timeline, it's current time is unresolved [2]. Besides, we also tweak the handle for unresolved current time based on the spec PR: w3c/csswg-drafts#7148, in UpdatePlaybackRate() and PlayNoUpdate(). Note: CSS animations and CSS transitions set auto-rewind flag to false [3], and the current time is unresolved (because the start time and the hold time are all unresolved), and so the seek time is unresolved as well, especially when we build a new CSS animation or CSS transition. Therefore we have to avoid the unresolved seek time to let PlayNoUpdate() early return. [1] https://drafts.csswg.org/web-animations-1/#playing-an-animation-section [2] https://drafts.csswg.org/web-animations-1/#animation-current-time [3] https://drafts.csswg.org/css-animations-2/#animation-play-state See the spec issue: w3c/csswg-drafts#7145 for more details. Differential Revision: https://phabricator.services.mozilla.com/D140682
…dating-the-playback-rate-of-an-animation.html has one failure https://bugs.webkit.org/show_bug.cgi?id=246850 Reviewed by Dean Jackson. Update our implementation of the "play an animation" [0] and "seamlessly update the playback rate" [1] procedures to account for the spec changes made in w3c/csswg-drafts#7148. We also import the changes made to the matching WPT so that we have a new PASS results. [0] https://drafts.csswg.org/web-animations-1/#play-an-animation [1] https://drafts.csswg.org/web-animations-1/#seamlessly-update-the-playback-rate * LayoutTests/imported/w3c/web-platform-tests/web-animations/timing-model/animations/seamlessly-updating-the-playback-rate-of-an-animation-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/web-animations/timing-model/animations/seamlessly-updating-the-playback-rate-of-an-animation.html: * Source/WebCore/animation/WebAnimation.cpp: (WebCore::WebAnimation::updatePlaybackRate): (WebCore::WebAnimation::play): (WebCore::WebAnimation::runPendingPlayTask): Canonical link: https://commits.webkit.org/255833@main
… in PlayNoUpdate() and UpdatePlaybackRate(). r=birtles Based on the spec [1], the unresolved current time should be checked only if the auto-rewind flag is ture. Otherwise, the null timeline with the false auto-rewind flag may get an InvalidStateError DOMException if its effect end is positive infinity. Note: If the animation has no associated timeline, it's current time is unresolved [2]. Besides, we also tweak the handle for unresolved current time based on the spec PR: w3c/csswg-drafts#7148, in UpdatePlaybackRate() and PlayNoUpdate(). Note: CSS animations and CSS transitions set auto-rewind flag to false [3], and the current time is unresolved (because the start time and the hold time are all unresolved), and so the seek time is unresolved as well, especially when we build a new CSS animation or CSS transition. Therefore we have to avoid the unresolved seek time to let PlayNoUpdate() early return. [1] https://drafts.csswg.org/web-animations-1/#playing-an-animation-section [2] https://drafts.csswg.org/web-animations-1/#animation-current-time [3] https://drafts.csswg.org/css-animations-2/# 756D animation-play-state See the spec issue: w3c/csswg-drafts#7145 for more details. Differential Revision: https://phabricator.services.mozilla.com/D140682
Fixes #7145.