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

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

Issue 2079073002: Make ChromeVox Next a setting in options page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: m Created 4 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
Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js
index 82dec9cf54646f73909d11158ed5ceca74dd3fbd..af31d1710163a1a298ccdb96be15fd8a6ef05481 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js
@@ -314,7 +314,7 @@ cursors.Cursor.prototype = {
* @return {boolean}
*/
isValid: function() {
- return !!this.node && !!this.node.root;
+ return this.node != null;
}
};
@@ -555,10 +555,13 @@ cursors.Range.prototype = {
// Find the most common root.
var uniqueAncestors = AutomationUtil.getUniqueAncestors(start, end);
var mcr = start.root;
- if (uniqueAncestors)
- mcr = uniqueAncestors.pop().parent.root;
+ if (uniqueAncestors) {
+ var common = uniqueAncestors.pop().parent;
+ if (common)
+ mcr = common.root;
+ }
- if (mcr.role == RoleType.desktop)
+ if (!mcr || mcr.role == RoleType.desktop)
return;
if (mcr === start.root && mcr === end.root) {

Powered by Google App Engine
This is Rietveld 408576698