[orca] Only return range extents for text objects with a character count



commit f1f76f163abb70011127246169a988adb7652dc5
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Mon Apr 13 17:40:04 2020 -0400

    Only return range extents for text objects with a character count
    
    Empty elements should have a non-zero-sized bounding box. Therefore
    fall back on the component interface to obtain it.

 src/orca/scripts/web/script_utilities.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index c6d8f6e7e..059b5c75d 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -784,7 +784,7 @@ class Utilities(script_utilities.Utilities):
                 msg = "WEB: Suspected bogus range extents for %s (chars: %i, %i): %s" % \
                     (obj, startOffset, endOffset, result)
                 debug.println(debug.LEVEL_INFO, msg, True)
-            else:
+            elif text.characterCount:
                 return result
 
         role = obj.getRole()


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