Commit 715f8763 authored by Joanmarie Diggs's avatar Joanmarie Diggs

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.
parent 069a8cee
......@@ -3114,7 +3114,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)
......@@ -3123,7 +3123,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)
......
......@@ -798,7 +798,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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment