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

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

Issue 2312353002: Revert of Add support for rich output inside of content editables. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@editable_nav
Patch Set: Created 4 years, 3 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 186
187 /** 187 /**
188 * Matches against nodes visited during object navigation. An object as 188 * Matches against nodes visited during object navigation. An object as
189 * 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
190 * 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
191 * non-focusable static text. 191 * non-focusable static text.
192 * @param {!AutomationNode} node 192 * @param {!AutomationNode} node
193 * @return {boolean} 193 * @return {boolean}
194 */ 194 */
195 AutomationPredicate.object = function(node) { 195 AutomationPredicate.object = function(node) {
196 // Editable nodes are within a text-like field and don't make sense when
197 // performing object navigation. Users should use line, word, or character
198 // navigation. Only navigate to the top level node.
199 if (node.parent && node.parent.state.editable)
200 return false;
201
196 return node.state.focusable || 202 return node.state.focusable ||
197 (AutomationPredicate.leafOrStaticText(node) && 203 (AutomationPredicate.leafOrStaticText(node) &&
198 (/\S+/.test(node.name) || 204 (/\S+/.test(node.name) ||
199 (node.role != RoleType.lineBreak && 205 (node.role != RoleType.lineBreak &&
200 node.role != RoleType.staticText && 206 node.role != RoleType.staticText &&
201 node.role != RoleType.inlineTextBox))); 207 node.role != RoleType.inlineTextBox)));
202 }; 208 };
203 209
204 /** 210 /**
205 * @param {!AutomationNode} first 211 * @param {!AutomationNode} first
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 * @param {number} level 1-6 409 * @param {number} level 1-6
404 * @return {AutomationPredicate.Unary} 410 * @return {AutomationPredicate.Unary}
405 */ 411 */
406 AutomationPredicate.makeHeadingPredicate = function(level) { 412 AutomationPredicate.makeHeadingPredicate = function(level) {
407 return function(node) { 413 return function(node) {
408 return node.role == RoleType.heading && node.hierarchicalLevel == level; 414 return node.role == RoleType.heading && node.hierarchicalLevel == level;
409 }; 415 };
410 }; 416 };
411 417
412 }); // goog.scope 418 }); // goog.scope
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698