[orca] Treat editable elements as entries for the purpose of structural navigation



commit c6636313e41b159b4c5834198398bd57c1b7fb51
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Wed Feb 7 11:36:33 2018 -0500

    Treat editable elements as entries for the purpose of structural navigation

 src/orca/structural_navigation.py |   22 +++-------------------
 1 files changed, 3 insertions(+), 19 deletions(-)
---
diff --git a/src/orca/structural_navigation.py b/src/orca/structural_navigation.py
index 3599616..53b6f5c 100644
--- a/src/orca/structural_navigation.py
+++ b/src/orca/structural_navigation.py
@@ -1829,12 +1829,6 @@ class StructuralNavigation:
           the criteria (e.g. the level of a heading).
         """
 
-        role = [pyatspi.ROLE_DOCUMENT_FRAME,
-                pyatspi.ROLE_COMBO_BOX,
-                pyatspi.ROLE_ENTRY,
-                pyatspi.ROLE_PASSWORD_TEXT,
-                pyatspi.ROLE_TEXT]
-        roleMatch = collection.MATCH_ANY
         state = [pyatspi.STATE_FOCUSABLE,
                  pyatspi.STATE_SENSITIVE,
                  pyatspi.STATE_EDITABLE]
@@ -1842,8 +1836,6 @@ class StructuralNavigation:
         return MatchCriteria(collection,
                              states=state,
                              matchStates=stateMatch,
-                             roles=role,
-                             matchRoles=roleMatch,
                              applyPredicate=True)
 
     def _entryPredicate(self, obj, arg=None):
@@ -1856,18 +1848,10 @@ class StructuralNavigation:
           the criteria (e.g. the level of a heading).
         """
 
-        isMatch = False
-        if obj and obj.getRole() in [pyatspi.ROLE_DOCUMENT_FRAME,
-                                     pyatspi.ROLE_COMBO_BOX,
-                                     pyatspi.ROLE_ENTRY,
-                                     pyatspi.ROLE_PASSWORD_TEXT,
-                                     pyatspi.ROLE_TEXT]:
-            state = obj.getState()
-            isMatch = state.contains(pyatspi.STATE_FOCUSABLE) \
-                  and state.contains(pyatspi.STATE_SENSITIVE) \
-                  and state.contains(pyatspi.STATE_EDITABLE)
+        if not obj and obj.parent:
+            return False
 
-        return isMatch
+        return not obj.parent.getState().contains(pyatspi.STATE_EDITABLE)
 
     def _entryPresentation(self, obj, arg=None):
         """Presents the entry or indicates that one was not found.


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