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

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

Issue 2164813003: Fix visible position calculation in accessible setSelection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert ChromeVox workaround and update test Created 4 years, 4 months 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698