[orca] Update locusOfFocus and caret context for contenteditable caret-moved events
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Update locusOfFocus and caret context for contenteditable caret-moved events
- Date: Sat, 20 Feb 2016 01:42:10 +0000 (UTC)
commit d4c23526760ef457d19b25a13df04c4b06dea9eb
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Fri Feb 19 20:40:38 2016 -0500
Update locusOfFocus and caret context for contenteditable caret-moved events
src/orca/scripts/web/script.py | 7 +++++++
src/orca/scripts/web/script_utilities.py | 13 +++++++++++++
2 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/scripts/web/script.py b/src/orca/scripts/web/script.py
index 4a53d5e..045e664 100644
--- a/src/orca/scripts/web/script.py
+++ b/src/orca/scripts/web/script.py
@@ -1245,6 +1245,13 @@ class Script(default.Script):
self.utilities.setCaretContext(obj, offset)
return True
+ if self.utilities.isContentEditableWithEmbeddedObjects(event.source):
+ msg = "WEB: Event handled: In content editable with embedded objects"
+ debug.println(debug.LEVEL_INFO, msg, True)
+ orca.setLocusOfFocus(event, event.source, False)
+ self.utilities.setCaretContext(obj, offset)
+ return False
+
text = self.utilities.queryNonEmptyText(event.source)
if not text:
if event.source.getRole() == pyatspi.ROLE_LINK:
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index 13ed859..035b651 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -2500,6 +2500,19 @@ class Utilities(script_utilities.Utilities):
isSameFragment = lambda x: self._getID(x) == parseResult.fragment
return pyatspi.findAncestor(obj, isSameFragment) is not None
+ def isContentEditableWithEmbeddedObjects(self, obj):
+ if not (obj and obj.getState().contains(pyatspi.STATE_EDITABLE)):
+ return False
+
+ try:
+ childCount = obj.childCount
+ except:
+ msg = "WEB: Exception getting childCount for %s" % obj
+ debug.println(debug.LEVEL_INFO, msg, True)
+ return False
+
+ return childCount > 0
+
@staticmethod
def getHyperlinkRange(obj):
try:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]