Commit 755a7096 authored by Anastasia Helfinstein's avatar Anastasia Helfinstein Committed by Commit Bot

[Switch Access] Make Chrome menu openable again

The Chrome menu (the three dots at the right of the omnibar) stopped
being openable recently, because it shows up as a combo box. Modify
the combo box behavior to allow for some elements detected as combo
boxes to not be combo boxes.

This is a temporary fix; the long-term fix is to properly populate
the location for combo box pop-up windows.

AX-Relnotes: n/a.
Bug: 1106529
Change-Id: Ica0494ce85246abb73efb899d15abad38d700ebb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2300982
Commit-Queue: Anastasia Helfinstein <anastasi@google.com>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#791477}
parent 4147e914
......@@ -9,12 +9,13 @@
class ComboBoxNode extends NodeWrapper {
/** @override */
get actions() {
return [SwitchAccessMenuAction.INCREMENT, SwitchAccessMenuAction.DECREMENT];
const actions = super.actions;
if (!actions.includes(SwitchAccessMenuAction.INCREMENT) &&
!actions.includes(SwitchAccessMenuAction.DECREMENT)) {
actions.push(
SwitchAccessMenuAction.INCREMENT, SwitchAccessMenuAction.DECREMENT);
}
/** @override */
doDefaultAction() {
this.performAction(SwitchAccessMenuAction.INCREMENT);
return actions;
}
/** @override */
......@@ -26,8 +27,8 @@ class ComboBoxNode extends NodeWrapper {
/** @override */
performAction(action) {
// The box of options that typically pops up with combo boxes is not
// currently represented in the automation tree, so we work around that by
// selecting a value without opening the pop-up, using the up and down
// currently given a location in the automation tree, so we work around that
// by selecting a value without opening the pop-up, using the up and down
// arrows.
switch (action) {
case SwitchAccessMenuAction.DECREMENT:
......@@ -37,6 +38,6 @@ class ComboBoxNode extends NodeWrapper {
EventHelper.simulateKeyPress(EventHelper.KeyCode.DOWN_ARROW);
return SAConstants.ActionResponse.REMAIN_OPEN;
}
return SAConstants.ActionResponse.NO_ACTION_TAKEN;
return super.performAction(action);
}
}
......@@ -119,9 +119,6 @@ const SwitchAccessPredicate = {
if (node.state[StateType.INVISIBLE]) {
return false;
}
if (AutomationPredicate.comboBox(node)) {
return false;
}
if (node.role === chrome.automation.RoleType.KEYBOARD) {
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