Closed Bug 1518982 Opened 2 years ago Closed 2 years ago

Animations with playbackRate == 0 should not be registered with the timeline

Categories

(Core :: DOM: Animation, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla66
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).

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.

Oops, pushed an empty patch.

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: nobody → bbirtles
Status: NEW → ASSIGNED
Pushed by bbirtles@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2f4920fa4ac7
Don't register animations with playbackRate == 0 with a timeline; r=hiro
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
You need to log in before you can comment on or make changes to this bug.