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

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/tree_walker.js

Issue 2601333002: Update json_schema_compiler to handle the Automation extension API (Closed)
Patch Set: Rebase Created 3 years, 11 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 /** 5 /**
6 * @fileoverview A tree walker over the automation tree. 6 * @fileoverview A tree walker over the automation tree.
7 */ 7 */
8 8
9 goog.provide('AutomationTreeWalker'); 9 goog.provide('AutomationTreeWalker');
10 goog.provide('AutomationTreeWalkerPhase'); 10 goog.provide('AutomationTreeWalkerPhase');
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 this.phase_ = AutomationTreeWalkerPhase.INITIAL; 81 this.phase_ = AutomationTreeWalkerPhase.INITIAL;
82 /** @const {constants.Dir} @private */ 82 /** @const {constants.Dir} @private */
83 this.dir_ = dir; 83 this.dir_ = dir;
84 /** @const {!chrome.automation.AutomationNode} @private */ 84 /** @const {!chrome.automation.AutomationNode} @private */
85 this.initialNode_ = node; 85 this.initialNode_ = node;
86 /** 86 /**
87 * Deepest common ancestor of initialNode and node. Valid only when moving 87 * Deepest common ancestor of initialNode and node. Valid only when moving
88 * backward. 88 * backward.
89 * @type {chrome.automation.AutomationNode} @private 89 * @type {chrome.automation.AutomationNode} @private
90 */ 90 */
91 this.backwardAncestor_ = node.parent; 91 this.backwardAncestor_ = node.parent || null;
92 var restrictions = opt_restrictions || {}; 92 var restrictions = opt_restrictions || {};
93 93
94 this.visitPred_ = function(node) { 94 this.visitPred_ = function(node) {
95 if (this.skipInitialAncestry_ && 95 if (this.skipInitialAncestry_ &&
96 this.phase_ == AutomationTreeWalkerPhase.ANCESTOR) 96 this.phase_ == AutomationTreeWalkerPhase.ANCESTOR)
97 return false; 97 return false;
98 98
99 if (this.skipInitialSubtree_ && 99 if (this.skipInitialSubtree_ &&
100 this.phase != AutomationTreeWalkerPhase.ANCESTOR && 100 this.phase != AutomationTreeWalkerPhase.ANCESTOR &&
101 this.phase != AutomationTreeWalkerPhase.OTHER) 101 this.phase != AutomationTreeWalkerPhase.OTHER)
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 node = node.previousSibling; 214 node = node.previousSibling;
215 215
216 while (!this.leafPred_(node) && node.lastChild) 216 while (!this.leafPred_(node) && node.lastChild)
217 node = node.lastChild; 217 node = node.lastChild;
218 218
219 this.node_ = node; 219 this.node_ = node;
220 return; 220 return;
221 } 221 }
222 if (node.parent && this.backwardAncestor_ == node.parent) { 222 if (node.parent && this.backwardAncestor_ == node.parent) {
223 this.phase_ = AutomationTreeWalkerPhase.ANCESTOR; 223 this.phase_ = AutomationTreeWalkerPhase.ANCESTOR;
224 this.backwardAncestor_ = node.parent.parent; 224 this.backwardAncestor_ = node.parent.parent || null;
225 } 225 }
226 this.node_ = node.parent; 226 this.node_ = node.parent || null;
227 } 227 }
228 }; 228 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698