[orca] Chromium: Fix issue causing us to present the previous line in contenteditable



commit b70bc940d0a86db6a0a6c60851876365b91f1a14
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Wed Apr 22 16:08:56 2020 -0400

    Chromium: Fix issue causing us to present the previous line in contenteditable
    
    We don't want to adjust the offset for literal newline characters in
    contenteditable content. Chromium gives us the right information, so
    we should trust it. In the case of Gecko, we already sanity check
    everything it gives us for text at offset because its text implementation
    is broken. Any adjustments which are not already being made for it should
    be made in _getTextAtOffset().

 src/orca/scripts/web/script_utilities.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index 6999bc4e5..8392e7457 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -1559,12 +1559,13 @@ class Utilities(script_utilities.Utilities):
             debug.println(debug.LEVEL_INFO, msg, True)
             return True
 
-        char = text.getText(offset, offset + 1)
-        if char == "\n":
-            msg = "WEB: %s offset %i is end of line: char at offset is newline" % (obj, offset)
-            debug.println(debug.LEVEL_INFO, msg, True)
-            return True
+        # Do not treat a literal newline char as the end of line. When there is an
+        # actual newline character present, user agents should give us the right value
+        # for the line at that offset. Here we are trying to figure out where asking
+        # for the line at offset will give us the next line rather than the line where
+        # the cursor is physically blinking.
 
+        char = text.getText(offset, offset + 1)
         if char == self.EMBEDDED_OBJECT_CHARACTER:
             prevExtents = self.getExtents(obj, offset - 1, offset)
             thisExtents = self.getExtents(obj, offset, offset + 1)


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