| OLD | NEW |
| 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 /** | 5 /** |
| 6 * @fileoverview ChromeVox predicates for the automation extension API. | 6 * @fileoverview ChromeVox predicates for the automation extension API. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 goog.provide('AutomationPredicate'); | 9 goog.provide('AutomationPredicate'); |
| 10 goog.provide('AutomationPredicate.Binary'); | 10 goog.provide('AutomationPredicate.Binary'); |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 return false; | 304 return false; |
| 305 | 305 |
| 306 // Ignore some roles. | 306 // Ignore some roles. |
| 307 return AutomationPredicate.leaf(node) && | 307 return AutomationPredicate.leaf(node) && |
| 308 (AutomationPredicate.roles([Role.client, | 308 (AutomationPredicate.roles([Role.client, |
| 309 Role.column, | 309 Role.column, |
| 310 Role.div, | 310 Role.div, |
| 311 Role.group, | 311 Role.group, |
| 312 Role.image, | 312 Role.image, |
| 313 Role.staticText, | 313 Role.staticText, |
| 314 Role.svgRoot, |
| 314 Role.tableHeaderContainer])(node)); | 315 Role.tableHeaderContainer])(node)); |
| 315 }; | 316 }; |
| 316 | 317 |
| 317 /** | 318 /** |
| 318 * Returns if the node has a meaningful checked state. | 319 * Returns if the node has a meaningful checked state. |
| 319 * @param {!AutomationNode} node | 320 * @param {!AutomationNode} node |
| 320 * @return {boolean} | 321 * @return {boolean} |
| 321 */ | 322 */ |
| 322 AutomationPredicate.checkable = AutomationPredicate.roles([ | 323 AutomationPredicate.checkable = AutomationPredicate.roles([ |
| 323 Role.checkBox, | 324 Role.checkBox, |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 * @param {number} level 1-6 | 414 * @param {number} level 1-6 |
| 414 * @return {AutomationPredicate.Unary} | 415 * @return {AutomationPredicate.Unary} |
| 415 */ | 416 */ |
| 416 AutomationPredicate.makeHeadingPredicate = function(level) { | 417 AutomationPredicate.makeHeadingPredicate = function(level) { |
| 417 return function(node) { | 418 return function(node) { |
| 418 return node.role == Role.heading && node.hierarchicalLevel == level; | 419 return node.role == Role.heading && node.hierarchicalLevel == level; |
| 419 }; | 420 }; |
| 420 }; | 421 }; |
| 421 | 422 |
| 422 }); // goog.scope | 423 }); // goog.scope |
| OLD | NEW |