script: Remove named window proxy map entry when destroying nested browsing context (#42344)

Leaving the entries sitting around both unnecessarily increases memory
usage and breaks code that looks up window proxies by name and reuses
names for iframes within the same page.

Testing: Newly-passing tests.
Fixes: #15258

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Josh Matthews
2026-02-04 14:46:06 -05:00
committed by GitHub
parent 97aac6e70a
commit e2dba87301
5 changed files with 7 additions and 98 deletions

View File

@@ -448,7 +448,9 @@ impl HTMLIFrameElement {
self.pending_pipeline_id.set(None);
self.about_blank_pipeline_id.set(None);
self.webview_id.set(None);
self.browsing_context_id.set(None);
if let Some(browsing_context_id) = self.browsing_context_id.take() {
self.script_window_proxies.remove(browsing_context_id)
}
}
pub(crate) fn update_pipeline_id(