[orca] Filter out more browser chrome event spam
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Filter out more browser chrome event spam
- Date: Sat, 17 Oct 2015 01:57:19 +0000 (UTC)
commit f19f95738e17d42b21b737d616b90b647f6c6fdb
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Fri Oct 16 21:52:54 2015 -0400
Filter out more browser chrome event spam
src/orca/scripts/web/script.py | 17 +++++++++++------
src/orca/scripts/web/script_utilities.py | 19 +++++++++++--------
2 files changed, 22 insertions(+), 14 deletions(-)
---
diff --git a/src/orca/scripts/web/script.py b/src/orca/scripts/web/script.py
index 8e7e915..4bc73ac 100644
--- a/src/orca/scripts/web/script.py
+++ b/src/orca/scripts/web/script.py
@@ -1245,6 +1245,11 @@ class Script(default.Script):
def onChildrenChanged(self, event):
"""Callback for object:children-changed accessibility events."""
+ if self.utilities.eventIsChromeNoise(event):
+ msg = "WEB: Ignoring event believed to be chrome noise"
+ debug.println(debug.LEVEL_INFO, msg)
+ return True
+
document = self.utilities.getDocumentForObject(event.source)
if document:
msg = "WEB: Clearing structural navigation cache for %s" % document
@@ -1430,8 +1435,8 @@ class Script(default.Script):
def onNameChanged(self, event):
"""Callback for object:property-change:accessible-name events."""
- if self.utilities.eventIsStatusBarNoise(event):
- msg = "WEB: Ignoring event believed to be status bar noise"
+ if self.utilities.eventIsChromeNoise(event):
+ msg = "WEB: Ignoring event believed to be chrome noise"
debug.println(debug.LEVEL_INFO, msg)
return True
@@ -1508,8 +1513,8 @@ class Script(default.Script):
debug.println(debug.LEVEL_INFO, msg)
return True
- if self.utilities.eventIsStatusBarNoise(event):
- msg = "WEB: Ignoring event believed to be status bar noise"
+ if self.utilities.eventIsChromeNoise(event):
+ msg = "WEB: Ignoring event believed to be chrome noise"
debug.println(debug.LEVEL_INFO, msg)
return True
@@ -1559,8 +1564,8 @@ class Script(default.Script):
debug.println(debug.LEVEL_INFO, msg)
return True
- if self.utilities.eventIsStatusBarNoise(event):
- msg = "WEB: Ignoring event believed to be status bar noise"
+ if self.utilities.eventIsChromeNoise(event):
+ msg = "WEB: Ignoring event believed to be chrome noise"
debug.println(debug.LEVEL_INFO, msg)
return True
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index 9e20335..c53955e 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -2240,19 +2240,22 @@ class Utilities(script_utilities.Utilities):
return False
- def eventIsStatusBarNoise(self, event):
+ def eventIsChromeNoise(self, event):
if self.inDocumentContent(event.source):
return False
+ try:
+ role = event.source.getRole()
+ except:
+ msg = "WEB: Exception getting role for %s" % event.source
+ debug.println(debug.LEVEL_INFO, msg)
+ return False
+
eType = event.type
if eType.startswith("object:text-") or eType.endswith("accessible-name"):
- try:
- role = event.source.getRole()
- except:
- msg = "WEB: Exception getting role for %s" % event.source
- debug.println(debug.LEVEL_INFO, msg)
- else:
- return role == pyatspi.ROLE_STATUS_BAR
+ return role in [pyatspi.ROLE_STATUS_BAR, pyatspi.ROLE_LABEL]
+ if eType.startswith("object:children-changed"):
+ return True
return False
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]