summaryrefslogtreecommitdiffstats
path: root/accessible/generic/Accessible.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'accessible/generic/Accessible.cpp')
-rw-r--r--accessible/generic/Accessible.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/accessible/generic/Accessible.cpp b/accessible/generic/Accessible.cpp
index 6d1cfc3..e96ceac 100644
--- a/accessible/generic/Accessible.cpp
+++ b/accessible/generic/Accessible.cpp
@@ -2308,6 +2308,12 @@ Accessible* Accessible::CurrentItem() {
nsIDocument* DOMDoc = mContent->OwnerDoc();
dom::Element* activeDescendantElm = DOMDoc->GetElementById(id);
if (activeDescendantElm) {
+ if (nsContentUtils::ContentIsDescendantOf(mContent,
+ activeDescendantElm)) {
+ // Don't want a cyclical descendant relationship. That would be bad.
+ return nullptr;
+ }
+
DocAccessible* document = Document();
if (document) return document->GetAccessible(activeDescendantElm);
}