Bug 1650257: Part 2 - Abort SetNewDocument() if ancestors are discarded/cached. r=nika,smaug,sg
Differential Revision: https://phabricator.services.mozilla.com/D87486
This commit is contained in:
@@ -6398,6 +6398,11 @@ nsresult nsDocShell::CreateAboutBlankContentViewer(
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
if (!mBrowsingContext->AncestorsAreCurrent()) {
|
||||
mBrowsingContext->RemoveRootFromBFCacheSync();
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
// mContentViewer->PermitUnload may release |this| docshell.
|
||||
nsCOMPtr<nsIDocShell> kungFuDeathGrip(this);
|
||||
|
||||
@@ -7518,6 +7523,11 @@ nsresult nsDocShell::CreateContentViewer(const nsACString& aContentType,
|
||||
return NS_ERROR_DOCSHELL_DYING;
|
||||
}
|
||||
|
||||
if (!mBrowsingContext->AncestorsAreCurrent()) {
|
||||
mBrowsingContext->RemoveRootFromBFCacheSync();
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
// Can we check the content type of the current content viewer
|
||||
// and reuse it without destroying it and re-creating it?
|
||||
|
||||
|
||||
Reference in New Issue
Block a user