Commit a2dbce17 authored by Anastasia Helfinstein's avatar Anastasia Helfinstein Committed by Commit Bot

[Switch Access] Always identify the onscreen keyboard

This change checks if the node is a keyboard before checking if it's
a window, fixing the attached bugs.

AX-Relnotes: n/a.
Bug: 1120730, 1120734
Change-Id: I57fe00ec8c805bb887ed67a743cf8181cf1291cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2369612
Commit-Queue: Anastasia Helfinstein <anastasi@google.com>
Reviewed-by: default avatarAbigail Klein <abigailbklein@google.com>
Cr-Commit-Position: refs/heads/master@{#801235}
parent 29765fea
...@@ -356,12 +356,12 @@ class RootNodeWrapper extends SARootNode { ...@@ -356,12 +356,12 @@ class RootNodeWrapper extends SARootNode {
* @return {!RootNodeWrapper} * @return {!RootNodeWrapper}
*/ */
static buildTree(rootNode) { static buildTree(rootNode) {
if (SwitchAccessPredicate.isWindow(rootNode)) {
return WindowRootNode.buildTree(rootNode);
}
if (rootNode.role === chrome.automation.RoleType.KEYBOARD) { if (rootNode.role === chrome.automation.RoleType.KEYBOARD) {
return KeyboardRootNode.buildTree(); return KeyboardRootNode.buildTree();
} }
if (SwitchAccessPredicate.isWindow(rootNode)) {
return WindowRootNode.buildTree(rootNode);
}
const root = new RootNodeWrapper(rootNode); const root = new RootNodeWrapper(rootNode);
const childConstructor = (node) => NodeWrapper.create(node, root); const childConstructor = (node) => NodeWrapper.create(node, root);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment