[orca] Don't advance caret position in blank cell during structural navigation



commit 19c8d7119d2a8194787fc6ea0b49cc421550dbbc
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Sat Sep 17 08:25:34 2016 -0400

    Don't advance caret position in blank cell during structural navigation

 src/orca/scripts/web/script_utilities.py |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index 329a5c2..92db475 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -1561,6 +1561,13 @@ class Utilities(script_utilities.Utilities):
         self._isTextBlockElement[hash(obj)] = rv
         return rv
 
+    def _advanceCaretInEmptyObject(self, obj):
+        role = obj.getRole()
+        if role == pyatspi.ROLE_TABLE_CELL and not self.queryNonEmptyText(obj):
+            return not self._script._lastCommandWasStructNav
+
+        return True
+
     def _treatAsLeafNode(self, obj):
         if super()._treatAsLeafNode(obj):
             return True
@@ -3025,7 +3032,8 @@ class Utilities(script_utilities.Utilities):
 
         text = self.queryNonEmptyText(obj)
         if not text:
-            if self.isTextBlockElement(obj) or self.isEmptyAnchor(obj):
+            if self._advanceCaretInEmptyObject(obj) \
+               and (self.isTextBlockElement(obj) or self.isEmptyAnchor(obj)):
                 nextObj, nextOffset = self.nextContext(obj, offset)
                 if nextObj:
                     msg = "WEB: First caret context for %s, %i is %s, %i" % (obj, offset, nextObj, 
nextOffset)


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