[orca] Revert "Make other non-focusable form fields navigable via structural navigation"



commit ebae90d7d92339d7267a1bdf2494ea8550e3c1f1
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Tue Dec 11 10:01:50 2018 +0100

    Revert "Make other non-focusable form fields navigable via structural navigation"
    
    This reverts commit bc313b701f1e3221216d92b8b43304e83c7835eb.

 src/orca/structural_navigation.py | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)
---
diff --git a/src/orca/structural_navigation.py b/src/orca/structural_navigation.py
index 117e9f29a..c36e35392 100644
--- a/src/orca/structural_navigation.py
+++ b/src/orca/structural_navigation.py
@@ -585,6 +585,7 @@ class StructuralNavigation:
                   pyatspi.ROLE_RADIO_BUTTON,
                   pyatspi.ROLE_COMBO_BOX,
                   pyatspi.ROLE_DOCUMENT_FRAME, # rich text editing
+                  pyatspi.ROLE_LIST,
                   pyatspi.ROLE_LIST_BOX,
                   pyatspi.ROLE_ENTRY,
                   pyatspi.ROLE_PASSWORD_TEXT,
@@ -1561,7 +1562,7 @@ class StructuralNavigation:
         """
 
         role = [pyatspi.ROLE_CHECK_BOX]
-        state = [pyatspi.STATE_SENSITIVE]
+        state = [pyatspi.STATE_FOCUSABLE, pyatspi.STATE_SENSITIVE]
         stateMatch = collection.MATCH_ALL
         return MatchCriteria(collection,
                              states=state,
@@ -1581,7 +1582,8 @@ class StructuralNavigation:
         isMatch = False
         if obj and obj.getRole() == pyatspi.ROLE_CHECK_BOX:
             state = obj.getState()
-            isMatch = state.contains(pyatspi.STATE_SENSITIVE)
+            isMatch = state.contains(pyatspi.STATE_FOCUSABLE) \
+                  and state.contains(pyatspi.STATE_SENSITIVE)
 
         return isMatch
 
@@ -1742,7 +1744,7 @@ class StructuralNavigation:
         """
 
         role = [pyatspi.ROLE_COMBO_BOX]
-        state = [pyatspi.STATE_SENSITIVE]
+        state = [pyatspi.STATE_FOCUSABLE, pyatspi.STATE_SENSITIVE]
         stateMatch = collection.MATCH_ALL
         return MatchCriteria(collection,
                              states=state,
@@ -1762,7 +1764,8 @@ class StructuralNavigation:
         isMatch = False
         if obj and obj.getRole() == pyatspi.ROLE_COMBO_BOX:
             state = obj.getState()
-            isMatch = state.contains(pyatspi.STATE_SENSITIVE)
+            isMatch = state.contains(pyatspi.STATE_FOCUSABLE) \
+                  and state.contains(pyatspi.STATE_SENSITIVE)
 
         return isMatch
 
@@ -1825,7 +1828,9 @@ class StructuralNavigation:
           the criteria (e.g. the level of a heading).
         """
 
-        state = [pyatspi.STATE_SENSITIVE]
+        state = [pyatspi.STATE_FOCUSABLE,
+                 pyatspi.STATE_SENSITIVE,
+                 pyatspi.STATE_EDITABLE]
         stateMatch = collection.MATCH_ALL
         return MatchCriteria(collection,
                              states=state,
@@ -1845,7 +1850,7 @@ class StructuralNavigation:
         if not obj and obj.parent:
             return False
 
-        return state.contains(pyatspi.STATE_SENSITIVE)
+        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.
@@ -1910,7 +1915,7 @@ class StructuralNavigation:
 
         role = self.FORM_ROLES
         roleMatch = collection.MATCH_ANY
-        state = [pyatspi.STATE_SENSITIVE]
+        state = [pyatspi.STATE_FOCUSABLE, pyatspi.STATE_SENSITIVE]
         stateMatch = collection.MATCH_ALL
         return MatchCriteria(collection,
                              states=state,
@@ -1937,7 +1942,8 @@ class StructuralNavigation:
             return False
 
         state = obj.getState()
-        isMatch = state.contains(pyatspi.STATE_SENSITIVE)
+        isMatch = state.contains(pyatspi.STATE_FOCUSABLE) \
+                  and state.contains(pyatspi.STATE_SENSITIVE)
 
         if role == pyatspi.ROLE_DOCUMENT_FRAME:
             isMatch = isMatch and state.contains(pyatspi.STATE_EDITABLE)
@@ -2632,7 +2638,7 @@ class StructuralNavigation:
         """
 
         role = [pyatspi.ROLE_RADIO_BUTTON]
-        state = [pyatspi.STATE_SENSITIVE]
+        state = [pyatspi.STATE_FOCUSABLE, pyatspi.STATE_SENSITIVE]
         stateMatch = collection.MATCH_ALL
         return MatchCriteria(collection,
                              states=state,
@@ -2652,7 +2658,8 @@ class StructuralNavigation:
         isMatch = False
         if obj and obj.getRole() == pyatspi.ROLE_RADIO_BUTTON:
             state = obj.getState()
-            isMatch = state.contains(pyatspi.STATE_SENSITIVE)
+            isMatch = state.contains(pyatspi.STATE_FOCUSABLE) \
+                  and state.contains(pyatspi.STATE_SENSITIVE)
 
         return isMatch
 


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