[orca] Improve performance generating status bar in web apps



commit a91d15b4b983aef7c63eace0db0868aa890927b3
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Sat May 9 13:18:52 2020 -0400

    Improve performance generating status bar in web apps
    
    * Defer to the default script's presentObject() because we've already
      done all the work to ensure we have the right contents.
    * Don't bother checking for and possibly generating ancestors; we should
      just be presenting the status bar.

 src/orca/scripts/web/script.py           | 4 ++++
 src/orca/scripts/web/speech_generator.py | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/orca/scripts/web/script.py b/src/orca/scripts/web/script.py
index 53c9c1137..724d260b7 100644
--- a/src/orca/scripts/web/script.py
+++ b/src/orca/scripts/web/script.py
@@ -909,6 +909,10 @@ class Script(default.Script):
             super().presentObject(obj, **args)
             return
 
+        if obj.getRole() == pyatspi.ROLE_STATUS_BAR:
+            super().presentObject(obj, **args)
+            return
+
         priorObj = args.get("priorObj")
         if self._lastCommandWasCaretNav or args.get("includeContext"):
             priorObj, priorOffset = self.utilities.getPriorContext()
diff --git a/src/orca/scripts/web/speech_generator.py b/src/orca/scripts/web/speech_generator.py
index b1b817de9..04f6f71ef 100644
--- a/src/orca/scripts/web/speech_generator.py
+++ b/src/orca/scripts/web/speech_generator.py
@@ -84,7 +84,7 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
         if self._script.utilities.isLink(obj) \
            or self._script.utilities.isLandmark(obj) \
            or self._script.utilities.isMath(obj) \
-           or obj.getRole() == pyatspi.ROLE_TOOL_TIP:
+           or obj.getRole() in [pyatspi.ROLE_TOOL_TIP, pyatspi.ROLE_STATUS_BAR]:
             return result
 
         args['stopAtRoles'] = [pyatspi.ROLE_DOCUMENT_FRAME,


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