Skip to content

[web-animations-2] Playing an animation might return too early when auto-aligning start time #9871

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

Closed
johannesodland opened this issue Jan 27, 2024 · 2 comments
Labels
web-animations-2 Current Work

Comments

@johannesodland
Copy link

johannesodland commented Jan 27, 2024

It seems to me that playing an animation is returning too early when auto-aligning start time due to a finite timeline.

Given the following code, playing an animation seems to return on step 10.

const viewTimeline = new ViewTimeline({ subject, axis});
const effect = new KeyframeEffect(subject, [{ opacity: 1}, { opacity: 0}], { duration: 'auto', fill: 'both' });
const animation = new Animation(effect, viewTimeline);
animation.play();

Step 10 in Playing an animation states:

  1. If the following three conditions are all satisfied:

abort this procedure.

At this point the procedure aborts as the hold time is not resolved, aborted pause is false and animation does not have a pending playback rate.

The animation does not have a ready promise nor a pending play task as this is first created on step 11 and 12.

As a result, the play state is still idle due to having an unresolved current time, having an unresolved start time and no pending play task.

This again causes Auto-aligning the start time to abort on step 3

  1. If play state is idle, abort this procedure.

I'm not sure what the correct solution is here, and I might be reading the spec wrong. Maybe step 10 should check that the auto align start time flag is not set?

@johannesodland johannesodland changed the title [web-animations-2]Playing an animation might return too early when auto-aligning start time [web-animations-2] Playing an animation might return too early when auto-aligning start time Jan 29, 2024
@johannesodland
Copy link
Author

@flackr Do you know what the correct behavior here should be?

It seems to me like sted 10 is designed to abort the procedure if the animation is already playing, hasn't been auto-rewinded and did not have a pending pause or playback rate.

Should it also check for the auto align start time flag, or that start time is resolved?

@johannesodland
Copy link
Author

This seems to be the same issue as #10965.

Closing as duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
web-animations-2 Current Work
Projects
None yet
Development

No branches or pull requests

2 participants