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); |