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

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

Issue 2479593007: Expose images to accessibility (Closed)
Patch Set: 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
129 /**
130 * @param {!AutomationNode} node
131 * @return {boolean}
132 */
133 AutomationPredicate.image = function(node) {
134 return node.role == Role.image && !!(node.name || node.url);
135 };
136
127 /** @type {AutomationPredicate.Unary} */ 137 /** @type {AutomationPredicate.Unary} */
128 AutomationPredicate.linkOrControl = AutomationPredicate.match({ 138 AutomationPredicate.linkOrControl = AutomationPredicate.match({
129 anyPredicate: [ 139 anyPredicate: [
130 AutomationPredicate.control 140 AutomationPredicate.control
131 ], 141 ],
132 anyRole: [ 142 anyRole: [
133 Role.link 143 Role.link
134 ] 144 ]
135 }); 145 });
136 146
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 * @param {number} level 1-6 462 * @param {number} level 1-6
453 * @return {AutomationPredicate.Unary} 463 * @return {AutomationPredicate.Unary}
454 */ 464 */
455 AutomationPredicate.makeHeadingPredicate = function(level) { 465 AutomationPredicate.makeHeadingPredicate = function(level) {
456 return function(node) { 466 return function(node) {
457 return node.role == Role.heading && node.hierarchicalLevel == level; 467 return node.role == Role.heading && node.hierarchicalLevel == level;
458 }; 468 };
459 }; 469 };
460 470
461 }); // goog.scope 471 }); // goog.scope
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698