[orca] Web: Ensure we say something when using caret nav to interrupt SayAll
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Web: Ensure we say something when using caret nav to interrupt SayAll
- Date: Wed, 6 Jan 2021 15:12:41 +0000 (UTC)
commit 715f8763775a4b02fc4cbd08feaa4d0e59c473b0
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 4570a8f1c..fb27b88bd 100644
--- a/src/orca/scripts/default.py
+++ b/src/orca/scripts/default.py
@@ -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)
diff --git a/src/orca/scripts/web/speech_generator.py b/src/orca/scripts/web/speech_generator.py
index eb366cde5..e559840c8 100644
--- a/src/orca/scripts/web/speech_generator.py
+++ b/src/orca/scripts/web/speech_generator.py
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]