Re: [csswg-drafts] [web-animations-2][css-animations-2]Should an animation-trigger prevent its animation from taking effect until the trigger says so? (#11971)

> > The way I'm thinking about it is: say we have an `animation-fill-mode: both/backwards` animation which is yet to trigger. Although the animation's effect is in effect before the animation is triggered, `animationstart` doesn't fire until the animation is triggered and is advancing. The "and is advancing" part means that if the the element has `animation-play-state: paused` it still doesn't fire, until/unless perhaps `animation-play-state` changes to `running`?
>
> Yes, I agree with that. If that needs to be explicit in the spec then we should probably add an issue for that.

I opened another issue specifically regarding interaction of `animation-trigger` with `animation-play-state`, and how/when events should trigger here #12064.

---------------------

Regarding making an [animation relevant](https://drafts.csswg.org/web-animations-1/#relevant-animations), currently the spec says:

> An [animation](https://drafts.csswg.org/web-animations-1/#concept-animation) is relevant if:
>
> Its [associated effect](https://drafts.csswg.org/web-animations-1/#animation-associated-effect) is [current](https://drafts.csswg.org/web-animations-1/#current) or [in effect](https://drafts.csswg.org/web-animations-1/#in-effect), and
>
> Its [replace state](https://drafts.csswg.org/web-animations-1/#replace-state) is not [removed](https://drafts.csswg.org/web-animations-1/#removed-replace-state).

So the associated effect may not be `in effect` but it may be `current` according to [this](https://drafts.csswg.org/web-animations-1/#current):

> An [animation effect](https://drafts.csswg.org/web-animations-1/#animation-effect) is current if any of the following conditions are true:
> 
> - the [animation effect](https://drafts.csswg.org/web-animations-1/#animation-effect) is [in play](https://drafts.csswg.org/web-animations-1/#in-play), or
> 
> - the [animation effect](https://drafts.csswg.org/web-animations-1/#animation-effect) is in the [before phase](https://drafts.csswg.org/web-animations-1/#animation-effect-before-phase) and is [associated with an animation](https://drafts.csswg.org/web-animations-1/#animation-effect-associated-animation) with a [playback rate](https://drafts.csswg.org/web-animations-1/#playback-rate) > 0, or
> 
> - the [animation effect](https://drafts.csswg.org/web-animations-1/#animation-effect) is in the [after phase](https://drafts.csswg.org/web-animations-1/#animation-effect-after-phase) and is [associated with an animation](https://drafts.csswg.org/web-animations-1/#animation-effect-associated-animation) with a [playback rate](https://drafts.csswg.org/web-animations-1/#playback-rate) < 0, or
> 
> - the [animation effect](https://drafts.csswg.org/web-animations-1/#animation-effect) is [associated with an animation](https://drafts.csswg.org/web-animations-1/#animation-effect-associated-animation) not in the [idle](https://drafts.csswg.org/web-animations-1/#play-state-idle) [play state](https://drafts.csswg.org/web-animations-1/#animation-play-state) with a non-null associated [timeline](https://drafts.csswg.org/web-animations-1/#timeline) that is not [monotonically increasing](https://drafts.csswg.org/web-animations-1/#monotonically-increasing-timeline).

**So proposing**:
Add another condition to the definition of `current animation effect`:
- the animation effect is associated with an animation, that is associated with a trigger with a non-monotonically increasing timeline and a `type` of either `repeat` or `alternate`.

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


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

Received on Wednesday, 9 April 2025 19:38:58 UTC