-
Notifications
You must be signed in to change notification settings - Fork 707
[web-animations-2] [scroll-animations-1] Auto-aligning the start time of an animation associated with a scroll timeline #10965
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
Comments
Cc @andruud, @flackr and @kevers-google (and apologies for initially assigning this issue to them). |
I think this is the same issue I ran into in #9871. I'm closing that issue as a duplicate in favor of yours. |
What I'm seeing in Chrome is that creating a scroll-driven animation puts it in the |
I believe this section is missing a condition: https://www.w3.org/TR/web-animations-1/#waiting-for-the-associated-effect Presently the conditions for being ready are that:
Adding a third condition that the animation has a start or hold time, resolves things. This keeps the animation in a play pending state until we have a resolved (auto-aligned) start time. Previously, the timeline being active was sufficient, but now we potentially need a layout update to resolve the view timeline range and calculate an auto-aligned start time. This effectively leaves the animation not in effect while waiting on the animation to be ready, but this prevents a potential flicker by initializing with one start time only to jump to another after the view timeline range has been updated. |
Note that Web Animations Level 2 already has an update for this section that matches what @kevers-google is saying:
|
Ah yes. I see a TODO in the Blink implementation to add a condition to prevent aborting if playing a scroll driven animation. Apologies for not following up on that one. In Blink, we have an extra condition to avoid an early abort if using a scroll timeline. This will require clarification in the spec. Hold time is expected to be set if using a document timeline, but not if using a scroll timeline. Looking at the play procedure in web-animations-2, I, I see an issue in the "if seek time is resolved" step. This has us setting the start time if using a finite-timeline, which worked prior to the introduction of view-timelines. As we don't necessarily know at the time of play what the start time should be for a scroll-timeline, we need to defer the calculation, and avoid an early abort if expecting a deferred start time. I'll follow up with Rob on this. |
I implemented the "auto-aligning the start time" procedure in WebKit in 285176@main and made a change to step 10 of the playing an animation procedure such as if the auto align start time flag is true and start time is unresolved we proceed with the rest of the procedure instead of bailing out. See WebKit/WebKit@433599a#diff-ac012fc9792c68f4fdf706f4021da22aa0be5d72e7547cb42e3a9c3f36df6d18R1182. |
I'm working on implementing Scroll-driven Animations in WebKit and having some trouble understanding how the start time of an animation associated with a scroll timeline ever gets resolved.
From my understanding, the start time of such an animation is set by the auto-aligning the start time procedure. Per HTML Processing Model: Event loop:
So each time animations are updating, we have a chance to auto-align the start time of scroll-driven animations. But, the auto-aligning the start time procedure step 3 says:
The play state is idle when:
My assumption is that the start time is unresolved since we're yet to set it via the auto-align the start time procedure. We do not have any pending tasks since when initially playing that scroll-driven animation, we aborted the play procedure after step 10:
And the current time is unresolved precisely we don't yet have a start time and return unresolved in this step of the calculating the current time of an animation procedure:
Therefore it is unclear to me when an animation associated with a scroll timeline can ever have a resolved start time or current time. What am I missing?
The text was updated successfully, but these errors were encountered: