[orca/gnome-3-14] Handle hiddle floats when navigating by line in Gecko content
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca/gnome-3-14] Handle hiddle floats when navigating by line in Gecko content
- Date: Sat, 6 Sep 2014 00:42:24 +0000 (UTC)
commit b6555a244bd3fc538fd247cba9860db6760d0217
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Fri Sep 5 20:39:48 2014 -0400
Handle hiddle floats when navigating by line in Gecko content
.../scripts/toolkits/Gecko/script_utilities.py | 13 +++++
.../firefox/line_nav_hidden_float.params | 1 +
test/keystrokes/firefox/line_nav_hidden_float.py | 51 ++++++++++++++++++++
3 files changed, 65 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/scripts/toolkits/Gecko/script_utilities.py
b/src/orca/scripts/toolkits/Gecko/script_utilities.py
index 4167e78..13873e4 100644
--- a/src/orca/scripts/toolkits/Gecko/script_utilities.py
+++ b/src/orca/scripts/toolkits/Gecko/script_utilities.py
@@ -763,6 +763,16 @@ class Utilities(script_utilities.Utilities):
return objects
+ def _contentIsSubsetOf(self, contentA, contentB):
+ objA, startA, endA, stringA = contentA
+ objB, startB, endB, stringB = contentB
+ if objA == objB:
+ setA = set(range(startA, endA))
+ setB = set(range(startB, endB))
+ return setA.issubset(setB)
+
+ return False
+
def getLineContentsAtOffset(self, obj, offset):
if not obj:
return []
@@ -793,6 +803,9 @@ class Utilities(script_utilities.Utilities):
if not onLeft:
break
+ if self._contentIsSubsetOf(objects[0], onLeft[-1]):
+ objects.pop(0)
+
objects[0:0] = onLeft
firstObj, firstStart = objects[0][0], objects[0][1]
prevObj, pOffset = self._script.findPreviousCaretInOrder(firstObj, firstStart)
diff --git a/test/keystrokes/firefox/line_nav_hidden_float.params
b/test/keystrokes/firefox/line_nav_hidden_float.params
new file mode 100644
index 0000000..43635df
--- /dev/null
+++ b/test/keystrokes/firefox/line_nav_hidden_float.params
@@ -0,0 +1 @@
+PARAMS=$TEST_DIR/../../html/hidden-float-repeat.html
diff --git a/test/keystrokes/firefox/line_nav_hidden_float.py
b/test/keystrokes/firefox/line_nav_hidden_float.py
new file mode 100644
index 0000000..bba7779
--- /dev/null
+++ b/test/keystrokes/firefox/line_nav_hidden_float.py
@@ -0,0 +1,51 @@
+#!/usr/bin/python
+
+"""Test of line navigation output of Firefox."""
+
+from macaroon.playback import *
+import utils
+
+sequence = MacroSequence()
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Control>Home"))
+sequence.append(utils.AssertPresentationAction(
+ "1. Top of file",
+ ["BRAILLE LINE: '1'",
+ " VISIBLE: '1', cursor=1",
+ "SPEECH OUTPUT: '1'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Down"))
+sequence.append(utils.AssertPresentationAction(
+ "2. Line Down",
+ ["BRAILLE LINE: ' 2'",
+ " VISIBLE: ' 2', cursor=1",
+ "SPEECH OUTPUT: ' 2'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Down"))
+sequence.append(utils.AssertPresentationAction(
+ "3. Line Down",
+ ["BRAILLE LINE: '3'",
+ " VISIBLE: '3', cursor=1",
+ "SPEECH OUTPUT: '3'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Up"))
+sequence.append(utils.AssertPresentationAction(
+ "4. Line Up",
+ ["BRAILLE LINE: ' 2'",
+ " VISIBLE: ' 2', cursor=1",
+ "SPEECH OUTPUT: ' 2'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Up"))
+sequence.append(utils.AssertPresentationAction(
+ "5. Line Up",
+ ["BRAILLE LINE: '1'",
+ " VISIBLE: '1', cursor=1",
+ "SPEECH OUTPUT: '1'"]))
+
+sequence.append(utils.AssertionSummaryAction())
+sequence.start()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]