web-platform-dx / web-features

Exploring how to present Web platform features adoptability
https://web-platform-dx.github.io/web-features/
Apache License 2.0
382 stars 74 forks source link

Revise web-animations feature #2244

Open flackr opened 1 week ago

flackr commented 1 week ago

Specification

https://www.w3.org/TR/web-animations-1/

Description

The feature description for web-animations describes it as "The animate() method of Element objects", however animations can also be constructed with the Animation constructor and the web animations API can be used on CSS animations and transitions after getting the Animation objects using the getAnimations() method on a document or Element.

I propose we revise the description to clearly include these other means of using the web animations APIs.

Documentation

N/A This is a proposed revision to the existing feature

Browser support

N/A This is a proposed revision to the existing feature

ddbeck commented 4 days ago

Hi @flackr and welcome to web-features.

I've got some background on this description and then a question for you.

This feature is described in terms of animate() because we're aligning to how caniuse represents web animations as a high-level feature. Although it's possible to work with animations in other ways, caniuse doesn't condition support on those ways, some of which came later (e.g., getAnimations()). We can't (significantly) change this description without breaking our link to the caniuse feature (that is to say, we can't continue to claim to be talking about the same feature as caniuse).

Right now, we're working on an initial pass of the platform, to capture everything (albeit rather imperfectly). We have a number of issues open to better address what we've been calling "later additions" and this appears to be one of them. Those other methods are in fact part of the feature, but they don't contribute to the overall headline status. See https://github.com/web-platform-dx/web-features/blob/main/features/web-animations.yml.dist for details.

Given this background, does the description make some more sense? Would it be helpful to have distinct features for some of the later additions? Or is it still the case that your model of "web animations" must have Animate() and getAnimations() as well as animate()?

flackr commented 4 days ago

Hi @flackr and welcome to web-features.

I've got some background on this description and then a question for you.

This feature is described in terms of animate() because we're aligning to how caniuse represents web animations as a high-level feature.

The definition on the linked page supports the modification here, in particular it says:

Although it's possible to work with animations in other ways, caniuse doesn't condition support on those ways, some of which came later (e.g., getAnimations()). We can't (significantly) change this description without breaking our link to the caniuse feature (that is to say, we can't continue to claim to be talking about the same feature as caniuse).

I believe it is the very same feature. Browser versions that only support Element.animate are listed as partial support on caniuse.

Right now, we're working on an initial pass of the platform, to capture everything (albeit rather imperfectly). We have a number of issues open to better address what we've been calling "later additions" and this appears to be one of them. Those other methods are in fact part of the feature, but they don't contribute to the overall headline status. See https://github.com/web-platform-dx/web-features/blob/main/features/web-animations.yml.dist for details.

I think this is important in establishing what counts as use and tests of the described feature.

Given this background, does the description make some more sense? Would it be helpful to have distinct features for some of the later additions? Or is it still the case that your model of "web animations" must have Animate() and getAnimations() as well as animate()?

I think it is still the case that it must have new Animation() and getAnimations() as well.

ddbeck commented 3 days ago

Thanks for the update, @flackr. I think I've misunderstood some pieces of this, so I'm going to take a closer look at the data and see what I can do here with the feature pinning, to unblock changing the description.