[orca] Chromium: Filter out more instances of documents without a URI



commit a8748b19760aedab9c4ae969d90a2ab06c5a3e34
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Tue Jan 8 17:55:31 2019 -0500

    Chromium: Filter out more instances of documents without a URI

 src/orca/scripts/toolkits/Chromium/script.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)
---
diff --git a/src/orca/scripts/toolkits/Chromium/script.py b/src/orca/scripts/toolkits/Chromium/script.py
index 2d682cb6c..c786cbb15 100644
--- a/src/orca/scripts/toolkits/Chromium/script.py
+++ b/src/orca/scripts/toolkits/Chromium/script.py
@@ -137,6 +137,13 @@ class Script(web.Script):
             msg = "CHROMIUM: NO INITIAL FOCUS HACK. Focused object: %s - %.4fs" % \
                 (focusedObject, time.time()-startTime)
             debug.println(debug.LEVEL_INFO, msg, True)
+
+            if self.utilities.isDocument(focusedObject) \
+               and not self.utilities.documentFrameURI(focusedObject):
+                msg = "CHROMIUM: Ignoring focused object (document with no URI)."
+                debug.println(debug.LEVEL_INFO, msg, True)
+                return
+
             if focusedObject:
                 orca.setLocusOfFocus(event, focusedObject)
 
@@ -261,6 +268,12 @@ class Script(web.Script):
     def onFocusedChanged(self, event):
         """Callback for object:state-changed:focused accessibility events."""
 
+        if self.utilities.isDocument(event.source) \
+           and not self.utilities.documentFrameURI(event.source):
+            msg = "CHROMIUM: Ignoring event from document with no URI."
+            debug.println(debug.LEVEL_INFO, msg, True)
+            return
+
         if super().onFocusedChanged(event):
             return
 


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