StaticRange doesn't keep its start and end containers alive right now. As a result, some DOM nodes can get garbage collected prematurely.
Created attachment 418807 [details] Fixes the bug
Comment on attachment 418807 [details] Fixes the bug View in context: https://bugs.webkit.org/attachment.cgi?id=418807&action=review > Source/WebCore/ChangeLog:9 > + To do that, we sff them as opaque roots during the marking phase in visitAdditionalChildren. Nit - sff => add
(In reply to Wenson Hsieh from comment #2) > Comment on attachment 418807 [details] > Fixes the bug > > View in context: > https://bugs.webkit.org/attachment.cgi?id=418807&action=review > > > Source/WebCore/ChangeLog:9 > > + To do that, we sff them as opaque roots during the marking phase in visitAdditionalChildren. > > Nit - sff => add Fixed. Thanks for the review!
Committed r272114: <https://trac.webkit.org/changeset/272114>
<rdar://problem/73788028>
Should we add a test to make sure that we can’t create a reference cycle that causes leaks by having a static range as the value of a property on one of its endpoint nodes?
(In reply to Darin Adler from comment #6) > Should we add a test to make sure that we can’t create a reference cycle > that causes leaks by having a static range as the value of a property on one > of its endpoint nodes? Maybe? I guess we can artificially introduce a leaking bug & verify the test works?
We have tests for this, like LayoutTests/fast/dom/reference-cycle-leaks.html, but I don’t think we have one that covers StaticRange.
(In reply to Darin Adler from comment #8) > We have tests for this, like > LayoutTests/fast/dom/reference-cycle-leaks.html, but I don’t think we have > one that covers StaticRange. Alright, filed https://bugs.webkit.org/show_bug.cgi?id=222786 to add those tests.