Re: [csswg-drafts] [scroll-animations-1] Interaction with 'animation-iteration-count' (#8233)

+1 to what @kevers-google, we have implemented (and spec'd in [web-animations-2 intrinsic iteration duration](https://drafts.csswg.org/web-animations-2/#intrinsic-iteration-duration)) to split the length between iterations.

> In the latter case, things get weird if keyframes are attached using named range offsets. We could...
>
> attach those frames, then ignore them while attaching any other frames using the iteration count
> attach those frames, then split the timeline up by those frames and iterate any other keyframes within each interval
something else?

From a pure API point of view, I would expect these keyframes to work similarly to how they behave when they are outside of the `animation-range`, that being they produce a negative or positive offset within the effect.

However, animations don't create extra sets of keyframes for each iteration so having the keyframes be different for each iteration is not something that easily maps to animations. I would propose that we take a naive position and either ignore these keyframes or calculate their progress assuming a single iteration even though it will no longer map correctly after the range is split between iterations. My preference would be for the latter as I think it would be the closest to honoring what the dev asked for. E.g. if your animation-range is enter, and your keyframes are `enter 0%` and `enter 100%`, having 2 iterations would result in the effect playing twice.

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


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

Received on Wednesday, 25 January 2023 14:09:14 UTC