diff --git a/browser/base/content/test/chrome/test_aboutCrashed.xhtml b/browser/base/content/test/chrome/test_aboutCrashed.xhtml index 8bad1ac80d91..df48694e38aa 100644 --- a/browser/base/content/test/chrome/test_aboutCrashed.xhtml +++ b/browser/base/content/test/chrome/test_aboutCrashed.xhtml @@ -57,7 +57,7 @@ frame1.docShell.chromeEventHandler.removeAttribute("crashedPageTitle"); SimpleTest.is(frame1.contentDocument.documentURI, - "about:tabcrashed?e=tabcrashed&u=http%3A//www.example.com/1&c=UTF-8&f=regular&d=pageTitle", + "about:tabcrashed?e=tabcrashed&u=http%3A//www.example.com/1&c=UTF-8&d=pageTitle", "Correct about:tabcrashed displayed for page with title."); errorPageReady = waitForErrorPage(frame2); @@ -66,7 +66,7 @@ await errorPageReady; SimpleTest.is(frame2.contentDocument.documentURI, - "about:tabcrashed?e=tabcrashed&u=http%3A//www.example.com/2&c=UTF-8&f=regular&d=%20", + "about:tabcrashed?e=tabcrashed&u=http%3A//www.example.com/2&c=UTF-8&d=%20", "Correct about:tabcrashed displayed for page with no title."); SimpleTest.finish(); diff --git a/browser/base/content/test/chrome/test_aboutRestartRequired.xhtml b/browser/base/content/test/chrome/test_aboutRestartRequired.xhtml index 17cd84bd73ac..4b8293e45001 100644 --- a/browser/base/content/test/chrome/test_aboutRestartRequired.xhtml +++ b/browser/base/content/test/chrome/test_aboutRestartRequired.xhtml @@ -55,7 +55,7 @@ frame1.docShell.chromeEventHandler.removeAttribute("crashedPageTitle"); SimpleTest.is(frame1.contentDocument.documentURI, - "about:restartrequired?e=restartrequired&u=http%3A//www.example.com/1&c=UTF-8&f=regular&d=%20", + "about:restartrequired?e=restartrequired&u=http%3A//www.example.com/1&c=UTF-8&d=%20", "Correct about:restartrequired displayed for page with title."); errorPageReady = waitForErrorPage(frame2); @@ -64,7 +64,7 @@ await errorPageReady; SimpleTest.is(frame2.contentDocument.documentURI, - "about:restartrequired?e=restartrequired&u=http%3A//www.example.com/2&c=UTF-8&f=regular&d=%20", + "about:restartrequired?e=restartrequired&u=http%3A//www.example.com/2&c=UTF-8&d=%20", "Correct about:restartrequired displayed for page with no title."); SimpleTest.finish(); diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index fda296234dc0..ebd58b60a126 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -354,7 +354,6 @@ nsDocShell::nsDocShell(BrowsingContext* aBrowsingContext, mLoadType(0), mDefaultLoadFlags(nsIRequest::LOAD_NORMAL), mFailedLoadType(0), - mFrameType(FRAME_TYPE_REGULAR), mDisplayMode(nsIDocShell::DISPLAY_MODE_BROWSER), mJSRunToCompletionDepth(0), mTouchEventsOverride(nsIDocShell::TOUCHEVENTS_OVERRIDE_NONE), @@ -1847,21 +1846,6 @@ nsDocShell::GetFullscreenAllowed(bool* aFullscreenAllowed) { return parent->GetFullscreenAllowed(aFullscreenAllowed); } -NS_IMETHODIMP -nsDocShell::SetFullscreenAllowed(bool aFullscreenAllowed) { - if (!nsIDocShell::GetIsMozBrowser()) { - // Only allow setting of fullscreenAllowed on content/process boundaries. - // At non-boundaries the fullscreenAllowed attribute is calculated based on - // whether all enclosing frames have the "mozFullscreenAllowed" attribute - // set to "true". fullscreenAllowed is set at the process boundaries to - // propagate the value of the parent's "mozFullscreenAllowed" attribute - // across process boundaries. - return NS_ERROR_UNEXPECTED; - } - mFullscreenAllowed = (aFullscreenAllowed ? PARENT_ALLOWS : PARENT_PROHIBITS); - return NS_OK; -} - hal::ScreenOrientation nsDocShell::OrientationLock() { return mOrientationLock; } @@ -2638,21 +2622,8 @@ void nsDocShell::MaybeClearStorageAccessFlag() { NS_IMETHODIMP nsDocShell::GetInProcessSameTypeParent(nsIDocShellTreeItem** aParent) { - NS_ENSURE_ARG_POINTER(aParent); - *aParent = nullptr; - - if (nsIDocShell::GetIsMozBrowser()) { - return NS_OK; - } - - nsCOMPtr parent = - do_QueryInterface(GetAsSupports(mParent)); - if (!parent) { - return NS_OK; - } - - if (parent->ItemType() == mItemType) { - parent.swap(*aParent); + if (BrowsingContext* parentBC = mBrowsingContext->GetParent()) { + *aParent = do_AddRef(parentBC->GetDocShell()).take(); } return NS_OK; } @@ -3896,10 +3867,6 @@ nsresult nsDocShell::LoadErrorPage(nsIURI* aURI, const char16_t* aURL, } errorPageUrl.AppendLiteral("&c=UTF-8"); - nsAutoCString frameType(FrameTypeToString(mFrameType)); - errorPageUrl.AppendLiteral("&f="); - errorPageUrl.AppendASCII(frameType.get()); - nsCOMPtr cps = do_GetService(NS_CAPTIVEPORTAL_CID); int32_t cpsState; if (cps && NS_SUCCEEDED(cps->GetState(&cpsState)) && @@ -4723,9 +4690,7 @@ nsDocShell::SetIsActive(bool aIsActive) { continue; } - if (!docshell->GetIsMozBrowser()) { - docshell->SetIsActive(aIsActive); - } + docshell->SetIsActive(aIsActive); } // Restart or stop meta refresh timers if necessary @@ -9014,8 +8979,7 @@ nsresult nsDocShell::InternalLoad(nsDocShellLoadState* aLoadState, } } - bool isTopLevelDoc = - mItemType == typeContent && (!IsFrame() || GetIsMozBrowser()); + bool isTopLevelDoc = mBrowsingContext->IsTopContent(); OriginAttributes attrs = GetOriginAttributes(); attrs.SetFirstPartyDomain(isTopLevelDoc, aLoadState->URI()); @@ -12395,46 +12359,6 @@ nsDocShell::GetCanExecuteScripts(bool* aResult) { return NS_OK; } -/* [infallible] */ -NS_IMETHODIMP nsDocShell::SetFrameType(FrameType aFrameType) { - mFrameType = aFrameType; - return NS_OK; -} - -/* [infallible] */ -NS_IMETHODIMP nsDocShell::GetFrameType(FrameType* aFrameType) { - *aFrameType = mFrameType; - return NS_OK; -} - -/* [infallible] */ -NS_IMETHODIMP nsDocShell::GetIsMozBrowser(bool* aIsMozBrowser) { - *aIsMozBrowser = (mFrameType == FRAME_TYPE_BROWSER); - return NS_OK; -} - -uint32_t nsDocShell::GetInheritedFrameType() { - if (mFrameType != FRAME_TYPE_REGULAR) { - return mFrameType; - } - - nsCOMPtr parentAsItem; - GetInProcessSameTypeParent(getter_AddRefs(parentAsItem)); - - nsCOMPtr parent = do_QueryInterface(parentAsItem); - if (!parent) { - return FRAME_TYPE_REGULAR; - } - - return static_cast(parent.get())->GetInheritedFrameType(); -} - -/* [infallible] */ -NS_IMETHODIMP nsDocShell::GetIsInMozBrowser(bool* aIsInMozBrowser) { - *aIsInMozBrowser = (GetInheritedFrameType() == FRAME_TYPE_BROWSER); - return NS_OK; -} - /* [infallible] */ NS_IMETHODIMP nsDocShell::GetIsTopLevelContentDocShell( bool* aIsTopLevelContentDocShell) { diff --git a/docshell/base/nsDocShell.h b/docshell/base/nsDocShell.h index c07b8e6fd151..f7f8916af6b1 100644 --- a/docshell/base/nsDocShell.h +++ b/docshell/base/nsDocShell.h @@ -569,18 +569,6 @@ class nsDocShell final : public nsDocLoader, return uint32_t(aTimeUsec / PR_USEC_PER_SEC); } - static const nsCString FrameTypeToString(uint32_t aFrameType) { - switch (aFrameType) { - case FRAME_TYPE_BROWSER: - return NS_LITERAL_CSTRING("browser"); - case FRAME_TYPE_REGULAR: - return NS_LITERAL_CSTRING("regular"); - default: - NS_ERROR("Unknown frame type"); - return EmptyCString(); - } - } - virtual ~nsDocShell(); // @@ -1009,7 +997,6 @@ class nsDocShell final : public nsDocLoader, bool IsPrintingOrPP(bool aDisplayErrorDialog = true); bool IsNavigationAllowed(bool aDisplayPrintErrorDialog = true, bool aCheckIfUnloadFired = true); - uint32_t GetInheritedFrameType(); nsIScrollableFrame* GetRootScrollFrame(); nsIChannel* GetCurrentDocChannel(); nsresult EnsureScriptEnvironment(); @@ -1223,9 +1210,6 @@ class nsDocShell final : public nsDocLoader, uint32_t mDefaultLoadFlags; uint32_t mFailedLoadType; - // Are we a regular frame, a browser frame, or an app frame? - FrameType mFrameType; - // This represents the CSS display-mode we are currently using. This is mostly // used for media queries. DisplayMode mDisplayMode; diff --git a/docshell/base/nsIDocShell.idl b/docshell/base/nsIDocShell.idl index f730653b9614..700845dbd143 100644 --- a/docshell/base/nsIDocShell.idl +++ b/docshell/base/nsIDocShell.idl @@ -684,32 +684,6 @@ interface nsIDocShell : nsIDocShellTreeItem */ [noscript] void notifyScrollObservers(); - /** - * The type of iframe that this docshell lives. - */ - cenum FrameType : 8 { - FRAME_TYPE_REGULAR = 0, - FRAME_TYPE_BROWSER = 1, - }; - [infallible] attribute nsIDocShell_FrameType frameType; - - /** - * Returns true if this docshell corresponds to an