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

Unified Diff: chrome/browser/resources/chromeos/switch_access/tree_walker.js

Issue 2818503002: Improved isInteresting heuristic, made more AutomationNodes focusable (Closed)
Patch Set: Created 3 years, 8 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/switch_access/tree_walker.js
diff --git a/chrome/browser/resources/chromeos/switch_access/tree_walker.js b/chrome/browser/resources/chromeos/switch_access/tree_walker.js
index ce8237d798caa62c4a6254fa95f20a4b5366199a..14bc04459aca2c88fee98d7fd45ded91feea371d 100644
--- a/chrome/browser/resources/chromeos/switch_access/tree_walker.js
+++ b/chrome/browser/resources/chromeos/switch_access/tree_walker.js
@@ -120,7 +120,25 @@ AutomationTreeWalker.prototype = {
* @private
*/
isInteresting_: function(node) {
- return node.state && node.state.focusable;
+ let loc = node.location;
+ let parent = node.parent;
+ let role = node.role;
+ let state = node.state;
+
+ // Skip things that are offscreen
+ if (state.offscreen || loc.top < 0 || loc.left < 0)
+ return false;
+
+ if (parent) {
+ // crbug.com/710559
+ // Work around for browser tabs
+ if (role === chrome.automation.RoleType.TAB
+ && parent.role === chrome.automation.RoleType.TAB_LIST)
David Tseng 2017/04/12 17:37:46 Note that these roles can occur in web pages as we
elichtenberg 2017/04/12 20:11:04 Done.
+ return true;
+ }
+
+ // The general rule that applies to everything.
+ return state.focusable;
},
/**

Powered by Google App Engine
This is Rietveld 408576698