Commit 8df74b5f authored by Anastasia Helfinstein's avatar Anastasia Helfinstein Committed by Commit Bot

[Switch Access] Remove work around for browser tabs

Also ensures that non-browser tabs are treated as web elements, not
browser tabs.

Unblocks crbug.com/1131689

AX-Relnotes: n/a.
Bug: None.
Change-Id: Ic841403a07941804e1605169ab0e6db481de4d42
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2429844Reviewed-by: default avatarAkihiro Ota <akihiroota@chromium.org>
Commit-Queue: Anastasia Helfinstein <anastasi@google.com>
Cr-Commit-Position: refs/heads/master@{#810737}
parent 2a5e5c40
...@@ -214,7 +214,10 @@ class BasicNode extends SAChildNode { ...@@ -214,7 +214,10 @@ class BasicNode extends SAChildNode {
case chrome.automation.RoleType.SLIDER: case chrome.automation.RoleType.SLIDER:
return new SliderNode(baseNode, parent); return new SliderNode(baseNode, parent);
case chrome.automation.RoleType.TAB: case chrome.automation.RoleType.TAB:
return TabNode.create(baseNode, parent); if (baseNode.root.role === RoleType.DESKTOP) {
return TabNode.create(baseNode, parent);
}
// else, fall through to default case
default: default:
return new BasicNode(baseNode, parent); return new BasicNode(baseNode, parent);
} }
......
...@@ -38,7 +38,6 @@ const SwitchAccessPredicate = { ...@@ -38,7 +38,6 @@ const SwitchAccessPredicate = {
const defaultActionVerb = node.defaultActionVerb; const defaultActionVerb = node.defaultActionVerb;
const loc = node.location; const loc = node.location;
const parent = node.parent; const parent = node.parent;
const root = node.root;
const role = node.role; const role = node.role;
const state = node.state; const state = node.state;
...@@ -60,18 +59,9 @@ const SwitchAccessPredicate = { ...@@ -60,18 +59,9 @@ const SwitchAccessPredicate = {
return false; return false;
} }
if (parent) {
// crbug.com/710559
// Work around for browser tabs.
if (role === RoleType.TAB && parent.role === RoleType.TAB_LIST &&
root.role === RoleType.DESKTOP) {
cache.isActionable.set(node, true);
return true;
}
}
// Check various indicators that the node is actionable. // Check various indicators that the node is actionable.
if (role === RoleType.BUTTON || role === RoleType.SLIDER) { if (role === RoleType.BUTTON || role === RoleType.SLIDER ||
role === RoleType.TAB) {
cache.isActionable.set(node, true); cache.isActionable.set(node, true);
return true; return true;
} }
......
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