From c1853bc54ec11f261514a20a88f64190f7414b19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Wed, 10 Mar 2021 19:29:11 +0000 Subject: [PATCH] Bug 1697580 - Remove nsIDocShell.isOffScreenBrowser. r=smacleod It's unused. Differential Revision: https://phabricator.services.mozilla.com/D107888 --- docshell/base/nsDocShell.cpp | 18 +----------------- docshell/base/nsDocShell.h | 1 - docshell/base/nsIDocShell.idl | 7 ------- docshell/test/chrome/test_bug454235.xhtml | 18 ++---------------- 4 files changed, 3 insertions(+), 41 deletions(-) diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 560a77a8be08..b50682736509 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -398,7 +398,6 @@ nsDocShell::nsDocShell(BrowsingContext* aBrowsingContext, mCSSErrorReportingEnabled(false), mAllowAuth(mItemType == typeContent), mAllowKeywordFixup(false), - mIsOffScreenBrowser(false), mDisableMetaRefreshWhenInactive(false), mIsAppTab(false), mDeviceSizeIsPageSize(false), @@ -4929,12 +4928,9 @@ nsDocShell::GetVisibility(bool* aVisibility) { } nsIFrame* frame = view ? view->GetFrame() : nullptr; - bool isDocShellOffScreen = false; - docShell->GetIsOffScreenBrowser(&isDocShellOffScreen); if (frame && !frame->IsVisibleConsideringAncestors( - nsIFrame::VISIBILITY_CROSS_CHROME_CONTENT_BOUNDARY) && - !isDocShellOffScreen) { + nsIFrame::VISIBILITY_CROSS_CHROME_CONTENT_BOUNDARY)) { return NS_OK; } @@ -4953,18 +4949,6 @@ nsDocShell::GetVisibility(bool* aVisibility) { return treeOwnerAsWin->GetVisibility(aVisibility); } -NS_IMETHODIMP -nsDocShell::SetIsOffScreenBrowser(bool aIsOffScreen) { - mIsOffScreenBrowser = aIsOffScreen; - return NS_OK; -} - -NS_IMETHODIMP -nsDocShell::GetIsOffScreenBrowser(bool* aIsOffScreen) { - *aIsOffScreen = mIsOffScreenBrowser; - return NS_OK; -} - void nsDocShell::ActivenessMaybeChanged() { bool isActive = mBrowsingContext->IsActive(); if (RefPtr presShell = GetPresShell()) { diff --git a/docshell/base/nsDocShell.h b/docshell/base/nsDocShell.h index 3723e937f09e..63d828b38cdb 100644 --- a/docshell/base/nsDocShell.h +++ b/docshell/base/nsDocShell.h @@ -1229,7 +1229,6 @@ class nsDocShell final : public nsDocLoader, bool mCSSErrorReportingEnabled : 1; bool mAllowAuth : 1; bool mAllowKeywordFixup : 1; - bool mIsOffScreenBrowser : 1; bool mDisableMetaRefreshWhenInactive : 1; bool mIsAppTab : 1; bool mDeviceSizeIsPageSize : 1; diff --git a/docshell/base/nsIDocShell.idl b/docshell/base/nsIDocShell.idl index afa1eee3a610..aaee70b67a4d 100644 --- a/docshell/base/nsIDocShell.idl +++ b/docshell/base/nsIDocShell.idl @@ -469,13 +469,6 @@ interface nsIDocShell : nsIDocShellTreeItem */ [noscript, notxpcom] void DetachEditorFromWindow(); - /** - * If true, this browser is not visible in the traditional sense, but - * is actively being rendered to the screen (ex. painted on a canvas) - * and should be treated accordingly. - **/ - attribute boolean isOffScreenBrowser; - /** * Propagated to the print preview document viewer. Must only be called on * a document viewer that has been initialized for print preview. diff --git a/docshell/test/chrome/test_bug454235.xhtml b/docshell/test/chrome/test_bug454235.xhtml index b5f7aae62df0..ed6dc57c4100 100644 --- a/docshell/test/chrome/test_bug454235.xhtml +++ b/docshell/test/chrome/test_bug454235.xhtml @@ -24,22 +24,9 @@ SimpleTest.waitForFocus(doTest); function doTest() { var hiddenBrowser = document.getElementById("hiddenBrowser"); - var offScreenBrowser = document.getElementById("offScreenBrowser"); - var offScreenSubBrowser = offScreenBrowser.contentDocument.getElementById("topBrowser"); - var offScreenBurriedBrowser = offScreenBrowser.contentDocument.getElementById("burriedBrowser"); - + hiddenBrowser.contentWindow.focus(); - ok(!hiddenBrowser.contentDocument.hasFocus(),"hidden browser is visible"); - - offScreenBrowser.docShell.isOffScreenBrowser = true; - offScreenBrowser.contentWindow.focus(); - ok(offScreenBrowser.contentDocument.hasFocus(),"offscreen browser is not visible"); - - offScreenSubBrowser.contentWindow.focus(); - todo(offScreenSubBrowser.contentDocument.hasFocus(),"visible browser in offscreen browser is not visible"); - - offScreenBurriedBrowser.contentWindow.focus(); - ok(!offScreenBurriedBrowser.contentDocument.hasFocus(),"hidden browser in offscreen browser is visible"); + ok(!hiddenBrowser.contentDocument.hasFocus(), "hidden browser is unfocusable"); SimpleTest.finish(); } @@ -49,6 +36,5 @@ function doTest() { ]]> -