Animations on button elements are not displayed in the animation panel
Categories
(DevTools :: Inspector: Animations, defect)
Tracking
(firefox147 verified, firefox148 verified)
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•2 months ago
|
| Assignee | ||
Comment 1•2 months 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•2 months 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•2 months ago
|
Comment 4•2 months ago
|
||
| bugherder | ||
Updated•2 months ago
|
Updated•2 months ago
|
Comment 5•2 months ago
|
||
Reproducible on a 2025-11-21 Firefox Nightly build on Windows 10.
Verified as fixed on Firefox Nightly 148.0a1 and Firefox 147.0b1 on Windows 10, macOS 15 and Ubuntu 22.
Description
•