Bug 980510 - After moving by granularity, swiping to next object brings up current object. r=eeejay, a=lmandel
authorMax Li <maxli@maxli.ca>
Fri, 22 Aug 2014 18:02:45 -0400
changeset 225245 1b49a4b95fd9ff1bc478d0fd275709a042a7a8c5
parent 225244 9f15e2107d286d2b99e60d096428522559555223
child 225246 825f06dd48b461c536d0f6449451b0a2194e71f7
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerseeejay, lmandel
bugs980510
milestone34.0a2
Bug 980510 - After moving by granularity, swiping to next object brings up current object. r=eeejay, a=lmandel
accessible/base/nsAccessiblePivot.cpp
accessible/tests/mochitest/jsat/test_content_text.html
--- a/accessible/base/nsAccessiblePivot.cpp
+++ b/accessible/base/nsAccessiblePivot.cpp
@@ -672,16 +672,23 @@ nsAccessiblePivot::AdjustStartPosition(A
       NS_ENSURE_SUCCESS(*aResult, nullptr);
       if (filtered & nsIAccessibleTraversalRule::FILTER_IGNORE_SUBTREE) {
         *aFilterResult = filtered;
         matched = temp;
       }
     }
   }
 
+  if (aAccessible == mPosition && mStartOffset != -1 && mEndOffset != -1) {
+    HyperTextAccessible* text = aAccessible->AsHyperText();
+    if (text) {
+      matched = text->GetChildAtOffset(mStartOffset);
+    }
+  }
+
   return matched;
 }
 
 Accessible*
 nsAccessiblePivot::SearchBackward(Accessible* aAccessible,
                                   nsIAccessibleTraversalRule* aRule,
                                   bool aSearchCurrent,
                                   nsresult* aResult)
--- a/accessible/tests/mochitest/jsat/test_content_text.html
+++ b/accessible/tests/mochitest/jsat/test_content_text.html
@@ -107,26 +107,16 @@
             speak: 'These',
             speak_checkFunc: 'todo_is', // Bug 980509
             android: [{
               eventType: AndroidEvent.VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY,
               fromIndex: 0,
               toIndex: 5
             }]
           }],
-          // XXX: Bug 980510: doing next after text traversal should
-          // bring us to the next paragraph.
-          [ContentMessages.simpleMoveNext, {
-            speak: 'You\'re a good guy, mon frere. ' +
-              'That means brother in French. ' +
-              'I don\'t know how I know that. ' +
-              'I took four years of Spanish.',
-            speak_checkFunc: 'todo_is' // Bug 980510
-          }],
-          // XXX: extra move op here because of bug 980510.
           [ContentMessages.simpleMoveNext, {
             speak: 'You\'re a good guy, mon frere. ' +
               'That means brother in French. ' +
               'I don\'t know how I know that. ' +
               'I took four years of Spanish.',
           }],
           // XXX: Word boundary should be past the apostraphe.
           [ContentMessages.moveNextBy('word'), {