[orca] Fix another instance of getting stuck in visually-hidden MathML content
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Fix another instance of getting stuck in visually-hidden MathML content
- Date: Thu, 2 Feb 2017 17:27:07 +0000 (UTC)
commit 6bf587fa4637d4327a889deadac91b1000e90469
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Thu Feb 2 18:26:01 2017 +0100
Fix another instance of getting stuck in visually-hidden MathML content
src/orca/scripts/web/script_utilities.py | 4 +
test/html/tinymath.html | 14 +++++
.../firefox/math_line_nav_tiny_mathml.py | 60 ++++++++++++++++++-
3 files changed, 74 insertions(+), 4 deletions(-)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index 3cddf1a..c4ad57e 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -1328,6 +1328,10 @@ class Utilities(script_utilities.Utilities):
objects.extend(onRight)
lastObj, lastEnd = objects[-1][0], objects[-1][2]
+ if self.isMathTopLevel(lastObj):
+ lastObj, lastEnd = self.lastContext(lastObj)
+ lastEnd += 1
+
nextObj, nOffset = self.findNextCaretInOrder(lastObj, lastEnd - 1)
if useCache:
diff --git a/test/html/tinymath.html b/test/html/tinymath.html
index 7f17003..3388e96 100644
--- a/test/html/tinymath.html
+++ b/test/html/tinymath.html
@@ -25,5 +25,19 @@ Line 2
Line 4
</div>
<div>Line 5</div>
+<div>Line 6
+<span role="presentation" style="position: relative;">
+ <span class="tinymath" role="presentation">
+ <math><mn>3</mn><mo>+</mo><mn>4</mn><mo>=</mo></math>
+ </span>
+</span>
+<span role="presentation" style="position: relative;">
+ <span class="tinymath" role="presentation">
+ <math><mn>5</mn><mo>+</mo><mn>2</mn><mo>=</mo></math>
+ </span>
+</span>
+</div>
+<div>Line 7</div>
+<div>Line 8</div>
</body>
</html>
diff --git a/test/keystrokes/firefox/math_line_nav_tiny_mathml.py
b/test/keystrokes/firefox/math_line_nav_tiny_mathml.py
index a8de275..604add5 100644
--- a/test/keystrokes/firefox/math_line_nav_tiny_mathml.py
+++ b/test/keystrokes/firefox/math_line_nav_tiny_mathml.py
@@ -51,9 +51,61 @@ sequence.append(utils.AssertPresentationAction(
"SPEECH OUTPUT: 'Line 5'"]))
sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Down"))
+sequence.append(utils.AssertPresentationAction(
+ "6. Line Down",
+ ["BRAILLE LINE: 'Line 6'",
+ " VISIBLE: 'Line 6', cursor=1",
+ "SPEECH OUTPUT: 'Line 6'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Down"))
+sequence.append(utils.AssertPresentationAction(
+ "7. Line Down",
+ ["BRAILLE LINE: 'math math Line 7'",
+ " VISIBLE: 'math math Line 7', cursor=0",
+ "SPEECH OUTPUT: '3 plus 4 equals'",
+ "SPEECH OUTPUT: '5 plus 2 equals'",
+ "SPEECH OUTPUT: 'Line 7'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Down"))
+sequence.append(utils.AssertPresentationAction(
+ "8. Line Down",
+ ["BRAILLE LINE: 'Line 8'",
+ " VISIBLE: 'Line 8', cursor=1",
+ "SPEECH OUTPUT: 'Line 8'"]))
+
+sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Up"))
sequence.append(utils.AssertPresentationAction(
- "6. Line Up",
+ "9. Line Up",
+ ["BRAILLE LINE: 'math math Line 7'",
+ " VISIBLE: 'math math Line 7', cursor=0",
+ "SPEECH OUTPUT: '3 plus 4 equals'",
+ "SPEECH OUTPUT: '5 plus 2 equals'",
+ "SPEECH OUTPUT: 'Line 7'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Up"))
+sequence.append(utils.AssertPresentationAction(
+ "10. Line Up",
+ ["BRAILLE LINE: 'Line 6'",
+ " VISIBLE: 'Line 6', cursor=1",
+ "SPEECH OUTPUT: 'Line 6'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Up"))
+sequence.append(utils.AssertPresentationAction(
+ "11. Line Up",
+ ["BRAILLE LINE: 'Line 5'",
+ " VISIBLE: 'Line 5', cursor=1",
+ "SPEECH OUTPUT: 'Line 5'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Up"))
+sequence.append(utils.AssertPresentationAction(
+ "12. Line Up",
["BRAILLE LINE: '2+2=Line 4'",
" VISIBLE: '2+2=Line 4', cursor=1",
"SPEECH OUTPUT: '2+2='",
@@ -62,7 +114,7 @@ sequence.append(utils.AssertPresentationAction(
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Up"))
sequence.append(utils.AssertPresentationAction(
- "7. Line Up",
+ "13. Line Up",
["BRAILLE LINE: 'Line 3'",
" VISIBLE: 'Line 3', cursor=1",
"SPEECH OUTPUT: 'Line 3'"]))
@@ -70,7 +122,7 @@ sequence.append(utils.AssertPresentationAction(
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Up"))
sequence.append(utils.AssertPresentationAction(
- "8. Line Up",
+ "14. Line Up",
["BRAILLE LINE: 'math Line 2'",
" VISIBLE: 'math Line 2', cursor=0",
"SPEECH OUTPUT: '1 plus 1 equals'",
@@ -79,7 +131,7 @@ sequence.append(utils.AssertPresentationAction(
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Up"))
sequence.append(utils.AssertPresentationAction(
- "9. Line Up",
+ "15. Line Up",
["BRAILLE LINE: 'Line 1'",
" VISIBLE: 'Line 1', cursor=1",
"SPEECH OUTPUT: 'Line 1'"]))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]