[orca] Sanity check our attempt to hack around broken text from Gecko



commit 4c0c9559a163fea34c72d7442e2a6c3183d4f734
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Mon Mar 13 09:02:15 2017 -0400

    Sanity check our attempt to hack around broken text from Gecko

 src/orca/scripts/web/script_utilities.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index ef68b0e..68b502a 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -899,6 +899,9 @@ class Utilities(script_utilities.Utilities):
             rangeStart, rangeEnd = spans[0][0], spans[-1][1] + 1
             string = allText[rangeStart:rangeEnd]
 
+        if not (rangeStart <= offset <= rangeEnd):
+            return allText[start:end], start, end
+
         return string, rangeStart, rangeEnd
 
     def _attemptBrokenTextRecovery(self, obj, **args):


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