diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
commit | d8bbc7858622b6d9c278469aab701ca0b609cddf (patch) | |
tree | eff41dc61d9f714852212739e6b3738b82a2af87 /accessible/base/DocManager.cpp | |
parent | Releasing progress-linux version 125.0.3-1~progress7.99u1. (diff) | |
download | firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'accessible/base/DocManager.cpp')
-rw-r--r-- | accessible/base/DocManager.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/accessible/base/DocManager.cpp b/accessible/base/DocManager.cpp index b7a5203e40..18bf9c0433 100644 --- a/accessible/base/DocManager.cpp +++ b/accessible/base/DocManager.cpp @@ -17,6 +17,7 @@ # include "Logging.h" #endif +#include "mozilla/BasePrincipal.h" #include "mozilla/Components.h" #include "mozilla/EventListenerManager.h" #include "mozilla/PresShell.h" @@ -464,7 +465,18 @@ DocAccessible* DocManager::CreateDocOrRootAccessible(Document* aDocument) { // XXXaaronl: ideally we would traverse the presshell chain. Since there's // no easy way to do that, we cheat and use the document hierarchy. parentDocAcc = GetDocAccessible(aDocument->GetInProcessParentDocument()); - NS_ASSERTION(parentDocAcc, "Can't create an accessible for the document!"); + // We should always get parentDocAcc except sometimes for background + // extension pages, where the parent has an invisible DocShell but the child + // does not. See bug 1888649. + NS_ASSERTION( + parentDocAcc || + (BasePrincipal::Cast(aDocument->GetPrincipal())->AddonPolicy() && + aDocument->GetInProcessParentDocument() && + aDocument->GetInProcessParentDocument()->GetDocShell() && + aDocument->GetInProcessParentDocument() + ->GetDocShell() + ->IsInvisible()), + "Can't create an accessible for the document!"); if (!parentDocAcc) return nullptr; } |