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

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

Issue 1458463002: Add some missing null checks in chromevox next. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 1 month 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/background.js ('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 49c4416d8d3725eca09a7b4c40db6b6770bb1b8c..dd3c4ffeb14cb01bdc560c8be3ccff33f645bd34 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
@@ -67,7 +67,7 @@ DesktopAutomationHandler.prototype = {
// Check to see if we've crossed roots. Continue if we've crossed roots or
// are not within web content.
- if (node.root.role == 'desktop' ||
+ if (node.root.role == RoleType.desktop ||
!prevRange ||
prevRange.start.node.root != node.root)
global.backgroundObj.refreshMode(node.root.docUrl || '');
@@ -128,7 +128,8 @@ DesktopAutomationHandler.prototype = {
if (node.role == RoleType.rootWebArea) {
// Discard focus events for root web areas when focus was previously
// placed on a descendant.
- if (global.backgroundObj.currentRange.start.node.root == node)
+ var currentRange = global.backgroundObj.currentRange;
+ if (currentRange && currentRange.start.node.root == node)
return;
// Discard focused root nodes without focused state set.
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698