[orca] Chromium: Hack around inability to ascend ancestry all the way to the frame
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Chromium: Hack around inability to ascend ancestry all the way to the frame
- Date: Tue, 13 Nov 2018 21:20:42 +0000 (UTC)
commit a1459623d6d20b3716fda737ec37d04d2a83faac
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Tue Nov 13 16:19:41 2018 -0500
Chromium: Hack around inability to ascend ancestry all the way to the frame
src/orca/scripts/toolkits/Chromium/script.py | 6 +++---
.../scripts/toolkits/Chromium/script_utilities.py | 19 +++++++++++++++++++
2 files changed, 22 insertions(+), 3 deletions(-)
---
diff --git a/src/orca/scripts/toolkits/Chromium/script.py b/src/orca/scripts/toolkits/Chromium/script.py
index 2979cf02a..41985b974 100644
--- a/src/orca/scripts/toolkits/Chromium/script.py
+++ b/src/orca/scripts/toolkits/Chromium/script.py
@@ -276,9 +276,6 @@ class Script(web.Script):
def onSelectedChanged(self, event):
"""Callback for object:state-changed:selected accessibility events."""
- if super().onSelectedChanged(event):
- return
-
# Other apps and toolkits implement the selection interface, which is
# what we use to present active-descendanty selection changes, leaving
# state-changed:selected for notifications related to toggling the
@@ -294,6 +291,9 @@ class Script(web.Script):
orca.setLocusOfFocus(event, event.source)
return
+ if super().onSelectedChanged(event):
+ return
+
msg = "CHROMIUM: Passing along event to default script"
debug.println(debug.LEVEL_INFO, msg, True)
default.Script.onSelectedChanged(self, event)
diff --git a/src/orca/scripts/toolkits/Chromium/script_utilities.py
b/src/orca/scripts/toolkits/Chromium/script_utilities.py
index 41bcf4fb9..2220b7a1a 100644
--- a/src/orca/scripts/toolkits/Chromium/script_utilities.py
+++ b/src/orca/scripts/toolkits/Chromium/script_utilities.py
@@ -164,3 +164,22 @@ class Utilities(web.Utilities):
msg = "CHROMIUM: HACK: Doing focus grab when setting caret on %s" % obj
debug.println(debug.LEVEL_INFO, msg, True)
return True
+
+ def topLevelObject(self, obj):
+ # HACK: Remove this once we can ascend ancestry and get top level
+ # object from within web content.
+ topLevel = super().topLevelObject(obj)
+ if not topLevel or topLevel.getRole() in self._topLevelRoles():
+ return topLevel
+
+ msg = "CHROMIUM: ERROR: Top level object for %s is %s" % (obj, topLevel)
+ debug.println(debug.LEVEL_INFO, msg, True)
+
+ if self.isDocument(topLevel) and orca_state.activeWindow \
+ and orca_state.activeWindow.getApplication() == self._script.app:
+ if pyatspi.findDescendant(topLevel, lambda x: x == topLevel):
+ msg = "CHROMIUM: HACK: Returning %s as top level" % orca_state.activeWindow
+ debug.println(debug.LEVEL_INFO, msg, True)
+ return orca_state.activeWindow
+
+ return topLevel
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]