- From: Brian Birtles via GitHub <noreply@w3.org>
- Date: Fri, 30 May 2025 01:19:01 +0000
- To: public-css-archive@w3.org
Replying to @flackr's [comment](https://github.com/w3c/csswg-drafts/issues/12119#issuecomment-2912647102): > > (Could scroll animations use something like this too?) > > Scroll animations are endpoint inclusive in a running state, however, if we make this endpoint state modification apply while running as well then we could use this. Good point. This will take a little investigation. From what I understand: - For `commitStyles` we only need to tweak the endpoint behavior instantaneously. - For animation triggers we want to tweak the endpoint behavior while we're in the paused state such that it resets when we leave the paused state. - For scroll animations we want to tweak the endpoint behavior while we're in the running state. We'll have to think about the cleanest way to cover those cases. > > we can scrap Animation.trigger and just have AnimationTrigger.arm(Animation) > > In this sort of a model I would just call it add/remove. This could either be AnimationTrigger.add/removeAnimation (similar to Element.add/removeEventListener) or AnimationTrigger.animations.add/remove (similar to Element.classList. Yes, that sounds better. > We should also consider whether we really need to have multiple animations per trigger. If instead we had an animation attribute or setter on the trigger we could say that setting it to a different animation disassociates the trigger from the original animation and might simplify some of the state management. If developers want to use the same trigger for multiple animations there just needs to be an easy way to construct a trigger with the same options as an existing trigger. Interesting. If that's the case, then I suppose you wouldn't even need `add`/`remove`—you could just pass the target to the constructor and then expose a `target` attribute for re-targeting purposes. -- GitHub Notification of comment by birtles Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12119#issuecomment-2920964501 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Friday, 30 May 2025 01:19:01 UTC