Description
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:
When updating timeline current time, the start time of any attached animation is conditionally updated. For each attached animation, run the procedure for calculating an auto-aligned start time.
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:
If play state is idle, abort this procedure.
The play state is idle when:
All of the following conditions are true:
- The current time of animation is unresolved, and
- the start time of animation is unresolved, and
- animation does not have either a pending play task or a pending pause task,
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:
If the following three conditions are all satisfied:
- animation’s hold time is unresolved, and
- aborted pause is false, and
- animation does not have a pending playback rate,
abort this procedure.
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:
If any of the following are true:
- the animation has no associated timeline, or
- the associated timeline is inactive, or
- the animation’s start time is unresolved,
The current time is an unresolved time value.
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?