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

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

Issue 2945103002: Don't process text changes when ChromeVox range is elsewhere (Closed)
Patch Set: Re-target node for text handler creation. Created 3 years, 6 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 | 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 ae5450bd058ba0d9cbc3745eba90c460c48218b6..96f26359575e5de61c10c744038f74faea562e2a 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
@@ -415,7 +415,20 @@ DesktopAutomationHandler.prototype = {
cursors.Range.fromNode(evt.target));
}
- this.createTextEditHandlerIfNeeded_(evt.target);
+ // Re-target the node to the root of the editable.
+ var target = evt.target;
+ while (target.parent && target.parent.state.editable)
+ target = target.parent;
+ var voxTarget = ChromeVoxState.instance.currentRange.start.node;
+ while (voxTarget && voxTarget.parent && voxTarget.parent.state.editable)
+ voxTarget = voxTarget.parent;
+
+ // It is possible that ChromeVox has range over some other node
+ // when a text field is focused.
+ if (!target.state.focused || target != voxTarget)
+ return;
+
+ this.createTextEditHandlerIfNeeded_(target);
// Sync the ChromeVox range to the editable, if a selection exists.
var anchorObject = evt.target.root.anchorObject;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698