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

Making `play-forwards` a noop if the animation is finished seems reasonable. However, with Rob's example it seems like we catered to that use case when we extended the notion of statefulness to event triggers. I.e. if you wanted to bind the pointerdown and pointerup events as the example is trying to do, you would leverage the statefulness of a single trigger as follows:

```
@keyframes press-animation {
  to: { transform: translate2d(-5px, 5px); }
}

button {
  animation: press-animation forwards;
  event-trigger: --press pointerdown pointerup;
  animation-trigger: --press play-forwards play-backwards;
}
```

This would match the intended behavior right, @flackr?

My reading of the keywords was something like this:

- `play` means no qualification of direction or frequency,
- `play-once` qualifies frequency but not direction,
- `play-forwards` qualifies direction but not frequency.

One more thing to consider is whether a developer might indeed intend to create this independence between the pointerdown and pointer up. Making `play-forwards` a noop in makes this use case not possible?

Re: @ydaniv

> 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.


-- 
GitHub Notification of comment by DavMila
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13643#issuecomment-4057082986 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 18:12:58 UTC