tor-browser

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

commit b7e0462f57d5f90d28295ac43278f6c021d3522c
parent 89828b8d4cab7863eaabe8b2cd24f3e6efd363e0
Author: Emilio Cobos Álvarez <emilio@crisal.io>
Date:   Fri, 17 Oct 2025 18:00:07 +0200

Bug 1994964 - Make accessible ignoring of hidden widgets work on not-yet-initialized pres shells.

Diffstat:
Maccessible/base/DocManager.cpp | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/accessible/base/DocManager.cpp b/accessible/base/DocManager.cpp @@ -443,11 +443,6 @@ DocAccessible* DocManager::CreateDocOrRootAccessible(Document* aDocument) { return nullptr; } - nsIWidget* widget = nsContentUtils::WidgetForDocument(aDocument); - if (!widget || widget->GetWindowType() == widget::WindowType::Invisible) { - return nullptr; - } - // Ignore documents without presshell. We must not ignore documents with no // root frame because DOM focus can hit such documents and ignoring them would // prevent a11y focus. @@ -456,6 +451,11 @@ DocAccessible* DocManager::CreateDocOrRootAccessible(Document* aDocument) { return nullptr; } + nsIWidget* widget = presShell->GetRootWidget(); + if (!widget || widget->GetWindowType() == widget::WindowType::Invisible) { + return nullptr; + } + bool isRootDoc = nsCoreUtils::IsRootDocument(aDocument); DocAccessible* parentDocAcc = nullptr;