[orca/gnome-3-38] Web: Ensure we say something when using caret nav to interrupt SayAll



commit ba130732d2d12d0888f5fc57c0b25abff75f6bd7
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Wed Jan 6 16:00:59 2021 +0100

    Web: Ensure we say something when using caret nav to interrupt SayAll
    
    This addresses an edge case: We're in SayAll, a caret navigation command
    is given which interrupts SayAll, and we happen to land in an empty text
    element (e.g. a paragraph) as a consequence of that caret navigation
    command. In this particular case, we should say "blank" but we weren't
    doing so because we only do that "blank" fallback when we are not in
    SayAll. (Interrupted SayAll is treated as in SayAll due to the fast-forward
    and rewind commands.)
    
    To address this edge case, add an optional argument to inSayAll() that
    allows us to treat interrupted SayAll as not being in SayAll. Then
    use that for the "blank" fallback for web content.

 src/orca/scripts/default.py              | 4 ++--
 src/orca/scripts/web/speech_generator.py | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/orca/scripts/default.py b/src/orca/scripts/default.py
index 5d7a8d5a4..1045c557d 100644
--- a/src/orca/scripts/default.py
+++ b/src/orca/scripts/default.py
@@ -3111,7 +3111,7 @@ class Script(script.Script):
         if text.getNSelections() > 0:
             text.setSelection(0, context.currentOffset, context.currentOffset)
 
-    def inSayAll(self):
+    def inSayAll(self, treatInterruptedAsIn=True):
         if self._inSayAll:
             msg = "DEFAULT: In SayAll"
             debug.println(debug.LEVEL_INFO, msg, True)
@@ -3120,7 +3120,7 @@ class Script(script.Script):
         if self._sayAllIsInterrupted:
             msg = "DEFAULT: SayAll is interrupted"
             debug.println(debug.LEVEL_INFO, msg, True)
-            return True
+            return treatInterruptedAsIn
 
         msg = "DEFAULT: Not in SayAll"
         debug.println(debug.LEVEL_INFO, msg, True)
diff --git a/src/orca/scripts/web/speech_generator.py b/src/orca/scripts/web/speech_generator.py
index b8543b9da..370a6a0e4 100644
--- a/src/orca/scripts/web/speech_generator.py
+++ b/src/orca/scripts/web/speech_generator.py
@@ -789,7 +789,7 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
                 args['priorObj'] = obj
 
         if not result:
-            if self._script.inSayAll():
+            if self._script.inSayAll(treatInterruptedAsIn=False):
                 string = ""
             else:
                 string = messages.BLANK


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