Animations with playbackRate == 0 should not be registered with the timeline
Categories
(Core :: DOM: Animation, enhancement, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox66 | --- | fixed |
People
(Reporter: birtles, Assigned: birtles)
References
Details
Attachments
(1 file)
As Hiro points out, given:
const anim = div.animate(..., { duration: 1000, delay: 1000 });
anim.playbackRate = 0;
anim = undefined;
Then as of bug 1518403 the animation will no longer be returned by getAnimations() but will still be registered with the AnimationTimeline since NeedsTicks() will return true since anim.playState will be "running". As a result we end up effectively leaking anim.
Note that anim.effect will NOT be registered with the EffectSet since anim should not be relevant at this point (not current or in effect).
The suggested solution is to make sure animations with playbackRate == 0 are not registered with a timeline (i.e. NeedsTicks() returns false).
| Assignee | ||
Comment 1•7 years ago
|
||
I'm not sure how to write an automated test for this. I guess as long as no existing tests break with this change then it should be fine.
| Assignee | ||
Comment 2•7 years ago
|
||
Let's see how this goes:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=cd976100753820576c63bf8364241bc251f2dfc3
| Assignee | ||
Comment 3•7 years ago
|
||
Oops, pushed an empty patch.
| Assignee | ||
Comment 4•7 years ago
|
||
| Assignee | ||
Comment 5•7 years ago
|
||
I'm going to tentatively put this up for review because I won't be around when the try run ends but the relevant tests seem to pass locally.
| Assignee | ||
Comment 6•7 years ago
|
||
| Assignee | ||
Updated•7 years ago
|
Comment 8•7 years ago
|
||
| bugherder | ||
Description
•