RESOLVED FIXED 293183
Allow renderers to get destroyed async after detach
https://bugs.webkit.org/show_bug.cgi?id=293183
Summary Allow renderers to get destroyed async after detach
alan
Reported 2025-05-17 11:38:59 PDT
ssia
Attachments
Patch (10.86 KB, patch)
2025-05-17 11:50 PDT, alan
no flags
Patch with dependencies (55.83 KB, patch)
2025-05-17 16:20 PDT, alan
no flags
Patch with dependencies (62.76 KB, patch)
2025-05-17 18:41 PDT, alan
no flags
Patch with dependencies (64.33 KB, patch)
2025-05-18 06:50 PDT, alan
no flags
Patch with dependencies (65.55 KB, patch)
2025-05-18 10:02 PDT, alan
ews-feeder: commit-queue-
Patch (10.92 KB, patch)
2025-05-19 16:49 PDT, alan
no flags
Patch (8.72 KB, patch)
2025-05-19 19:46 PDT, alan
no flags
Patch (8.71 KB, patch)
2025-05-20 08:48 PDT, alan
ews-feeder: commit-queue-
Patch (8.71 KB, patch)
2025-05-20 09:00 PDT, alan
no flags
Patch (8.99 KB, patch)
2025-05-20 18:37 PDT, alan
no flags
Patch (8.86 KB, patch)
2025-05-20 19:24 PDT, alan
no flags
Patch (8.86 KB, patch)
2025-05-21 13:39 PDT, alan
no flags
[fast-cq]Patch (8.86 KB, patch)
2025-05-21 20:10 PDT, alan
no flags
alan
Comment 1 2025-05-17 11:50:57 PDT
alan
Comment 2 2025-05-17 16:20:56 PDT
Created attachment 475287 [details] Patch with dependencies
alan
Comment 3 2025-05-17 18:41:14 PDT
Created attachment 475289 [details] Patch with dependencies
alan
Comment 4 2025-05-18 06:50:24 PDT
Created attachment 475293 [details] Patch with dependencies
alan
Comment 5 2025-05-18 10:02:22 PDT
Created attachment 475295 [details] Patch with dependencies
alan
Comment 6 2025-05-19 16:49:04 PDT
alan
Comment 7 2025-05-19 19:46:03 PDT
alan
Comment 8 2025-05-20 08:48:40 PDT
alan
Comment 9 2025-05-20 09:00:18 PDT
Simon Fraser (smfr)
Comment 10 2025-05-20 10:47:44 PDT
Comment on attachment 475320 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=475320&action=review > Source/WebCore/page/LocalFrameViewLayoutContext.cpp:762 > + auto isEligibleForDelayedDeletation = [&] { Typo
Antti Koivisto
Comment 11 2025-05-20 11:48:42 PDT
Comment on attachment 475320 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=475320&action=review > Source/WebCore/page/LocalFrameViewLayoutContext.cpp:756 > +static constexpr int maximumNumberOfDetachedRenderers = 5000; could be in the function scope > Source/WebCore/page/LocalFrameViewLayoutContext.cpp:772 > + if (m_renderers.size() == maximumNumberOfDetachedRenderers) > + return false; > + // FIXME: Cleanup RenderWidget's destruction process (ref vs. delete this. see RenderObject::destroy) > + return !is<RenderWidget>(detachedRenderer); > + }; > + if (isEligibleForDelayedDeletation()) { > + m_renderers.append(detachedRenderer.release()); > + return true; > + } > + return false; or I guess we could fully delete the contents of the previous list and start building a new one at this point
alan
Comment 12 2025-05-20 18:37:58 PDT
alan
Comment 13 2025-05-20 19:24:00 PDT
alan
Comment 14 2025-05-20 19:26:21 PDT
(In reply to Antti Koivisto from comment #11) > Comment on attachment 475320 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=475320&action=review > > > Source/WebCore/page/LocalFrameViewLayoutContext.cpp:756 > > +static constexpr int maximumNumberOfDetachedRenderers = 5000; > > could be in the function scope > > > Source/WebCore/page/LocalFrameViewLayoutContext.cpp:772 > > + if (m_renderers.size() == maximumNumberOfDetachedRenderers) > > + return false; > > + // FIXME: Cleanup RenderWidget's destruction process (ref vs. delete this. see RenderObject::destroy) > > + return !is<RenderWidget>(detachedRenderer); > > + }; > > + if (isEligibleForDelayedDeletation()) { > > + m_renderers.append(detachedRenderer.release()); > > + return true; > > + } > > + return false; > > or I guess we could fully delete the contents of the previous list and start > building a new one at this point we surely could!
Antti Koivisto
Comment 15 2025-05-21 09:28:32 PDT
Comment on attachment 475326 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=475326&action=review > Source/WebCore/rendering/updating/RenderTreeBuilder.cpp:236 > + auto* rendererToDelete = toDestroy.get(); could probably be a CheckedRef
alan
Comment 16 2025-05-21 13:39:15 PDT
alan
Comment 17 2025-05-21 15:52:25 PDT
(In reply to Antti Koivisto from comment #15) > Comment on attachment 475326 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=475326&action=review > > > Source/WebCore/rendering/updating/RenderTreeBuilder.cpp:236 > > + auto* rendererToDelete = toDestroy.get(); > > could probably be a CheckedRef ofc
alan
Comment 18 2025-05-21 20:10:49 PDT
Created attachment 475340 [details] [fast-cq]Patch
EWS
Comment 19 2025-05-22 05:15:16 PDT
Committed 295267@main (09f66151f2c1): <https://commits.webkit.org/295267@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 475340 [details].
Radar WebKit Bug Importer
Comment 20 2025-05-22 05:24:43 PDT
Note You need to log in before you can comment on or make changes to this bug.