[orca/gnome-3-38] Web: Return next caret context as first caret context for empty anchor



commit fde24005ee3bb6f10850f7441eb034391a0fe8e4
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Wed Jan 6 11:16:37 2021 +0100

    Web: Return next caret context as first caret context for empty anchor
    
    Unfortunately, empty anchors can appear in the accessibility tree.
    If caret navigation causes us to land on one, there's nothing to
    present. Therefore look for and move to the first presentable thing
    after the empty anchor.

 src/orca/scripts/web/script_utilities.py | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index 4de05f992..df5c757d2 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -4800,6 +4800,14 @@ class Utilities(script_utilities.Utilities):
             debug.println(debug.LEVEL_INFO, msg, True)
             return obj, offset + 1
 
+        if self.isEmptyAnchor(child):
+            nextObj, nextOffset = self.nextContext(obj, offset)
+            if nextObj:
+                msg = "WEB: First caret context at end of empty anchor %s is next context %s, %i" % \
+                    (obj, nextObj, nextOffset)
+                debug.println(debug.LEVEL_INFO, msg, True)
+                return nextObj, nextOffset
+
         if not self._canHaveCaretContext(child):
             msg = "WEB: Child cannot be context. Returning %s, %i unchanged." % (obj, offset)
             debug.println(debug.LEVEL_INFO, msg, True)


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