[orca] Be more flexible with the accessibility tree in _generateUnselectedCell



commit ac4d88dba5c0052d81df490d5d8ef54180c9b1b6
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Fri May 21 13:42:36 2021 +0200

    Be more flexible with the accessibility tree in _generateUnselectedCell
    
    Assuming that the parent of a cell is a table is a holdover from the
    pre-ARIA days. Rows may or may not be present in the accessibility
    tree and there may also be other containers, such as a row group.
    Therefore, ascend the accessibility tree looking for a table ancestor.

 src/orca/speech_generator.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/orca/speech_generator.py b/src/orca/speech_generator.py
index 8ae3658a2..fe726cb93 100644
--- a/src/orca/speech_generator.py
+++ b/src/orca/speech_generator.py
@@ -1138,14 +1138,14 @@ class SpeechGenerator(generator.Generator):
         if obj.getRole() == pyatspi.ROLE_TEXT:
             return []
 
-        parentRole = obj.parent.getRole()
-        if parentRole in [pyatspi.ROLE_TREE_TABLE, pyatspi.ROLE_TABLE]:
+        table = self._script.utilities.getTable(obj)
+        if table:
             lastKey, mods = self._script.utilities.lastKeyAndModifiers()
             if lastKey in ["Left", "Right"]:
                 return []
-            if self._script.utilities.isLayoutOnly(obj.parent):
+            if self._script.utilities.isLayoutOnly(table):
                 return []
-        elif parentRole == pyatspi.ROLE_LAYERED_PANE:
+        elif obj.parent.getRole() == pyatspi.ROLE_LAYERED_PANE:
             if obj in self._script.utilities.selectedChildren(obj.parent):
                 return []
         else:


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