author | Ryan Hunt <rhunt@eqrion.net> |
Tue, 09 Apr 2019 11:22:20 -0500 | |
changeset 469603 | 34062ef2307ca687b8ae5077dd340ce34976c489 |
parent 469602 | a2a538f6c3c90d5241946d7ab071231fcc46fa86 |
child 469604 | afb20612c0e55ad60daeaaf7038e796334d285e0 |
push id | 35875 |
push user | ccoroiu@mozilla.com |
push date | Tue, 16 Apr 2019 04:06:16 +0000 |
treeherder | mozilla-central@a83cab75b00d [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | nika |
bugs | 1527380 |
milestone | 68.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/dom/base/Document.cpp +++ b/dom/base/Document.cpp @@ -4430,29 +4430,21 @@ void Document::SetContainer(nsDocShell* // IsTopLevelWindowInactive depends on the docshell, so // update the cached value now that it's available. UpdateDocumentStates(NS_DOCUMENT_STATE_WINDOW_INACTIVE); if (!aContainer) { return; } - // Get the Docshell - if (aContainer->ItemType() == nsIDocShellTreeItem::typeContent) { - // check if same type root - nsCOMPtr<nsIDocShellTreeItem> sameTypeRoot; - aContainer->GetSameTypeRootTreeItem(getter_AddRefs(sameTypeRoot)); - NS_ASSERTION( - sameTypeRoot, - "No document shell root tree item from document shell tree item!"); - - if (sameTypeRoot == aContainer) { + BrowsingContext* context = aContainer->GetBrowsingContext(); + if (context && context->IsContent()) { + if (!context->GetParent()) { SetIsTopLevelContentDocument(true); } - SetIsContentDocument(true); } mAncestorPrincipals = aContainer->AncestorPrincipals(); mAncestorOuterWindowIDs = aContainer->AncestorOuterWindowIDs(); } nsISupports* Document::GetContainer() const {