[orca] Ensure we generate braille for valid offset in content editable objects



commit 8d7b903b968acacc900910b4b7c3452ae1736d68
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Sat Dec 2 12:22:46 2017 -0500

    Ensure we generate braille for valid offset in content editable objects

 src/orca/scripts/web/script.py |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/orca/scripts/web/script.py b/src/orca/scripts/web/script.py
index 9f29a82..3f032ff 100644
--- a/src/orca/scripts/web/script.py
+++ b/src/orca/scripts/web/script.py
@@ -859,10 +859,12 @@ class Script(default.Script):
             super().updateBraille(obj, **args)
             return
 
+        isContentEditable = self.utilities.isContentEditableWithEmbeddedObjects(obj)
+
         if not self._lastCommandWasCaretNav \
            and not self._lastCommandWasStructNav \
+           and not isContentEditable \
            and not self.utilities.isPlainText() \
-           and not self.utilities.isContentEditableWithEmbeddedObjects(obj) \
            and not self.utilities.lastInputEventWasCaretNavWithSelection():
             msg = "WEB: updating braille for unhandled navigation type %s" % obj
             debug.println(debug.LEVEL_INFO, msg, True)
@@ -870,6 +872,10 @@ class Script(default.Script):
             return
 
         obj, offset = self.utilities.getCaretContext(documentFrame=None)
+        if offset > 0 and isContentEditable:
+            text = self.utilities.queryNonEmptyText(obj)
+            offset = min(offset, text.characterCount)
+
         contents = self.utilities.getLineContentsAtOffset(obj, offset)
         self.displayContents(contents)
 


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