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 12c86cef50aee4b2c6f5c623e2fbb43371c5ea08..ca604c28a7a57f8198245f5888e8ab708694b13d 100644 |
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js |
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js |
@@ -214,14 +214,18 @@ Background.prototype = { |
if (!target) |
return ChromeVoxMode.CLASSIC; |
+ var root = target.root; |
+ if (root && this.isWhitelistedForCompat_(root.docUrl)) |
+ return ChromeVoxMode.COMPAT; |
+ |
// Closure complains, but clearly, |target| is not null. |
- var root = |
+ var topLevelRoot = |
AutomationUtil.getTopLevelRoot(/** @type {!AutomationNode} */(target)); |
- if (!root) |
+ if (!topLevelRoot) |
return ChromeVoxMode.COMPAT; |
- if (this.isWhitelistedForCompat_(root.docUrl)) |
+ if (this.isWhitelistedForCompat_(topLevelRoot.docUrl)) |
return ChromeVoxMode.COMPAT; |
- else if (this.isWhitelistedForNext_(root.docUrl)) |
+ else if (this.isWhitelistedForNext_(topLevelRoot.docUrl)) |
return ChromeVoxMode.NEXT; |
else |
return ChromeVoxMode.CLASSIC; |