Bug 211019

Summary: [Web Animations] KeyframeEffect should ensure its target remains alive
Product: WebKit Reporter: Antoine Quint <graouts>
Component: AnimationsAssignee: Antoine Quint <graouts>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, dino, graouts, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Antoine Quint 2020-04-25 05:17:13 PDT
[Web Animations] KeyframeEffect should ensure its target remains alive
Comment 1 Antoine Quint 2020-04-25 05:19:09 PDT
Created attachment 397557 [details]
Patch
Comment 2 Daniel Bates 2020-04-25 08:22:42 PDT
Comment on attachment 397557 [details]
Patch

Patch looks good.
Comment 3 EWS 2020-04-25 09:08:50 PDT
Committed r260705: <https://trac.webkit.org/changeset/260705>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 397557 [details].
Comment 4 Radar WebKit Bug Importer 2020-04-25 09:09:16 PDT
<rdar://problem/62372184>
Comment 5 Darin Adler 2020-04-25 10:26:56 PDT
Comment on attachment 397557 [details]
Patch

What prevents this from causing a reference cycle?
Comment 6 Antoine Quint 2020-04-26 10:47:18 PDT
(In reply to Darin Adler from comment #5)
> Comment on attachment 397557 [details]
> Patch
> 
> What prevents this from causing a reference cycle?

If an element is attached to the tree, document teardown will cause the effect-to-element relationship to be cleared. If the element is loose, like the one in this patch's testcase, it will potentially remain until the animation's effect is kept alive. If there are no JS references to the effect, then the procedure to remove replaced animations as defined in https://drafts.csswg.org/web-animations-1/#remove-replaced-animations will take care of this.