[orca] Chromium: Ensure we don't ignore presentable static text leaf nodes



commit 761ce3e77be09f9c4ad686bf6b59e52ff2827176
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Thu May 16 17:34:36 2019 +0200

    Chromium: Ensure we don't ignore presentable static text leaf nodes

 .../scripts/toolkits/Chromium/script_utilities.py     | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/src/orca/scripts/toolkits/Chromium/script_utilities.py 
b/src/orca/scripts/toolkits/Chromium/script_utilities.py
index 2c55b3ba9..05cc0bff2 100644
--- a/src/orca/scripts/toolkits/Chromium/script_utilities.py
+++ b/src/orca/scripts/toolkits/Chromium/script_utilities.py
@@ -65,10 +65,21 @@ class Utilities(web.Utilities):
             msg = "CHROMIUM: %s believed to be static text leaf" % obj
             debug.println(debug.LEVEL_INFO, msg, True)
 
-        if self.isDocument(obj.parent):
-            msg = "CHROMIUM: %s is direct child of document so ignore leaf finding" % obj
-            debug.println(debug.LEVEL_INFO, msg, True)
-            rv = False
+        if rv and obj.parent:
+            if self.isDocument(obj.parent):
+                msg = "CHROMIUM: %s is direct child of document so ignore leaf finding" % obj
+                debug.println(debug.LEVEL_INFO, msg, True)
+                rv = False
+            else:
+                i = obj.getIndexInParent()
+                if i > 0 and not self.isStaticTextLeaf(obj.parent[i - 1]):
+                    msg = "CHROMIUM: previous sibling of %s is not leaf so ignore leaf finding" % obj
+                    debug.println(debug.LEVEL_INFO, msg, True)
+                    rv = False
+                elif i + 1 < obj.parent.childCount and not self.isStaticTextLeaf(obj.parent[i + 1]):
+                    msg = "CHROMIUM: next sibling of %s is not leaf so ignore leaf finding" % obj
+                    debug.println(debug.LEVEL_INFO, msg, True)
+                    rv = False
 
         self._isStaticTextLeaf[hash(obj)] = rv
         return rv


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