Skip to content
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

animation.updatePlaybackRate(0) does not set holdTime #168

Open
johannesodland opened this issue Oct 31, 2023 · 1 comment
Open

animation.updatePlaybackRate(0) does not set holdTime #168

johannesodland opened this issue Oct 31, 2023 · 1 comment

Comments

@johannesodland
Copy link
Contributor

Problem

Setting the playback rate to 0 should probably freeze the animation, similar to pausing it.

Expected result

In Chromes implementation the animation freezes at the current time in the timeline.

Actual result

In the polyfill, the animation is reset

Probable cause

I think the cause is in commitPendingPlay().

Playing an animation (step 17) says:

If animation’s playback rate is zero, let animation’s hold time be current time to match.

But: the polyfill implementation sets holdTime to null:

if (playbackRate == 0) {
details.holdTime = null;
details.startTime = timelineTime;
} else {

Setting the holdTime to currentTimeToMatch alone does not solve the issue, as startTime is set. If startTime is set to unresolved however, the animation freezes as expected. Am I reading the standard correct here, to set both startTime and holdTime?

Screenshots

Result of scrolling into view and setting playbackRate to 0:

Chrome:
image

Safari with polyfill:
image

@johannesodland
Copy link
Contributor Author

@flackr @bramus What do you think should be the correct behavior here?
To me it makes more sense that hold-time is set, and start time is unset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant