Animations when repeated by using the .play() function instead of by iterations aren't shown to be repeating on the animations tab in the inspect panel.
Categories
(DevTools :: Inspector: Animations, defect, P3)
Tracking
(Not tracked)
People
(Reporter: AshBoomstick1, Unassigned)
Details
Attachments
(4 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:137.0) Gecko/20100101 Firefox/137.0
Steps to reproduce:
I inspected an element on a webpage that has an animation running on it that gets played periodically.
I went to the animations tab for that element in the inspect panel.
Actual results:
I saw the animation would be shown to only play once on the animation tab in the inspect panel but I would see it play multiple times in the webpage.
Expected results:
The animation should be shown to be repeating in the animation inspect panel.
Updated•18 days ago
|
Updated•18 days ago
|
Comment 1•17 days ago
|
||
Thanks for filing, can you share a simple test case, with the HTML and the JS so that we can understand the use case?
Reporter | ||
Comment 2•16 days ago
|
||
This is the html source file for my most basic example of the issue.
Reporter | ||
Comment 3•16 days ago
|
||
Reporter | ||
Comment 4•16 days ago
|
||
you can see when you run the html file with the new js file that both animations are running and in the animation panel in the inspect window, you can only see the animation with an iterator on it repeating (anim2), while it looks like anim1 only runs once.
Comment 5•16 days ago
|
||
thanks! I added the script to the HTML example so that we can directly check it from the bug.
Comment 6•16 days ago
|
||
Moving back to triage, and back to defect.
The behavior is definitely confusing. When you open the animation inspector, you will see a first animation displayed for anim1
and subsequent animations have no effect on the panel.
We do get mutations for each "iteration" in the animation actor at https://searchfox.org/mozilla-central/rev/6cc05c6620814bf3eb05278ccf3b1f49690b7740/devtools/server/actors/animation.js#680
When the animation ends we receive "removedAnimation" but since the status is "finished" we don't actually the corresponding actor:
// Note that animations are reported as removed either when they are
// actually removed from the node (e.g. css class removed) or when they
// are finished and don't have forwards animation-fill-mode.
// In the latter case, we don't send an event, because the corresponding
// animation can still be seeked/resumed, so we want the client to keep
// its reference to the AnimationPlayerActor.
if (player.playState !== "idle") {
continue;
}
Afterwards, we get the same animation again as an "addedAnimation", but since it's for the exact same animation instance, we don't process it:
https://searchfox.org/mozilla-central/rev/6cc05c6620814bf3eb05278ccf3b1f49690b7740/devtools/server/actors/animation.js#707-711
// If the added player already exists, it means we previously filtered
// it out when it was reported as removed. So filter it out here too.
if (this.actors.find(a => a.player === player)) {
continue;
}
This is possibly fine, if we want to keep the same player for this animation. But then we need to update the player to be able to process this, probably in its own onAnimationMutations logic at https://searchfox.org/mozilla-central/rev/6cc05c6620814bf3eb05278ccf3b1f49690b7740/devtools/server/actors/animation.js#415
Updated•10 days ago
|
Description
•