Update getAnimations parameter to match latest spec
Categories
(Core :: DOM: Animation, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox69 | --- | fixed |
People
(Reporter: birtles, Assigned: birtles)
Details
(Keywords: dev-doc-complete)
Attachments
(2 files)
We have implemented a { subtree: true }
flag in Animatable.getAnimations()
for quite a while but I've only recently specified it. (We don't ship getAnimations()
anywhere yet.)
- Issue: https://github.com/w3c/csswg-drafts/issues/2058
- PR: https://github.com/w3c/csswg-drafts/pull/3902
- Commit: https://github.com/w3c/csswg-drafts/commit/cf3a00ee5cdba2223d51d9e57ac31d25873c90ca
The spec text uses slightly different naming for this parameter so this bug is just about bringing our naming up-to-date and adding a few WPT for it.
Assignee | ||
Comment 1•5 years ago
|
||
As per spec text added here:
https://github.com/w3c/csswg-drafts/commit/cf3a00ee5cdba2223d51d9e57ac31d25873c90ca
Assignee | ||
Comment 2•5 years ago
|
||
Depends on D31944
Assignee | ||
Comment 3•5 years ago
|
||
Chris, I'd like to document this method on MDN but I'm a bit unsure how to proceed.
The situation is:
- There is a
getAnimations()
method onDocument
which is documented here:Document.getAnimations()
- There is also a
getAnimations()
method on theAnimatable
mixin interface. This is not documented anywhere. - This bug adds a parameter to
getAnimations()
onAnimatable
(notDocument
). - The
Animatable
mixin interface also defines theanimate()
method. Element
andCSSPSeudoElement
implement theAnimatable
mixin interface.- Currently we document
animate()
as it applies toElement
on this page:Element.animate()
. - Technically I guess
animate()
should be on theAnimatable
mixin interface but probably 99.9% of the time people use it, they use it on anElement
and I'm not sure if MDN supports mixins. I would want to make sure that when a user looks upElement
's methods,animate()
shows up there.
So should I just add a page Element.getAnimations()
? Or should we move Element.animate()
to Animatable/animate
and link to it from Element
somehow?
For what's its worth, I started writing the introduction to such a page:
The
getAnimations()
method of theAnimatable
interface returns an array of allAnimation
objects affecting this element or which are scheduled to do so in future. It can optionally returnAnimation
objects for descendant elements too. This array includes CSS Animations, CSS Transitions, and Web Animations.
Comment 4•5 years ago
|
||
So should I just add a page Element.getAnimations() ? Or should we move Element.animate() to Animatable/animate and link to it from Element somehow?
Hi Brian! I would just add the Element.getAnimations() page. We don't have a proper mechanism to support mixins currently, and have in the past opted to document them just like regular interfaces and just duplicate the lists of methods/properties on the pages for the interfaces that include them. But there is evidence that MDN readers are confused by this. Mixins are a spec device that really shouldn't be thust upon regular web devs.
Really what we need is some kind of inheritance mechanism that allows us to define the mixin content somewhere, say what implements it, and then have it show up just on the pages for the implementing interfaces. But we're not there yet.
If you are concerned about making sure the inheritance is specified somewhere, you could always put a note in the "Specifications" section that says something about getAnimations() being specified on the Animatable mixin, which is implemented by Element and CSSPseudoElement (which we've not documented yet...).
Assignee | ||
Comment 5•5 years ago
|
||
(In reply to Chris Mills (Mozilla, MDN editor) [:cmills] from comment #4)
So should I just add a page Element.getAnimations() ? Or should we move Element.animate() to Animatable/animate and link to it from Element somehow?
Hi Brian! I would just add the Element.getAnimations() page. We don't have a proper mechanism to support mixins currently, and have in the past opted to document them just like regular interfaces and just duplicate the lists of methods/properties on the pages for the interfaces that include them. But there is evidence that MDN readers are confused by this. Mixins are a spec device that really shouldn't be thust upon regular web devs.
Makes sense. Thanks!
I've added https://developer.mozilla.org/en-US/docs/Web/API/Element/getAnimations for now and tidied up a few other pages so they link to it as appropriate. I think I still need to add the BCD entry however.
Really what we need is some kind of inheritance mechanism that allows us to define the mixin content somewhere, say what implements it, and then have it show up just on the pages for the implementing interfaces. But we're not there yet.
Yep, that sounds good, but it also sounds like quite a bit of work to make happen.
If you are concerned about making sure the inheritance is specified somewhere, you could always put a note in the "Specifications" section that says something about getAnimations() being specified on the Animatable mixin, which is implemented by Element and CSSPseudoElement (which we've not documented yet...).
I've linked do the definition on the Animatable
mixin so if authors are curious about where and how it is defined they can find it from there.
Assignee | ||
Comment 6•5 years ago
|
||
Added the BCD data PR: https://github.com/mdn/browser-compat-data/pull/4201
Pushed by bbirtles@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8b8349028050 Update naming of parameter to getAnimations to match spec; r=bzbarsky https://hg.mozilla.org/integration/autoland/rev/68b958d1b1e9 Add web-platform-tests for { subtree: true } option to Animatable.getAnimations; r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/16967 for changes under testing/web-platform/tests
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
Comment 10•5 years ago
|
||
I've added https://developer.mozilla.org/en-US/docs/Web/API/Element/getAnimations for now and tidied up a few other pages so they link to it as appropriate. I think I still need to add the BCD entry however.
I've had a look, and given it a small copy edit. Looks great — thanks for doing that Brian.
Comment 11•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/8b8349028050
https://hg.mozilla.org/mozilla-central/rev/68b958d1b1e9
Upstream PR merged
Description
•