tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 866e3560b2613aa9e3db72a8681166e638bfed28
parent fa604ce0c5eec954b9192afe1ebed2a2af3e2be5
Author: Emilio Cobos Álvarez <emilio@crisal.io>
Date:   Tue,  4 Nov 2025 09:09:24 +0000

Bug 1997773 - Hide frameloader before nulling out embedder element from nsFrameLoader::Destroy(). r=smaug

Yeah, I know... non-trivial one-liner.

I found some weirdness while looking at bug 1994942. Issue is that I
tried to remove the nsView dependency by looking at the embedder
element (right now layout goes from child to parent frame via the view
tree).

This mostly works, except when the presshell is destroyed after the
frameloader. This patch prevents that from happening and makes the
timing a bit more predictable between subframes / reframes and process
switches, even though I ultimately found a workaround for that bug.

Differential Revision: https://phabricator.services.mozilla.com/D270957

Diffstat:
Mdom/base/nsFrameLoader.cpp | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/dom/base/nsFrameLoader.cpp b/dom/base/nsFrameLoader.cpp @@ -1865,6 +1865,9 @@ void nsFrameLoader::StartDestroy(bool aForProcessSwitch) { browserParent->RemoveWindowListeners(); } + // Hide the content viewer before nulling out the embedder element and so. + Hide(); + nsCOMPtr<Document> doc; bool dynamicSubframeRemoval = false; if (mOwnerContent) {