[orca] Web: Improve recovery from destroyed focused entry
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Web: Improve recovery from destroyed focused entry
- Date: Tue, 12 Apr 2022 16:28:56 +0000 (UTC)
commit 8443a764ef8df43404097561b6104cba9dd4b306
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Tue Apr 12 18:26:18 2022 +0200
Web: Improve recovery from destroyed focused entry
When Chromium destroys and recreates a focused entry's accessible,
it seems to also fire a text-inserted event. Therefore, if we get
such an event and haven't already recovered (e.g. from the children-
removed event), update the locusOfFocus to the focused entry which
just "inserted" text.
src/orca/scripts/web/script.py | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/src/orca/scripts/web/script.py b/src/orca/scripts/web/script.py
index 6e459972c..d1c40efc3 100644
--- a/src/orca/scripts/web/script.py
+++ b/src/orca/scripts/web/script.py
@@ -2425,11 +2425,20 @@ class Script(default.Script):
debug.println(debug.LEVEL_INFO, msg, True)
self.utilities.clearContentCache()
+ state = event.source.getState()
+
document = self.utilities.getTopLevelDocumentForObject(event.source)
if self.utilities.isDead(orca_state.locusOfFocus):
msg = "WEB: Dumping cache: dead focus %s" % orca_state.locusOfFocus
debug.println(debug.LEVEL_INFO, msg, True)
self.utilities.dumpCache(document, preserveContext=True)
+
+ if state.contains(pyatspi.STATE_FOCUSED):
+ msg = "WEB: Event handled: Setting locusOfFocus to event source"
+ debug.println(debug.LEVEL_INFO, msg, True)
+ orca.setLocusOfFocus(None, event.source, force=True)
+ return True
+
else:
msg = "WEB: Clearing structural navigation cache for %s" % document
debug.println(debug.LEVEL_INFO, msg, True)
@@ -2441,7 +2450,6 @@ class Script(default.Script):
debug.println(debug.LEVEL_INFO, msg, True)
return True
- state = event.source.getState()
if not state.contains(pyatspi.STATE_EDITABLE):
if event.source != orca_state.locusOfFocus:
msg = "WEB: Done processing non-editable, non-locusOfFocus source"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]