Re: [csswg-drafts] [web-animations-1][scroll-animations-1] Animations on inactive timelines should still become ready (#9256)

Disclaimer: I'm out of my league when talking about the JS Web Animations API (I've never really used it, only working with animations in CSS), so I'm not sure if my comment would bring anything to the conversation, but I'm a bit confused when looking at scroll-driven animations and thinking about terms like “play an animation”, "ready”, etc.

In my mental model for scroll-driven animations, they're just a mapping of the current scroll and position to the style derived for the keyframes, which can be updated arbitrarily, either on scroll or even when there is no scroll happening, as a lot of animations can be based on elements' _positions_ in their scrollports, regardless of them being scrollable (either no overflow when `overflow: auto`, or when `overflow: hidden`) (for view timelines — I would be mostly talking about them; for scroll timelines things seem to be more in line, but maybe there are nuances).

And, because the styles are applied regardless of the scroll position, I tend to think that the animation is _active_ due to us being able to “resolve” the “time” for such an animation (and it could change if the element's position or the container size changed).

(I can provide my [Position-Driven Styles](https://kizu.dev/position-driven-styles/) article as a potential source for use-cases of that aspect — static mapping of the scroll-driven animations for non-scrollable containers.)

So, when I look at the following excerpt from the spec:

> If the 0% position and 100% position coincide (i.e. the denominator in the [current time](https://drafts.csswg.org/web-animations-1/#timeline-current-time) formula is zero), the timeline is [inactive](https://drafts.csswg.org/web-animations-1/#inactive-timeline).

in my mind the “inactive” would happen only when the _range_ is such that its _length_ is zero, thus 0% and 100% positions coinciding, but this is unrelated to if the container is scrollable, as the element's position, its size and the container's size can impact this for a view timeline.


-- 
GitHub Notification of comment by kizu
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9256#issuecomment-1712476514 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Saturday, 9 September 2023 10:16:00 UTC