Screen readers do not correctly read selected <select> options if there are multiple text nodes in the <option>
Categories
(Core :: Disability Access APIs, defect)
Tracking
()
People
(Reporter: me, Unassigned)
References
(Blocks 1 open bug)
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36
Steps to reproduce:
Create a <select> with an <option> inside of it, and append more than one text node to the <option>: https://codepen.io/pzuraq/pen/PoNLmor
On Windows, select an option while a screen reader, such as NVDA, is enabled.
Actual results:
The screen reader reads out that a combobox was collapsed, and reads out the first text node of the selected option. If the first text node is empty, nothing is read.
Expected results:
The screen reader should read out that a combobox was collapsed, and the full text of the selected option.
Comment 1•4 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Comment 2•4 years ago
|
||
Confirmed. Nasty, but probably rare.
This is caused by this 17+ year old code (originally landed in bug 124452!), which didn't anticipate this case:
https://searchfox.org/mozilla-central/rev/f27594d62e7f1d57626889255ce6a3071d67209f/accessible/html/HTMLSelectAccessible.cpp#124
I wonder if we can use nsTextEquivUtils::GetNameFromSubtree instead of explicitly getting the first text node? We have to be a little careful though because HTMLSelectOptGroupAccessible inherits from HTMLSelectOptionAccessible and we don't want optgroups to get name from subtree.
Updated•4 years ago
|
Comment 3•2 years ago
|
||
Updated•2 years ago
|
Description
•