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

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

Issue 1814633002: Restore focus when an automation node becomes invalidated. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/background.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
index 1a1bc5cf5ab85179e5840756ad457ee266f9aa89..ef6b8e9ecf0eb59cae0720ff9d39bb9f55f7259d 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
@@ -280,6 +280,15 @@ Background.prototype = {
if (!newRange)
return;
+ // Is the range invalid?
+ if (newRange.start.node.role === undefined ||
dmazzoni 2016/03/16 23:48:36 Consider ending an excursion if necessary?
David Tseng 2016/03/17 00:40:11 I don't think we want this. For example, in an inc
+ newRange.end.node.role === undefined) {
+ // Restore range to the focused location.
+ chrome.automation.getFocus(function(f) {
+ newRange = cursors.Range.fromNode(f);
+ });
+ }
+
if (!this.inExcursion_)
this.savedRange_ = new cursors.Range(newRange.start, newRange.end);
« 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