commit f83246f0cc1e115c1091088df492cd29bddd4c32
parent 0ee516bbba6d6c3b1b9e22bcfd68f142f3fcc111
Author: Eitan Isaacson <eitan@monotonous.org>
Date: Thu, 20 Nov 2025 18:49:15 +0000
Bug 1996506 - Don't climb above document in GetNonGenericParent. r=Jamie
Also don't allow climbing into local accessibles off main thread, and
assert if we do.
Differential Revision: https://phabricator.services.mozilla.com/D272729
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/accessible/basetypes/Accessible.h b/accessible/basetypes/Accessible.h
@@ -705,11 +705,12 @@ class Accessible {
}
/**
- * Returns the nearest ancestor which is not a generic element.
+ * Returns the nearest ancestor in the document which is not a generic
+ * element.
*/
Accessible* GetNonGenericParent() const {
for (Accessible* parent = Parent(); parent; parent = parent->Parent()) {
- if (!parent->IsGeneric()) {
+ if (parent->IsDoc() || !parent->IsGeneric()) {
return parent;
}
}