| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 * Class to move to the appropriate node in the accessibility tree. Stays in a | 6 * Class to move to the appropriate node in the accessibility tree. Stays in a |
| 7 * subtree determined by restrictions passed to it. | 7 * subtree determined by restrictions passed to it. |
| 8 * | 8 * |
| 9 * @constructor | 9 * @constructor |
| 10 * @param {!chrome.automation.AutomationNode} start | 10 * @param {!chrome.automation.AutomationNode} start |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 */ | 34 */ |
| 35 this.leafPred_ = restrictions.leaf; | 35 this.leafPred_ = restrictions.leaf; |
| 36 | 36 |
| 37 /** | 37 /** |
| 38 * Function that returns true for a node in the current subtree that should | 38 * Function that returns true for a node in the current subtree that should |
| 39 * be visited. | 39 * be visited. |
| 40 * | 40 * |
| 41 * @private {!AutomationTreeWalker.Unary} | 41 * @private {!AutomationTreeWalker.Unary} |
| 42 */ | 42 */ |
| 43 this.visitPred_ = restrictions.visit; | 43 this.visitPred_ = restrictions.visit; |
| 44 }; | 44 } |
| 45 | 45 |
| 46 /** | 46 /** |
| 47 * @typedef {{leaf: AutomationTreeWalker.Unary, | 47 * @typedef {{leaf: AutomationTreeWalker.Unary, |
| 48 * visit: AutomationTreeWalker.Unary}} | 48 * visit: AutomationTreeWalker.Unary}} |
| 49 */ | 49 */ |
| 50 AutomationTreeWalker.Restriction; | 50 AutomationTreeWalker.Restriction; |
| 51 | 51 |
| 52 /** | 52 /** |
| 53 * @typedef {function(!chrome.automation.AutomationNode) : boolean} | 53 * @typedef {function(!chrome.automation.AutomationNode) : boolean} |
| 54 */ | 54 */ |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 let parent = node.parent; | 244 let parent = node.parent; |
| 245 if (parent) { | 245 if (parent) { |
| 246 return parent; | 246 return parent; |
| 247 } else { | 247 } else { |
| 248 console.log('Node has no parent'); | 248 console.log('Node has no parent'); |
| 249 console.log('\n'); | 249 console.log('\n'); |
| 250 return null; | 250 return null; |
| 251 } | 251 } |
| 252 } | 252 } |
| 253 }; | 253 }; |
| OLD | NEW |