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

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

Issue 1998153004: ChromeVox shouldn't navigate to iframe or webview elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Made test more robust Created 4 years, 7 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 | chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_predicate.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_predicate.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_predicate.js
index 800957df29ca4bd9559ba6b8e051cb1ebc3e4bf0..2fd4821a20df7baf317f4c81b13d99a283f8294a 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_predicate.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_predicate.js
@@ -168,6 +168,21 @@ AutomationPredicate.leafDomNode = function(node) {
node.role == RoleType.staticText;
};
+
+/**
+ * Matches nodes that are containers that should be ignored during
+ * element navigation.
+ * @param {!AutomationNode} node
+ * @return {boolean}
+ */
+AutomationPredicate.ignoredContainer = function(node) {
+ return (node.role == RoleType.rootWebArea ||
+ node.role == RoleType.embeddedObject ||
+ node.role == RoleType.iframe ||
+ node.role == RoleType.iframePresentational ||
+ node.role == RoleType.embeddedObject);
+};
+
/**
* Matches against nodes visited during element navigation. An element as
* defined below, are all nodes that are focusable or static text. When used in
@@ -177,7 +192,10 @@ AutomationPredicate.leafDomNode = function(node) {
* @return {boolean}
*/
AutomationPredicate.element = function(node) {
- return (node.state .focusable && node.role != RoleType.rootWebArea) ||
+ if (AutomationPredicate.ignoredContainer(node))
+ return false;
+
+ return node.state.focusable ||
(AutomationPredicate.leafDomNode(node) &&
(/\S+/.test(node.name) ||
(node.role != RoleType.lineBreak &&
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698