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

Unified 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, 2 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_util.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_util.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_util.js
index 416806c3c6d1e607bd784b9bdcf010889ba571a8..4778e0f69b1d55726851c9f93ed9286731225d34 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_util.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_util.js
@@ -297,4 +297,19 @@ AutomationUtil.getTopLevelRoot = function(node) {
return root;
};
+/**
+ * @param {!AutomationNode} prevNode
+ * @param {!AutomationNode} node
+ * @return {AutomationNode}
+ */
+AutomationUtil.getLeastCommonAncestor = function(prevNode, node) {
+ if (prevNode == node)
+ return node;
+
+ var prevAncestors = AutomationUtil.getAncestors(prevNode);
+ var ancestors = AutomationUtil.getAncestors(node);
+ var divergence = AutomationUtil.getDivergence(prevAncestors, ancestors);
+ return ancestors[divergence - 1];
+};
+
}); // goog.scope
« 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