Re: [csswg-drafts] [animation-triggers-1] Should play-forwards and play-backwards have no effect if the animation has already reached its end? (#13643)

> > You can't re-trigger any state, you can only switch states, and therefor making this behavior impossible.
>
> I think your interpretation of statefulness is right but in Rob's example you'd have two separate triggers (--press & --depress) whose states are independent of each other so you'd be able to trigger again.

Right, I completely missed the fact these are 2 separate triggers!

One (tiny, but important) thing about your example, it needs a `/` between the events as `pointerdown / pointerup` to be stateful:

> If a / is used in the value, the [event trigger](https://drafts.csswg.org/animation-triggers-1/#event-trigger) is stateful; the set of events before the / are the event trigger’s [enter events](https://drafts.csswg.org/animation-triggers-1/#event-trigger-enter-event), while those after the / are the [exit events](https://drafts.csswg.org/animation-triggers-1/#event-trigger-exit-event). (The same events can occur in both sets.)

But, your intent is correct.

Regarding the OP, though the example is a bit contrived, you could think of an example with 2 buttons, which is more likely to occur:

```css
.button-1 {
  event-trigger: --c1 click / click;
}

.button-2 {
  event-trigger: --c2 click / click;
}

.target {
  animation: slide 1s both;
  animation-trigger: --c1 play-forwards play-backwards --c2 play-forwards play-backwards;
}
```

So probably the naive interpretation of the above would be:

1. Click on button 1 slides forwards
2. Click on button 2 slides backwards

But since the state is managed in the trigger, and we have 2 separate triggers, what we actually get is:

1. Click on button 1 slides forwards
2. Click on button 2 slides forwards

And, as I understand it, this is what @flackr is trying to prevent, and I agree, otherwise, having multiple triggers per animation becomes kind of useless.

I'm not sure I have the correct, solution for this at the moment, but just wanted to see we're on the same page about the problem.

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


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

Received on Friday, 13 March 2026 22:38:41 UTC