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

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

Issue 1435113003: Make use of new AX name calc in Chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix issue with ariaTextAlternative Created 5 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
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors_test.extjs » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 Classes related to cursors that point to and select parts of 6 * @fileoverview Classes related to cursors that point to and select parts of
7 * the automation tree. 7 * the automation tree.
8 */ 8 */
9 9
10 goog.provide('cursors.Cursor'); 10 goog.provide('cursors.Cursor');
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 /** 105 /**
106 * @return {number} 106 * @return {number}
107 */ 107 */
108 get index() { 108 get index() {
109 return this.index_; 109 return this.index_;
110 }, 110 },
111 111
112 /** 112 /**
113 * Gets the accessible text of the node associated with this cursor. 113 * Gets the accessible text of the node associated with this cursor.
114 * 114 *
115 * Note that only one of |name| or |value| attribute is ever nonempty on an
116 * automation node. If either contains whitespace, we still treat it as we do
117 * for a nonempty string.
118 * @param {!AutomationNode=} opt_node Use this node rather than this cursor's 115 * @param {!AutomationNode=} opt_node Use this node rather than this cursor's
119 * node. 116 * node.
120 * @return {string} 117 * @return {string}
121 */ 118 */
122 getText: function(opt_node) { 119 getText: function(opt_node) {
123 var node = opt_node || this.node_; 120 var node = opt_node || this.node_;
124 return node.name || node.value || ''; 121 return node.name || '';
125 }, 122 },
126 123
127 /** 124 /**
128 * Makes a Cursor which has been moved from this cursor by the unit in the 125 * Makes a Cursor which has been moved from this cursor by the unit in the
129 * given direction using the given movement type. 126 * given direction using the given movement type.
130 * @param {Unit} unit 127 * @param {Unit} unit
131 * @param {Movement} movement 128 * @param {Movement} movement
132 * @param {Dir} dir 129 * @param {Dir} dir
133 * @return {!cursors.Cursor} The moved cursor. 130 * @return {!cursors.Cursor} The moved cursor.
134 */ 131 */
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 case Unit.DOM_NODE: 429 case Unit.DOM_NODE:
433 newStart = newStart.move(unit, Movement.DIRECTIONAL, dir); 430 newStart = newStart.move(unit, Movement.DIRECTIONAL, dir);
434 newEnd = newStart; 431 newEnd = newStart;
435 break; 432 break;
436 } 433 }
437 return new cursors.Range(newStart, newEnd); 434 return new cursors.Range(newStart, newEnd);
438 } 435 }
439 }; 436 };
440 437
441 }); // goog.scope 438 }); // goog.scope
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors_test.extjs » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698