[orca] Add debugging details



commit d77366b354cc57d3fbc86e5005349b934edbe5c6
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Thu Aug 29 12:43:45 2019 -0400

    Add debugging details

 src/orca/scripts/web/script_utilities.py | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index d1705ab96..fbde49a58 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -4203,11 +4203,12 @@ class Utilities(script_utilities.Utilities):
                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)
+                    msg = "WEB: First caret context for non-text context %s, %i is next context %s, %i" % \
+                        (obj, offset, nextObj, nextOffset)
                     debug.println(debug.LEVEL_INFO, msg, True)
                     return nextObj, nextOffset
 
-            msg = "WEB: First caret context for %s, %i is %s, %i" % (obj, offset, obj, 0)
+            msg = "WEB: First caret context for non-text context %s, %i is %s, %i" % (obj, offset, obj, 0)
             debug.println(debug.LEVEL_INFO, msg, True)
             return obj, 0
 
@@ -4215,32 +4216,36 @@ class Utilities(script_utilities.Utilities):
             if self.isLink(obj) and self.isContentEditableWithEmbeddedObjects(obj):
                 nextObj, nextOffset = self.nextContext(obj, text.characterCount)
                 if nextObj:
-                    msg = "WEB: First caret context for %s, %i is %s, %i" % (obj, offset, nextObj, 
nextOffset)
+                    msg = "WEB: First caret context at end of %s, %i is next context %s, %i" % \
+                        (obj, offset, nextObj, nextOffset)
                     debug.println(debug.LEVEL_INFO, msg, True)
                     return nextObj, nextOffset
 
-            msg = "WEB: First caret context for %s, %i is %s, %i" % (obj, offset, obj, text.characterCount)
+            msg = "WEB: First caret context at end of %s, %i is %s, %i" % (obj, offset, obj, 
text.characterCount)
             debug.println(debug.LEVEL_INFO, msg, True)
             return obj, text.characterCount
 
         allText = text.getText(0, -1)
         offset = max (0, offset)
         if allText[offset] != self.EMBEDDED_OBJECT_CHARACTER or role == pyatspi.ROLE_ENTRY:
-            msg = "WEB: First caret context for %s, %i is %s, %i" % (obj, offset, obj, offset)
+            msg = "WEB: First caret context for %s, %i is unchanged" % (obj, offset)
             debug.println(debug.LEVEL_INFO, msg, True)
             return obj, offset
 
         child = self.getChildAtOffset(obj, offset)
         if not child:
-            msg = "WEB: First caret context for %s, %i is %s, %i" % (obj, offset, None, -1)
+            msg = "WEB: First caret context for %s, %i is null child" % (obj, offset)
             debug.println(debug.LEVEL_INFO, msg, True)
             return None, -1
 
         if self.isListItemMarker(child):
-            msg = "WEB: First caret context for %s, %i is %s, %i" % (obj, offset, obj, offset + 1)
+            msg = "WEB: First caret context for %s, %i is %s, %i (skip list item marker child)" % \
+                (obj, offset, obj, offset + 1)
             debug.println(debug.LEVEL_INFO, msg, True)
             return obj, offset + 1
 
+        msg = "WEB: Looking in child %s for first caret context for %s, %i" % (child, obj, offset)
+        debug.println(debug.LEVEL_INFO, msg, True)
         return self.findFirstCaretContext(child, 0)
 
     def findNextCaretInOrder(self, obj=None, offset=-1):


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