[orca] Don't handle unknown, untagged added children as live region events



commit fc124c1a3780b5104eb46a7aca33b2e9deb24e63
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Wed May 23 15:13:53 2018 -0700

    Don't handle unknown, untagged added children as live region events

 src/orca/scripts/web/script_utilities.py |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index 4b59d9b..7c3f5cc 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -3699,7 +3699,23 @@ class Utilities(script_utilities.Utilities):
         if not _settingsManager.getSetting('inferLiveRegions'):
             return False
 
-        return self.isLiveRegion(event.source)
+        if not self.isLiveRegion(event.source):
+            return False
+
+        if isinstance(event.any_data, pyatspi.Accessible):
+            try:
+                role = event.any_data.getRole()
+            except:
+                msg = "WEB: Exception getting role for %s" % event.any_data
+                debug.println(debug.LEVEL_INFO, msg, True)
+                return True
+
+            if role == pyatspi.ROLE_UNKNOWN and not self._getTag(event.any_data):
+                msg = "WEB: Child has unknown role and no tag %s" % event.any_data
+                debug.println(debug.LEVEL_INFO, msg, True)
+                return False
+
+        return True
 
     def getPageObjectCount(self, obj):
         result = {'landmarks': 0,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]