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

Unified Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js

Issue 2195343003: Support navigation within editable nodes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors_test.extjs ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js
index 84b6cdcd6f630af435e147ac8dd6665fb03b8f28..bafccde71b42f6697fd976cb259b42ee6912db70 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js
@@ -326,6 +326,21 @@ DesktopAutomationHandler.prototype = {
}
this.createTextEditHandlerIfNeeded_(evt.target);
+
+ // Sync the ChromeVox range to the editable, if a selection exists.
+ var anchorObject = evt.target.root.anchorObject;
+ var anchorOffset = evt.target.root.anchorOffset;
+ var focusObject = evt.target.root.focusObject;
+ var focusOffset = evt.target.root.focusOffset;
+ if (anchorObject && focusObject) {
+ var selectedRange = new cursors.Range(
+ new cursors.WrappingCursor(anchorObject, anchorOffset),
+ new cursors.WrappingCursor(focusObject, focusOffset));
+
+ // Sync ChromeVox range with selection.
+ ChromeVoxState.instance.setCurrentRange(selectedRange);
+ }
+
// TODO(plundblad): This can currently be null for contenteditables.
// Clean up when it can't.
if (this.textEditHandler_)
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors_test.extjs ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698