Bug 1069877 - Ensure that vc position does not jump when already set in loaded document. r=eeejay, a=lmandel
authorYura Zenevich <yzenevich@mozilla.com>
Thu, 25 Sep 2014 16:30:39 -0400
changeset 225251 adf6215f8a6a206ee59da010e862839cbb655fe8
parent 225250 34ced01a5a6de14154525ab08cd671778445791e
child 225252 87a15344376935b78d951fff0791540d8744e3a9
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
bugs1069877
milestone34.0a2
Bug 1069877 - Ensure that vc position does not jump when already set in loaded document. r=eeejay, a=lmandel
accessible/jsat/EventManager.jsm
--- a/accessible/jsat/EventManager.jsm
+++ b/accessible/jsat/EventManager.jsm
@@ -260,16 +260,22 @@ this.EventManager.prototype = {
 
        if (this.inTest) {
         this.sendMsgFunc("AccessFu:Focused");
        }
        break;
       }
       case Events.DOCUMENT_LOAD_COMPLETE:
       {
+        let position = this.contentControl.vc.position;
+        if (position && Utils.isInSubtree(position, aEvent.accessible)) {
+          // Do not automove into the document if the virtual cursor is already
+          // positioned inside it.
+          break;
+        }
         this.contentControl.autoMove(
           aEvent.accessible, { delay: 500 });
         break;
       }
       case Events.VALUE_CHANGE:
       {
         let position = this.contentControl.vc.position;
         let target = aEvent.accessible;