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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
271 | 271 |
272 /** | 272 /** |
273 * Matches against a node that contains other interesting nodes. | 273 * Matches against a node that contains other interesting nodes. |
274 * These nodes should always have their subtrees scanned when navigating. | 274 * These nodes should always have their subtrees scanned when navigating. |
275 * @param {!AutomationNode} node | 275 * @param {!AutomationNode} node |
276 * @return {boolean} | 276 * @return {boolean} |
277 */ | 277 */ |
278 AutomationPredicate.container = function(node) { | 278 AutomationPredicate.container = function(node) { |
279 return AutomationPredicate.match({ | 279 return AutomationPredicate.match({ |
280 anyRole: [ | 280 anyRole: [ |
281 Role.DIV, | 281 Role.GENERIC_CONTAINER, |
dmazzoni
2017/06/02 19:55:24
Why didn't the compile fail when DIV was removed?
David Tseng
2017/06/02 21:34:34
No, it has to do with the externs not being re-gen
michaelpg
2017/06/03 00:01:35
Add automation.idl to api_pair_names: https://cs.c
| |
282 Role.DOCUMENT, | 282 Role.DOCUMENT, |
283 Role.GROUP, | 283 Role.GROUP, |
284 Role.LIST_ITEM, | 284 Role.LIST_ITEM, |
285 Role.TOOLBAR, | 285 Role.TOOLBAR, |
286 Role.WINDOW], | 286 Role.WINDOW], |
287 anyPredicate: [ | 287 anyPredicate: [ |
288 AutomationPredicate.landmark, | 288 AutomationPredicate.landmark, |
289 AutomationPredicate.structuralContainer, | 289 AutomationPredicate.structuralContainer, |
290 function(node) { | 290 function(node) { |
291 // For example, crosh. | 291 // For example, crosh. |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
365 return true; | 365 return true; |
366 | 366 |
367 // Don't ignore nodes with names or name-like attribute. | 367 // Don't ignore nodes with names or name-like attribute. |
368 if (node.name || node.value || node.description || node.url) | 368 if (node.name || node.value || node.description || node.url) |
369 return false; | 369 return false; |
370 | 370 |
371 // Ignore some roles. | 371 // Ignore some roles. |
372 return AutomationPredicate.leaf(node) && | 372 return AutomationPredicate.leaf(node) && |
373 (AutomationPredicate.roles([Role.CLIENT, | 373 (AutomationPredicate.roles([Role.CLIENT, |
374 Role.COLUMN, | 374 Role.COLUMN, |
375 Role.DIV, | 375 Role.GENERIC_CONTAINER, |
376 Role.GROUP, | 376 Role.GROUP, |
377 Role.IMAGE, | 377 Role.IMAGE, |
378 Role.STATIC_TEXT, | 378 Role.STATIC_TEXT, |
379 Role.SVG_ROOT, | 379 Role.SVG_ROOT, |
380 Role.TABLE_HEADER_CONTAINER, | 380 Role.TABLE_HEADER_CONTAINER, |
381 Role.UNKNOWN | 381 Role.UNKNOWN |
382 ])(node)); | 382 ])(node)); |
383 }; | 383 }; |
384 | 384 |
385 /** | 385 /** |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
491 * Matches against nodes that we may be able to retrieve image data from. | 491 * Matches against nodes that we may be able to retrieve image data from. |
492 * @param {!AutomationNode} node | 492 * @param {!AutomationNode} node |
493 * @return {boolean} | 493 * @return {boolean} |
494 */ | 494 */ |
495 AutomationPredicate.supportsImageData = AutomationPredicate.roles([ | 495 AutomationPredicate.supportsImageData = AutomationPredicate.roles([ |
496 Role.CANVAS, | 496 Role.CANVAS, |
497 Role.IMAGE, | 497 Role.IMAGE, |
498 Role.VIDEO]); | 498 Role.VIDEO]); |
499 | 499 |
500 }); // goog.scope | 500 }); // goog.scope |
OLD | NEW |