[orca] Web: Don't attempt to infer labels for ARIA widgets



commit 900d03eab5bfa3d6a6f0f52b0e2c766610f49a6c
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Wed Apr 20 13:59:36 2022 +0200

    Web: Don't attempt to infer labels for ARIA widgets
    
    Authors using ARIA are expected to provide names for their widgets,
    and typically do. However, when they don't, and we try to infer what
    might be the label based on surrounding text, we sometimes wind up
    duplicating a string the author plans to present some other way.
    And label inference is not especially performant. So only do the work
    for native HTML widgets which lack an accessible name.

 src/orca/scripts/web/script_utilities.py | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index 2aa92a08b..df7835d0e 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -4326,6 +4326,8 @@ class Utilities(script_utilities.Utilities):
         else:
             if name:
                 rv = False
+            elif self._getXMLRoles(obj):
+                rv = False
             elif not rv:
                 roles =  [pyatspi.ROLE_CHECK_BOX,
                           pyatspi.ROLE_COMBO_BOX,


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