Bug 1689601, nested freeze/thaw, r=peterv

Non-SHIP bfcache seems to be rather complicated here, since it needs to explicitly store inner windows and what not.
SHIP should be able to handle this in a simpler way.
It is possible that some ordering needs still tweaking.

Differential Revision: https://phabricator.services.mozilla.com/D105360
This commit is contained in:
Olli Pettay
2021-03-02 09:44:13 +00:00
parent 4705d4b957
commit acff739734
6 changed files with 57 additions and 51 deletions

View File

@@ -1213,10 +1213,9 @@ void nsDocShell::FirePageHideShowNonRecursive(bool aShow) {
if (doc) {
if (mBrowsingContext->IsTop()) {
doc->NotifyPossibleTitleChange(false);
if (mScriptGlobal && mScriptGlobal->GetCurrentInnerWindowInternal()) {
// XXXBFCache Resume doesn't go through oop iframes.
mScriptGlobal->GetCurrentInnerWindowInternal()->Thaw();
}
}
if (mScriptGlobal && mScriptGlobal->GetCurrentInnerWindowInternal()) {
mScriptGlobal->GetCurrentInnerWindowInternal()->Thaw(false);
}
nsCOMPtr<nsIChannel> channel = doc->GetChannel();
if (channel) {
@@ -1229,8 +1228,7 @@ void nsDocShell::FirePageHideShowNonRecursive(bool aShow) {
}
RefPtr<PresShell> presShell = GetPresShell();
if (presShell) {
// XXXBFcache Thaw doesn't deal with OOP iframes.
presShell->Thaw();
presShell->Thaw(false);
}
}
} else if (!mFiredUnloadEvent) {
@@ -1239,16 +1237,12 @@ void nsDocShell::FirePageHideShowNonRecursive(bool aShow) {
mFiredUnloadEvent = true;
contentViewer->PageHide(false);
if (mBrowsingContext->IsTop()) {
if (mScriptGlobal && mScriptGlobal->GetCurrentInnerWindowInternal()) {
// XXXBFCache Resume doesn't go through oop iframes.
mScriptGlobal->GetCurrentInnerWindowInternal()->Freeze();
}
if (mScriptGlobal && mScriptGlobal->GetCurrentInnerWindowInternal()) {
mScriptGlobal->GetCurrentInnerWindowInternal()->Freeze(false);
}
RefPtr<PresShell> presShell = GetPresShell();
if (presShell) {
// XXXBFcache Freeze doesn't deal with OOP iframes.
presShell->Freeze();
presShell->Freeze(false);
}
}
}