[orca] Web: Handle description lists with extra stuff in the accessibility tree



commit 434f43e8a557a86acd36cac5c6cf964f4f5f1e8c
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Wed Jun 22 16:59:08 2022 +0200

    Web: Handle description lists with extra stuff in the accessibility tree
    
    Description lists can have their term+value items inside divs, e.g.
    for styling. When that occurs, the browsers seem to be pruning the
    extra divs from the accessibility tree (i.e. making them just a simple
    description list from our perspective). However, if the author does
    something to force inclusion of those divs (e.g. making them focusable
    via the tabindex attribute), we'll no longer have the clean accessibility
    tree we had before.
    
    This commit handles description lists with expected stuff in their
    accessibility tree, and should also prevent us from accidentally
    including terms from a nested description list in the term count of
    its parent description list.
    
    See issue #248

 src/orca/script_utilities.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index bcbc7f19d..d75acffb3 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -1233,7 +1233,9 @@ class Utilities:
         if not self.isDescriptionList(obj):
             return []
 
-        return [x for x in obj if self.isDescriptionListTerm(x)]
+        _include = self.isDescriptionListTerm
+        _exclude = self.isDescriptionList
+        return self.findAllDescendants(obj, _include, _exclude)
 
     def isDocumentList(self, obj):
         if not (obj and obj.getRole() in [pyatspi.ROLE_LIST, pyatspi.ROLE_DESCRIPTION_LIST]):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]