- From: Yehonatan Daniv via GitHub <sysbot+gh@w3.org>
- Date: Fri, 09 May 2025 09:42:43 +0000
- To: public-css-archive@w3.org
> Another use case to consider is developer tools where you have a button that pauses all animations and resumes them (as chrome dev tools has). I would expect that if I do the following: > > const paused = document.getAnimations().filter(anim => anim.playState == 'playing'); > paused.forEach(anim.pause()); > This would pause all of the animations in their current state, and then if I later call: > > paused.forEach(anim => anim.play()); > I'd expect it to restore the animations to the state they were in prior to pausing. With play arming the trigger, I think this code just works, however if it's a separate API to arm the triggers then developers will have to carefully handle that in some way. Yes, I think we're on the same page here. These 2 expectations I listed above as things we agree on: > - Effect of pause(), as in it should simply freeze the animation in place and also suppress the trigger's effect. > - Effect of play() after a pause/cancel should resume/reset the animation and reactivate the trigger's effect. I'm fine with the "arming the trigger" approach, as long as we agree on behavior and APIs. > 'm inclined to think that because play() is a very widely used API that is already familiar to authors as immediately playing the animation, the latter is more surprising. I agree that having `play()` only arm the trigger and not start playback may seem weird. Perhaps if both options are viable we should consider an addition to the API? Like `.play({ force: true })` which disables the trigger and forces playback to rewind and advance? I can easily see in my work both use-cases being valid in authoring tools. Both as resume "preview live behavior" with trigger armed and "force play" the animation. --------------- Regarding constructing an Animation with a trigger using WAAPI, since the animation starts in `idle` state I think it's expected that the trigger doesn't play it immediately until `play()` is called, either of it "arms" the trigger or some by other way. I think that is something we agree on. -- GitHub Notification of comment by ydaniv Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12119#issuecomment-2865888549 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Friday, 9 May 2025 09:42:44 UTC