[orca] Clear cache to work around missing state-changed event in web content
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Clear cache to work around missing state-changed event in web content
- Date: Mon, 30 Jul 2018 23:55:20 +0000 (UTC)
commit 83741dceeafa2cd6e15786cc5d1941556788861d
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Mon Jul 30 19:54:17 2018 -0400
Clear cache to work around missing state-changed event in web content
src/orca/scripts/web/script_utilities.py | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index f6bedec9f..4266f5a91 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -576,6 +576,34 @@ class Utilities(script_utilities.Utilities):
return False
return attrs.get('hidden', False)
+ def _isOrIsIn(self, child, parent):
+ if not (child and parent):
+ return False
+
+ if child == parent:
+ return True
+
+ return pyatspi.findAncestor(child, lambda x: x == parent)
+
+ def isShowingAndVisible(self, obj):
+ rv = super().isShowingAndVisible(obj)
+ if rv or not self.inDocumentContent(obj):
+ return rv
+
+ if not self._isOrIsIn(orca_state.locusOfFocus, obj):
+ return rv
+
+ msg = "WEB: %s contains locusOfFocus but not showing and visible" % obj
+ debug.println(debug.LEVEL_INFO, msg, True)
+
+ obj.clearCache()
+ rv = super().isShowingAndVisible(obj)
+ if rv:
+ msg = "WEB: Clearing cache fixed state of %s. Missing event?" % obj
+ debug.println(debug.LEVEL_INFO, msg, True)
+
+ return rv
+
def isTextArea(self, obj):
if self.isLink(obj):
return False
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]