Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(184)

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_predicate.js

Issue 2479593007: Expose images to accessibility (Closed)
Patch Set: A few more tests rebaselined. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 Role.disclosureTriangle, 117 Role.disclosureTriangle,
118 Role.menuItem, 118 Role.menuItem,
119 Role.menuItemCheckBox, 119 Role.menuItemCheckBox,
120 Role.menuItemRadio, 120 Role.menuItemRadio,
121 Role.menuListOption, 121 Role.menuListOption,
122 Role.scrollBar, 122 Role.scrollBar,
123 Role.tab 123 Role.tab
124 ] 124 ]
125 }); 125 });
126 126
127 /**
128 * @param {!AutomationNode} node
129 * @return {boolean}
130 */
131 AutomationPredicate.image = function(node) {
132 return node.role == Role.image && !!(node.name || node.url);
133 };
134
127 /** @type {AutomationPredicate.Unary} */ 135 /** @type {AutomationPredicate.Unary} */
128 AutomationPredicate.linkOrControl = AutomationPredicate.match({ 136 AutomationPredicate.linkOrControl = AutomationPredicate.match({
129 anyPredicate: [ 137 anyPredicate: [
130 AutomationPredicate.control 138 AutomationPredicate.control
131 ], 139 ],
132 anyRole: [ 140 anyRole: [
133 Role.link 141 Role.link
134 ] 142 ]
135 }); 143 });
136 144
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 * @param {number} level 1-6 460 * @param {number} level 1-6
453 * @return {AutomationPredicate.Unary} 461 * @return {AutomationPredicate.Unary}
454 */ 462 */
455 AutomationPredicate.makeHeadingPredicate = function(level) { 463 AutomationPredicate.makeHeadingPredicate = function(level) {
456 return function(node) { 464 return function(node) {
457 return node.role == Role.heading && node.hierarchicalLevel == level; 465 return node.role == Role.heading && node.hierarchicalLevel == level;
458 }; 466 };
459 }; 467 };
460 468
461 }); // goog.scope 469 }); // goog.scope
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698