diff --git a/dom/base/nsFrameLoader.cpp b/dom/base/nsFrameLoader.cpp index a89693be3aee..cdaddda77cbb 100644 --- a/dom/base/nsFrameLoader.cpp +++ b/dom/base/nsFrameLoader.cpp @@ -324,20 +324,16 @@ static already_AddRefed CreateBrowsingContext( nsAutoString frameName; GetFrameName(aOwner, frameName); - RefPtr browsingContext; if (IsTopContent(parentContext, aOwner)) { // Create toplevel content without a parent & as Type::Content. - browsingContext = BrowsingContext::Create(nullptr, aOpener, frameName, - BrowsingContext::Type::Content); - } else { - auto type = parentContext->IsContent() ? BrowsingContext::Type::Content - : BrowsingContext::Type::Chrome; - browsingContext = - BrowsingContext::Create(parentContext, aOpener, frameName, type); + return BrowsingContext::Create(nullptr, aOpener, frameName, + BrowsingContext::Type::Content); } - browsingContext->SetEmbedderElement(aOwner); - return browsingContext.forget(); + auto type = parentContext->IsContent() ? BrowsingContext::Type::Content + : BrowsingContext::Type::Chrome; + + return BrowsingContext::Create(parentContext, aOpener, frameName, type); } nsFrameLoader* nsFrameLoader::Create(Element* aOwner, BrowsingContext* aOpener, diff --git a/dom/ipc/WindowGlobalParent.cpp b/dom/ipc/WindowGlobalParent.cpp index ed2faa73b72e..6c9b2b20edf8 100644 --- a/dom/ipc/WindowGlobalParent.cpp +++ b/dom/ipc/WindowGlobalParent.cpp @@ -88,12 +88,6 @@ void WindowGlobalParent::Init(const WindowGlobalInit& aInit) { mBrowsingContext = CanonicalBrowsingContext::Cast(aInit.browsingContext()); MOZ_ASSERT(mBrowsingContext); - MOZ_DIAGNOSTIC_ASSERT( - !mBrowsingContext->GetParent() || - mBrowsingContext->GetEmbedderWindowGlobal(), - "When creating a non-root WindowGlobalParent, the WindowGlobalParent " - "for our embedder should've already been created."); - // Attach ourself to the browsing context. mBrowsingContext->RegisterWindowGlobal(this);