Animations on button elements are not displayed in the animation panel
Categories
(DevTools :: Inspector: Animations, defect)
Tracking
(firefox147 fixed)
| Tracking | Status | |
|---|---|---|
| firefox147 | --- | fixed |
People
(Reporter: nchevobbe, Assigned: nchevobbe)
Details
Attachments
(2 files)
Steps to reproduce
- Open test case
- Open the inspector
- Open the animation panel
Expected results
The animation on the button color is displayed
Actual results
The animation panel stays empty
| Assignee | ||
Updated•18 days ago
|
| Assignee | ||
Comment 1•18 days ago
•
|
||
There's an error in the browser toolbox:
TypeError: Window.getComputedStyle: Argument 1 is not an object.
getAnimationTimingFunction resource://devtools/server/actors/animation.js:336
getState resource://devtools/server/actors/animation.js:376
getCurrentState resource://devtools/server/actors/animation.js:406
form resource://devtools/server/actors/animation.js:180
getAnimationTimingFunction() {
...
let pseudo = null;
let target = this.player.effect.target;
if (target.type) {
// Animated element is a pseudo element.
pseudo = target.type;
target = target.element;
}
return this.window.getComputedStyle(target, pseudo).animationTimingFunction;
}
Here, for a <button> element, target.type does return something (e.g. "button", "submit", …), and so we re-assign target with target.element, which is undefined.
Note that it's probably not returning what we want for pseudo element either: target is always the binding element, not the actual pseudo element anonymous node, so we wouldn't go inside the if block when we have pseudo elements.
| Assignee | ||
Comment 2•18 days ago
|
||
In the class, there were a couple places where we would check the animation target
type property as a way to detect if the animated element was a pseudo element.
This means that we were considering button elements as pseudo element, and re-assigning
variables with erroneous properties, which would ultimately make the methods throw.
This is also wrong for pseudo elements: the animation target is always the binding
element and we have a pseudoElement string property on the animation to detect
if this applies to a pseudo element.
We fix the faulty callsites and add a server test that is covering this.
Updated•18 days ago
|
Comment 4•17 days ago
|
||
| bugherder | ||
Updated•2 hours ago
|
Description
•