| 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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 AutomationPredicate.shouldIgnoreNode = function(node) { | 265 AutomationPredicate.shouldIgnoreNode = function(node) { |
| 266 // Ignore invisible nodes. | 266 // Ignore invisible nodes. |
| 267 if (node.state.invisible || | 267 if (node.state.invisible || |
| 268 (node.location.height == 0 && node.location.width == 0)) | 268 (node.location.height == 0 && node.location.width == 0)) |
| 269 return true; | 269 return true; |
| 270 | 270 |
| 271 // Ignore structural containres. | 271 // Ignore structural containres. |
| 272 if (AutomationPredicate.structuralContainer(node)) | 272 if (AutomationPredicate.structuralContainer(node)) |
| 273 return true; | 273 return true; |
| 274 | 274 |
| 275 // Ignore list markers since we already announce listitem role. |
| 276 if (node.role == RoleType.listMarker) |
| 277 return true; |
| 278 |
| 275 // Don't ignore nodes with names. | 279 // Don't ignore nodes with names. |
| 276 if (node.name || node.value || node.description) | 280 if (node.name || node.value || node.description) |
| 277 return false; | 281 return false; |
| 278 | 282 |
| 279 // Ignore some roles. | 283 // Ignore some roles. |
| 280 return AutomationPredicate.leaf(node) && | 284 return AutomationPredicate.leaf(node) && |
| 281 (node.role == RoleType.client || | 285 (node.role == RoleType.client || |
| 282 node.role == RoleType.div || | 286 node.role == RoleType.div || |
| 283 node.role == RoleType.group || | 287 node.role == RoleType.group || |
| 284 node.role == RoleType.image || | 288 node.role == RoleType.image || |
| 285 node.role == RoleType.staticText); | 289 node.role == RoleType.staticText); |
| 286 }; | 290 }; |
| 287 | 291 |
| 288 }); // goog.scope | 292 }); // goog.scope |
| OLD | NEW |