Bug 1717765, tweak the check when creating a new content viewer shouldn't succeed, r=peterv

The patch is based on the assumption that the assertion fails because of
https://searchfox.org/mozilla-central/rev/1c5c3f4ec274462b92cf5bd82235ae3a56c508e9/dom/base/nsGlobalWindowInner.cpp#2775

Differential Revision: https://phabricator.services.mozilla.com/D119233
This commit is contained in:
Olli Pettay
2021-07-07 16:55:23 +00:00
parent 6f587d2e51
commit 0e7ac4fc69

View File

@@ -6474,7 +6474,8 @@ nsresult nsDocShell::CreateAboutBlankContentViewer(
return NS_ERROR_FAILURE;
}
if (!mBrowsingContext->AncestorsAreCurrent()) {
if (!mBrowsingContext->AncestorsAreCurrent() ||
mBrowsingContext->IsInBFCache()) {
mBrowsingContext->RemoveRootFromBFCacheSync();
return NS_ERROR_NOT_AVAILABLE;
}
@@ -7628,7 +7629,8 @@ nsresult nsDocShell::CreateContentViewer(const nsACString& aContentType,
return NS_ERROR_DOCSHELL_DYING;
}
if (!mBrowsingContext->AncestorsAreCurrent()) {
if (!mBrowsingContext->AncestorsAreCurrent() ||
mBrowsingContext->IsInBFCache()) {
mBrowsingContext->RemoveRootFromBFCacheSync();
return NS_ERROR_NOT_AVAILABLE;
}