Commit c00939c5 authored by David Tseng's avatar David Tseng Committed by Chromium LUCI CQ

Omit selected value output for expanded <select>s in ChromeVox

R=akihiroota@chromium.org, josiahk@chromium.org

Fixed: 1161524
Test: existing browser_tests --gtest_filter=ChromeVox*.*Select*
Change-Id: I5c6e72b78bdcd7db829e67e712d8b7ce965b4de6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2602113Reviewed-by: default avatarAkihiro Ota <akihiroota@chromium.org>
Commit-Queue: David Tseng <dtseng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#839182}
parent 2eba819c
......@@ -276,7 +276,7 @@ TEST_F('ChromeVoxBackgroundTest', 'SelectSingleBasic', function() {
const mockFeedback = this.createMockFeedback();
this.runWithLoadedTree(this.formsDoc, function() {
mockFeedback.expectSpeech('apple', 'has pop up', 'Collapsed')
.expectBraille('apple btn +popup +')
.expectBraille('apple btn +popup +3 +')
.call(press(KeyCode.DOWN))
.expectSpeech('grape', /2 of 3/)
.expectBraille('grape 2/3')
......@@ -712,6 +712,7 @@ TEST_F('ChromeVoxBackgroundTest', 'SelectOptionSelected', function() {
const mockFeedback = this.createMockFeedback();
this.runWithLoadedTree(
`
<p>start</p>
<select>
<option>apple
<option>banana
......@@ -726,8 +727,10 @@ TEST_F('ChromeVoxBackgroundTest', 'SelectOptionSelected', function() {
options[options.length - 1].doDefault();
};
mockFeedback.call(clickSelect)
.expectSpeech('apple')
mockFeedback.call(doCmd('nextObject'))
.expectSpeech('Button', 'Press Search+Space to activate')
.call(clickSelect)
.expectNextSpeechUtteranceIsNot('apple')
.expectSpeech('Button')
.expectSpeech('Expanded')
.call(selectLastOption)
......
......@@ -155,8 +155,7 @@ Output = class {
return node.htmlAttributes['aria-posinset'] ||
(node.root.role !== RoleType.ROOT_WEB_AREA && node.posInSet);
case 'setSize':
return node.htmlAttributes['aria-setsize'] ||
(node.root.role !== RoleType.ROOT_WEB_AREA && node.setSize);
return node.htmlAttributes['aria-setsize'] || node.setSize;
// These attributes default to false for empty strings.
case 'roleDescription':
......@@ -2304,7 +2303,11 @@ Output.ROLE_INFO_ = {
note: {msgId: 'role_note', inherits: 'abstractContainer'},
progressIndicator:
{msgId: 'role_progress_indicator', inherits: 'abstractRange'},
popUpButton: {msgId: 'role_button', earconId: 'POP_UP_BUTTON'},
popUpButton: {
msgId: 'role_button',
earconId: 'POP_UP_BUTTON',
inherits: 'comboBoxMenuButton'
},
radioButton: {msgId: 'role_radio'},
radioGroup: {msgId: 'role_radiogroup', inherits: 'abstractContainer'},
region: {msgId: 'role_region', inherits: 'abstractContainer'},
......@@ -2484,8 +2487,9 @@ Output.RULES = {
},
client: {speak: `$name`},
comboBoxMenuButton: {
speak: `$name $value $node(activeDescendant)
$state $restriction $role $description`,
speak: `$name $if($collapsed, $value) $role @aria_has_popup
$if($setSize, @@list_with_items($setSize))
$state $restriction $description`,
},
date: {enter: `$nameFromNode $role $state $restriction $description`},
dialog: {enter: `$nameFromNode $role $description $textContent`},
......@@ -2575,12 +2579,6 @@ Output.RULES = {
$restriction $description`
},
paragraph: {speak: `$nameOrDescendants`},
popUpButton: {
speak: `$name $if($value, $value, $descendants) $role @aria_has_popup
$if($expanded, @@list_with_items($setSize)) $state $restriction
$if($posInSet, @describe_index($posInSet, $setSize))
$description`
},
radioButton: {
speak: `$if($checked, $earcon(CHECK_ON), $earcon(CHECK_OFF))
$if($checked, @describe_radio_selected($name),
......
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