Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: chrome/renderer/resources/extensions/automation/automation_node.js

Issue 2243463002: Make ChromeVox navigation 100x faster on some sites. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var AutomationEvent = require('automationEvent').AutomationEvent; 5 var AutomationEvent = require('automationEvent').AutomationEvent;
6 var automationInternal = 6 var automationInternal =
7 require('binding').Binding.create('automationInternal').generate(); 7 require('binding').Binding.create('automationInternal').generate();
8 var exceptionHandler = require('uncaught_exception_handler'); 8 var exceptionHandler = require('uncaught_exception_handler');
9 var IsInteractPermitted = 9 var IsInteractPermitted =
10 requireNative('automationInternal').IsInteractPermitted; 10 requireNative('automationInternal').IsInteractPermitted;
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 for (var i = 0; i < count; ++i) { 300 for (var i = 0; i < count; ++i) {
301 var childID = GetChildIDAtIndex(this.treeID, this.id, i); 301 var childID = GetChildIDAtIndex(this.treeID, this.id, i);
302 var child = this.rootImpl.get(childID); 302 var child = this.rootImpl.get(childID);
303 $Array.push(children, child); 303 $Array.push(children, child);
304 } 304 }
305 return children; 305 return children;
306 }, 306 },
307 307
308 get previousSibling() { 308 get previousSibling() {
309 var parent = this.parent; 309 var parent = this.parent;
310 if (!parent)
311 return undefined;
312 parent = privates(parent).impl;
310 var indexInParent = GetIndexInParent(this.treeID, this.id); 313 var indexInParent = GetIndexInParent(this.treeID, this.id);
311 if (parent && indexInParent > 0) 314 return this.rootImpl.get(
312 return parent.children[indexInParent - 1]; 315 GetChildIDAtIndex(parent.treeID, parent.id, indexInParent - 1));
313 return undefined;
314 }, 316 },
315 317
316 get nextSibling() { 318 get nextSibling() {
317 var parent = this.parent; 319 var parent = this.parent;
320 if (!parent)
321 return undefined;
322 parent = privates(parent).impl;
318 var indexInParent = GetIndexInParent(this.treeID, this.id); 323 var indexInParent = GetIndexInParent(this.treeID, this.id);
319 if (parent && indexInParent < parent.children.length) 324 return this.rootImpl.get(
320 return parent.children[indexInParent + 1]; 325 GetChildIDAtIndex(parent.treeID, parent.id, indexInParent + 1));
321 return undefined;
322 }, 326 },
323 327
324 doDefault: function() { 328 doDefault: function() {
325 this.performAction_('doDefault'); 329 this.performAction_('doDefault');
326 }, 330 },
327 331
328 focus: function() { 332 focus: function() {
329 this.performAction_('focus'); 333 this.performAction_('focus');
330 }, 334 },
331 335
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 utils.defineProperty(AutomationRootNode, 'getOrCreate', function(treeID) { 1054 utils.defineProperty(AutomationRootNode, 'getOrCreate', function(treeID) {
1051 return AutomationRootNodeImpl.getOrCreate(treeID); 1055 return AutomationRootNodeImpl.getOrCreate(treeID);
1052 }); 1056 });
1053 1057
1054 utils.defineProperty(AutomationRootNode, 'destroy', function(treeID) { 1058 utils.defineProperty(AutomationRootNode, 'destroy', function(treeID) {
1055 AutomationRootNodeImpl.destroy(treeID); 1059 AutomationRootNodeImpl.destroy(treeID);
1056 }); 1060 });
1057 1061
1058 exports.$set('AutomationNode', AutomationNode); 1062 exports.$set('AutomationNode', AutomationNode);
1059 exports.$set('AutomationRootNode', AutomationRootNode); 1063 exports.$set('AutomationRootNode', AutomationRootNode);
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698