Re: [csswg-drafts] Consider adding an animation constructor that also builds out an effect (#11631)

I don't think this would break anything but it's also sort of intentional that we don't do this.

The reason is keyframe effects are intended to be just one type of animation effect with other types including:

- Group effects
- Custom/JS effects
- Video effects
- etc.

Animations are supposed to be agnostic of the type of effect they are driving. As a result, there's nothing in the `Animation` interface that's specific to keyframe effects.

We added the `Animatable.animate()` shortcut as a way to simplify the common case of creating an `Animation` and a `KeyframeEffect` but deliberately avoided tying `Animation`s to `KeyframeEffect`s directly.

Adding this shortcut to the `Animation` constructor would work but it would also somewhat dilute that distinction.

Is there any particular need for this?

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


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

Received on Saturday, 1 February 2025 04:22:34 UTC