[orca] Give findObjectInContents() smarts for embeddeded children



commit 3f582dc17b8e0712c8b7051c78a253c09b8babb3
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Wed May 4 16:29:03 2016 -0400

    Give findObjectInContents() smarts for embeddeded children

 src/orca/scripts/web/script_utilities.py |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index faa167a..7641656 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -697,6 +697,15 @@ class Utilities(script_utilities.Utilities):
         if match and match[0] and match[0] in contents:
             return contents.index(match[0])
 
+        if not self.isTextBlockElement(obj):
+            return -1
+
+        child = self.getChildAtOffset(obj, offset)
+        if child and not self.isTextBlockElement(child):
+            matches = [x for x in contents if x[0] == child]
+            if len(matches) == 1:
+                return contents.index(matches[0])
+
         return -1
 
     def isNonEntryTextWidget(self, obj):


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