Bug 211019 - [Web Animations] KeyframeEffect should ensure its target remains alive
Summary: [Web Animations] KeyframeEffect should ensure its target remains alive
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Animations (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Antoine Quint
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-04-25 05:17 PDT by Antoine Quint
Modified: 2020-04-26 10:47 PDT (History)
4 users (show)

See Also:


Attachments
Patch (5.13 KB, patch)
2020-04-25 05:19 PDT, Antoine Quint
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.