Element.animate() throws error but should return Animation object
Categories
(Core :: DOM: Animation, defect)
Tracking
()
People
(Reporter: seanmonahan, Unassigned)
Details
(Keywords: parity-chrome)
Attachments
(1 file)
448 bytes,
text/html
|
Details |
Steps to reproduce:
- Load to example: https://codepen.io/seanms/pen/ZYEpoNP?editors=1111
- Open the console so you can see logging
- Click "append frame"
- Click "create element"
- Click "remove frame"
- Click "animate element"
- Observe the error message in the console
Actual results:
An error is thrown.
Expected results:
An Animation object should be returned.
Here's the relevant spec: https://drafts.csswg.org/web-animations-1/#dom-animatable-animate
And MDN: https://developer.mozilla.org/en-US/docs/Web/API/Element/animate#return_value
Comment 1•6 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::DOM: Core & HTML' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•6 months ago
|
||
According to the spec, throwing an exception is right thing instead of null
like Chrome...
Looks like that the method is created by Brian and maintained by Arai-san. Ccing them.
Comment 3•6 months ago
|
||
Yeah, Chrome is definitely wrong here. Animatable.animate
should never return null
.
It's still probably worth checking what step is triggering the exception and making sure the spec agrees that an exception should be thrown in that case. (I'm assuming it's to do with the fact that we need to create the KeyframeEffect
in the relevant realm of globalElement
but the corresponding iframe
has been removed.)
Comment 4•5 months ago
|
||
The severity field is not set for this bug.
:boris, could you have a look please?
For more information, please visit BugBot documentation.
Comment 5•5 months ago
|
||
Comment 6•5 months ago
|
||
(In reply to Brian Birtles (:birtles) from comment #3)
Yeah, Chrome is definitely wrong here.
Animatable.animate
should never returnnull
.It's still probably worth checking what step is triggering the exception and making sure the spec agrees that an exception should be thrown in that case. (I'm assuming it's to do with the fact that we need to create the
KeyframeEffect
in the relevant realm ofglobalElement
but the correspondingiframe
has been removed.)
In Gecko, I just run the test and trace what we did. We trigger an exception and return null (implementation-dependent because there is an error):
https://searchfox.org/mozilla-central/rev/f07a6b1e84a609fbf9746f67be9edd43b3ed3362/dom/base/Element.cpp#4077
Yes, per spec it doesn't say animate()
may return null
. So I think this is more like a spec issue. (I am trying to file a spec issue for this, so close the bug for now)
Comment 7•5 months ago
|
||
Mark this invalid for now. Once we have more information from spec issue, we may reopen this.
Comment 8•5 months ago
|
||
Description
•