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

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

Issue 2450093002: Read the selected text explicitly when focusing a texdt field (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
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js » ('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 ChromeVox utilities for the automation extension API. 6 * @fileoverview ChromeVox utilities for the automation extension API.
7 */ 7 */
8 8
9 goog.provide('AutomationUtil'); 9 goog.provide('AutomationUtil');
10 10
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 290
291 while (root && 291 while (root &&
292 root.parent && 292 root.parent &&
293 root.parent.root && 293 root.parent.root &&
294 root.parent.root.role != RoleType.desktop) { 294 root.parent.root.role != RoleType.desktop) {
295 root = root.parent.root; 295 root = root.parent.root;
296 } 296 }
297 return root; 297 return root;
298 }; 298 };
299 299
300 /**
301 * @param {!AutomationNode} prevNode
302 * @param {!AutomationNode} node
303 * @return {AutomationNode}
304 */
305 AutomationUtil.getLeastCommonAncestor = function(prevNode, node) {
306 if (prevNode == node)
307 return node;
308
309 var prevAncestors = AutomationUtil.getAncestors(prevNode);
310 var ancestors = AutomationUtil.getAncestors(node);
311 var divergence = AutomationUtil.getDivergence(prevAncestors, ancestors);
312 return ancestors[divergence - 1];
313 };
314
300 }); // goog.scope 315 }); // goog.scope
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698