Skip to content

Commit f83246f

Browse files
committed
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
1 parent 0ee516b commit f83246f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

accessible/basetypes/Accessible.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -705,11 +705,12 @@ class Accessible {
705705
}
706706

707707
/**
708-
* Returns the nearest ancestor which is not a generic element.
708+
* Returns the nearest ancestor in the document which is not a generic
709+
* element.
709710
*/
710711
Accessible* GetNonGenericParent() const {
711712
for (Accessible* parent = Parent(); parent; parent = parent->Parent()) {
712-
if (!parent->IsGeneric()) {
713+
if (parent->IsDoc() || !parent->IsGeneric()) {
713714
return parent;
714715
}
715716
}

0 commit comments

Comments
 (0)