[orca] Work around Thunderbird not exposing STATE_EDITABLE on all editable objects
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Work around Thunderbird not exposing STATE_EDITABLE on all editable objects
- Date: Sat, 2 Dec 2017 18:30:45 +0000 (UTC)
commit 428b9a5ea2720acc1073a70706a72a965ca6196d
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Sat Dec 2 13:30:05 2017 -0500
Work around Thunderbird not exposing STATE_EDITABLE on all editable objects
src/orca/scripts/web/script.py | 3 +--
src/orca/scripts/web/script_utilities.py | 9 ++++++++-
2 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/orca/scripts/web/script.py b/src/orca/scripts/web/script.py
index 3f032ff..df536aa 100644
--- a/src/orca/scripts/web/script.py
+++ b/src/orca/scripts/web/script.py
@@ -1879,8 +1879,7 @@ class Script(default.Script):
debug.println(debug.LEVEL_INFO, msg, True)
self.structuralNavigation.clearCache(document)
- state = event.source.getState()
- if not state.contains(pyatspi.STATE_EDITABLE):
+ if not self.utilities.isContentEditableWithEmbeddedObjects(event.source):
if self._inMouseOverObject \
and self.utilities.isZombie(self._lastMouseOverObject):
msg = "WEB: Restoring pre-mouseover context"
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index 81123e7..516977c 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -1615,6 +1615,9 @@ class Utilities(script_utilities.Utilities):
or self.isToolBarDescendant(obj):
return True
+ if self.isContentEditableWithEmbeddedObjects(obj):
+ return True
+
return False
def _textBlockElementRoles(self):
@@ -3141,8 +3144,12 @@ class Utilities(script_utilities.Utilities):
debug.println(debug.LEVEL_INFO, msg, True)
return rv
+ isTextBlockRole = role in self._textBlockElementRoles() or self.isLink(obj)
if state.contains(pyatspi.STATE_EDITABLE):
- rv = role in self._textBlockElementRoles() or self.isLink(obj)
+ rv = isTextBlockRole
+ elif not self.isDocument(obj):
+ document = self.getDocumentForObject(obj)
+ rv = self.isContentEditableWithEmbeddedObjects(document)
self._isContentEditableWithEmbeddedObjects[hash(obj)] = rv
return rv
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]