tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 01e70a78b088f96255332c79b8f47ee17d289a5a
parent 145105b746db2878851bacbfc232b041243f89b3
Author: Emilio Cobos Álvarez <emilio@crisal.io>
Date:   Tue,  4 Nov 2025 17:40:27 +0000

Bug 1998202 - Simplify PresShell::IsVisible(). r=jwatt

We have a "hidden-under-embedder-element" bit already, use it.

Differential Revision: https://phabricator.services.mozilla.com/D271243

Diffstat:
Mlayout/base/PresShell.cpp | 29+----------------------------
1 file changed, 1 insertion(+), 28 deletions(-)

diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp @@ -10356,34 +10356,7 @@ void PresShell::DidPaintWindow() { } bool PresShell::IsVisible() const { - if (!mIsActive || !mViewManager) { - return false; - } - - nsView* view = mViewManager->GetRootView(); - if (!view) { - return true; - } - - // inner view of subdoc frame - view = view->GetParent(); - if (!view) { - return true; - } - - // subdoc view - view = view->GetParent(); - if (!view) { - return true; - } - - nsIFrame* frame = view->GetFrame(); - if (!frame) { - return true; - } - - return frame->IsVisibleConsideringAncestors( - nsIFrame::VISIBILITY_CROSS_CHROME_CONTENT_BOUNDARY); + return mIsActive && !IsUnderHiddenEmbedderElement(); } void PresShell::SuppressDisplayport(bool aEnabled) {