Bug 1574280 - Fix usage of nsIDocShellTreeItem in nsDocShell::SetCurrentURI. r=kmag

Differential Revision: https://phabricator.services.mozilla.com/D57608
This commit is contained in:
Tetsuharu OHZEKI
2019-12-19 20:01:14 +00:00
parent 8fdd007e40
commit fd7dc2a06a

View File

@@ -1207,16 +1207,9 @@ bool nsDocShell::SetCurrentURI(nsIURI* aURI, nsIRequest* aRequest,
mHasLoadedNonBlankURI = true;
}
bool isRoot = false; // Is this the root docshell
bool isRoot = !mBrowsingContext->GetParent();
bool isSubFrame = false; // Is this a subframe navigation?
nsCOMPtr<nsIDocShellTreeItem> root;
GetInProcessSameTypeRootTreeItem(getter_AddRefs(root));
if (root.get() == static_cast<nsIDocShellTreeItem*>(this)) {
// This is the root docshell
isRoot = true;
}
if (mLSHE) {
isSubFrame = mLSHE->GetIsSubFrame();
}