[orca] Handle multiple trailing punctuation chars when in object mode



commit 1b0490b510e92bc564bd7e2000da312699e87f48
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Fri Jul 24 17:56:54 2015 -0400

    Handle multiple trailing punctuation chars when in object mode

 src/orca/scripts/web/script_utilities.py           |    9 ++++++---
 .../firefox/object_nav_link_in_quotes.py           |   20 ++++++++------------
 2 files changed, 14 insertions(+), 15 deletions(-)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index 5cf218f..b356f50 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -1046,9 +1046,12 @@ class Utilities(script_utilities.Utilities):
 
             text = self.queryNonEmptyText(nextObj)
             if text:
-                char = text.getText(nOffset, nOffset + 1)
-                if re.match("[^\w\s]", char):
-                    objects.append([nextObj, nOffset, nOffset + 1, char])
+                nEnd = nOffset
+                while re.match("[^\w\s]", text.getText(nEnd, nEnd + 1)):
+                    nEnd += 1
+
+                onRight = [[nextObj, nOffset, nEnd, text.getText(nOffset, nEnd)]]
+                objects.extend(list(filter(_include, onRight)))
 
             if useCache:
                 self._currentLineContents = objects
diff --git a/test/keystrokes/firefox/object_nav_link_in_quotes.py 
b/test/keystrokes/firefox/object_nav_link_in_quotes.py
index 0c02fb9..8b2414c 100644
--- a/test/keystrokes/firefox/object_nav_link_in_quotes.py
+++ b/test/keystrokes/firefox/object_nav_link_in_quotes.py
@@ -15,19 +15,16 @@ sequence.append(utils.StartRecordingAction())
 sequence.append(KeyComboAction("<Control>Home"))
 sequence.append(utils.AssertPresentationAction(
     "1. Top of file",
-    ["KNOWN ISSUE: We're combining and repeating lines incorrectly throughout this test",
-     "BRAILLE LINE:  'line 1 \"'",
-     "     VISIBLE:  'line 1 \"', cursor=1",
-     "SPEECH OUTPUT: 'line 1'",
-     "SPEECH OUTPUT: '\"'"]))
+    ["BRAILLE LINE:  'line 1'",
+     "     VISIBLE:  'line 1', cursor=1",
+     "SPEECH OUTPUT: 'line 1'"]))
 
 sequence.append(utils.StartRecordingAction())
 sequence.append(KeyComboAction("Down"))
 sequence.append(utils.AssertPresentationAction(
     "2. Line Down",
-    ["BRAILLE LINE:  'line 2 \"'",
-     "     VISIBLE:  'line 2 \"', cursor=1",
-     "SPEECH OUTPUT: 'line 2 link'",
+    ["BRAILLE LINE:  '\"'",
+     "     VISIBLE:  '\"', cursor=1",
      "SPEECH OUTPUT: '\"'"]))
 
 sequence.append(utils.StartRecordingAction())
@@ -68,10 +65,9 @@ sequence.append(utils.StartRecordingAction())
 sequence.append(KeyComboAction("Up"))
 sequence.append(utils.AssertPresentationAction(
     "7. Line Up",
-    ["BRAILLE LINE:  'line 1 \"'",
-     "     VISIBLE:  'line 1 \"', cursor=1",
-     "SPEECH OUTPUT: 'line 1'",
-     "SPEECH OUTPUT: '\"'"]))
+    ["BRAILLE LINE:  'line 1'",
+     "     VISIBLE:  'line 1', cursor=1",
+     "SPEECH OUTPUT: 'line 1'"]))
 
 sequence.append(utils.AssertionSummaryAction())
 sequence.start()


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