[orca] Chromium: Ignore "click-ancestor" action when identifying ignorable elements



commit 3ba9ed7fd7449afc6dedcd161fb656bf63a6c805
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Thu Aug 29 12:29:36 2019 -0400

    Chromium: Ignore "click-ancestor" action when identifying ignorable elements
    
    Click-ancestor is meant to bubble up to an ancestor which is actually
    clickable. But attempting to perform this action doesn't reliably work;
    and the clickable ancestor is what we want to click on anyway. Treating
    this as a valid action is causing us to include otherwise ignorable
    elements such as sections with no semantic meaning.

 src/orca/scripts/toolkits/Chromium/script_utilities.py | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
---
diff --git a/src/orca/scripts/toolkits/Chromium/script_utilities.py 
b/src/orca/scripts/toolkits/Chromium/script_utilities.py
index 61180f620..c177265df 100644
--- a/src/orca/scripts/toolkits/Chromium/script_utilities.py
+++ b/src/orca/scripts/toolkits/Chromium/script_utilities.py
@@ -263,6 +263,21 @@ class Utilities(web.Utilities):
         debug.println(debug.LEVEL_INFO, msg, True)
         return menu
 
+    def _getActionNames(self, obj):
+        names = super()._getActionNames(obj)
+
+        # click-ancestor is meant to bubble up to an ancestor which is actually
+        # clickable. But attempting to perform this action doesn't reliably work;
+        # and the clickable ancestor is what we want to click on anyway. Treating
+        # this as a valid action is causing us to include otherwise ignorable
+        # elements such as sections with no semantic meaning.
+        if "click-ancestor" in names:
+            names = list(filter(lambda x: x != "click-ancestor", names))
+            msg = "CHROMIUM: Ignoring 'click-ancestor' action on %s" % obj
+            debug.println(debug.LEVEL_INFO, msg, True)
+
+        return names
+
     def topLevelObject(self, obj):
         if not obj:
             return None


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