| 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 * already entered into an inline textbox. | 178 * already entered into an inline textbox. |
| 179 * @param {!AutomationNode} node | 179 * @param {!AutomationNode} node |
| 180 * @return {boolean} | 180 * @return {boolean} |
| 181 */ | 181 */ |
| 182 AutomationPredicate.leafOrStaticText = function(node) { | 182 AutomationPredicate.leafOrStaticText = function(node) { |
| 183 return AutomationPredicate.leaf(node) || | 183 return AutomationPredicate.leaf(node) || |
| 184 node.role == RoleType.staticText; | 184 node.role == RoleType.staticText; |
| 185 }; | 185 }; |
| 186 | 186 |
| 187 /** | 187 /** |
| 188 * Matches against all nodes that have selectable text. | |
| 189 * @param {!AutomationNode} node | |
| 190 * @return {boolean} | |
| 191 */ | |
| 192 AutomationPredicate.text = function(node) { | |
| 193 return node.role == RoleType.staticText || | |
| 194 node.role == RoleType.lineBreak; | |
| 195 }; | |
| 196 | |
| 197 /** | |
| 198 * Matches against nodes visited during object navigation. An object as | 188 * Matches against nodes visited during object navigation. An object as |
| 199 * defined below, are all nodes that are focusable or static text. When used in | 189 * defined below, are all nodes that are focusable or static text. When used in |
| 200 * tree walking, it should visit all nodes that tab traversal would as well as | 190 * tree walking, it should visit all nodes that tab traversal would as well as |
| 201 * non-focusable static text. | 191 * non-focusable static text. |
| 202 * @param {!AutomationNode} node | 192 * @param {!AutomationNode} node |
| 203 * @return {boolean} | 193 * @return {boolean} |
| 204 */ | 194 */ |
| 205 AutomationPredicate.object = function(node) { | 195 AutomationPredicate.object = function(node) { |
| 206 return node.state.focusable || | 196 return node.state.focusable || |
| 207 (AutomationPredicate.leafOrStaticText(node) && | 197 (AutomationPredicate.leafOrStaticText(node) && |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 colIndex = dir == Dir.FORWARD ? colIndex + 1 : colIndex - 1; | 387 colIndex = dir == Dir.FORWARD ? colIndex + 1 : colIndex - 1; |
| 398 | 388 |
| 399 return function(node) { | 389 return function(node) { |
| 400 return AutomationPredicate.cellLike(node) && | 390 return AutomationPredicate.cellLike(node) && |
| 401 node.tableCellColumnIndex == colIndex && | 391 node.tableCellColumnIndex == colIndex && |
| 402 node.tableCellRowIndex == rowIndex; | 392 node.tableCellRowIndex == rowIndex; |
| 403 }; | 393 }; |
| 404 }; | 394 }; |
| 405 | 395 |
| 406 }); // goog.scope | 396 }); // goog.scope |
| OLD | NEW |