| 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 * Non-inline textbox nodes which have an equivalent in the DOM. | 171 * Non-inline textbox nodes which have an equivalent in the DOM. |
| 172 * @param {!AutomationNode} node | 172 * @param {!AutomationNode} node |
| 173 * @return {boolean} | 173 * @return {boolean} |
| 174 */ | 174 */ |
| 175 AutomationPredicate.leafDomNode = function(node) { | 175 AutomationPredicate.leafDomNode = function(node) { |
| 176 return AutomationPredicate.leaf(node) || | 176 return AutomationPredicate.leaf(node) || |
| 177 node.role == RoleType.staticText; | 177 node.role == RoleType.staticText; |
| 178 }; | 178 }; |
| 179 | 179 |
| 180 /** | 180 /** |
| 181 * Matches against all nodes that have selectable text. |
| 182 * @param {!AutomationNode} node |
| 183 * @return {boolean} |
| 184 */ |
| 185 AutomationPredicate.text = function(node) { |
| 186 return node.role == RoleType.staticText || |
| 187 node.role == RoleType.lineBreak; |
| 188 }; |
| 189 |
| 190 /** |
| 181 * Matches against nodes visited during object navigation. An object as | 191 * Matches against nodes visited during object navigation. An object as |
| 182 * defined below, are all nodes that are focusable or static text. When used in | 192 * defined below, are all nodes that are focusable or static text. When used in |
| 183 * tree walking, it should visit all nodes that tab traversal would as well as | 193 * tree walking, it should visit all nodes that tab traversal would as well as |
| 184 * non-focusable static text. | 194 * non-focusable static text. |
| 185 * @param {!AutomationNode} node | 195 * @param {!AutomationNode} node |
| 186 * @return {boolean} | 196 * @return {boolean} |
| 187 */ | 197 */ |
| 188 AutomationPredicate.object = function(node) { | 198 AutomationPredicate.object = function(node) { |
| 189 return node.state.focusable || | 199 return node.state.focusable || |
| 190 (AutomationPredicate.leafDomNode(node) && | 200 (AutomationPredicate.leafDomNode(node) && |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 * @return {boolean} | 306 * @return {boolean} |
| 297 */ | 307 */ |
| 298 AutomationPredicate.checkable = function(node) { | 308 AutomationPredicate.checkable = function(node) { |
| 299 return node.role == RoleType.checkBox || | 309 return node.role == RoleType.checkBox || |
| 300 node.role == RoleType.radioButton || | 310 node.role == RoleType.radioButton || |
| 301 node.role == RoleType.menuItemCheckBox || | 311 node.role == RoleType.menuItemCheckBox || |
| 302 node.role == RoleType.menuItemRadio; | 312 node.role == RoleType.menuItemRadio; |
| 303 }; | 313 }; |
| 304 | 314 |
| 305 }); // goog.scope | 315 }); // goog.scope |
| OLD | NEW |