[orca] Web: Include focusable elements with clickancestor action as clickable



commit 688faa78a4735ac491182aef8f825b8153acb756
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Mon Apr 25 16:44:54 2022 +0200

    Web: Include focusable elements with clickancestor action as clickable
    
    In order to minimize spam in the list of clickables, we were only
    treating an element as clickable if it implemented the "click" action
    and was not focusable. This made all the divs, spans, etc. that only
    had a click handler discoverable and more accessible without producing
    large lists of clickable items and saying "clickable" all the time. But
    it causes items which have a clickable ancestor (exposed by Chromium)
    to be ignored. A lot of things can have a clickable ancestor, so
    only include them if they are also focusable.

 src/orca/scripts/web/script_utilities.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index df7835d0e..82330ee91 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -3565,10 +3565,12 @@ class Utilities(script_utilities.Utilities):
             return False
 
         rv = False
-        if not obj.getState().contains(pyatspi.STATE_FOCUSABLE) \
-           and not self.isFocusModeWidget(obj):
+        if not self.isFocusModeWidget(obj):
             names = self._getActionNames(obj)
-            rv = "click" in names
+            if not obj.getState().contains(pyatspi.STATE_FOCUSABLE):
+                rv = "click" in names
+            else:
+                rv = "clickancestor" in names
 
         if rv and not obj.name and "Text" in pyatspi.listInterfaces(obj):
             string = obj.queryText().getText(0, -1)


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