[orca] Do not switch back to browse mode when on a link



commit 31aaf22d52024320a6e7171e7158703b8d38878c
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Mon Apr 6 16:48:03 2020 -0400

    Do not switch back to browse mode when on a link
    
    Links are normally treated as browse mode objects. However, in some web
    apps (e.g. Gmail), the link role is used as part of a navigation list.
    Therefore if the user is in focus mode and reaches a link via native/app
    navigation, don't switch to browse mode.

 src/orca/scripts/web/script.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/orca/scripts/web/script.py b/src/orca/scripts/web/script.py
index 1c9e3d656..f0cb78f19 100644
--- a/src/orca/scripts/web/script.py
+++ b/src/orca/scripts/web/script.py
@@ -808,7 +808,8 @@ class Script(default.Script):
             debug.println(debug.LEVEL_INFO, msg, True)
             return True
 
-        if self._inFocusMode and obj and obj.getRole() == pyatspi.ROLE_RADIO_BUTTON:
+        doNotToggle = [pyatspi.ROLE_LINK, pyatspi.ROLE_RADIO_BUTTON]
+        if self._inFocusMode and obj and obj.getRole() in doNotToggle:
             msg = "WEB: Staying in focus mode due to role of %s" % obj
             debug.println(debug.LEVEL_INFO, msg, True)
             return True


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