Open andrii-morozov opened 5 years ago
@andrii-morozov: Please list all browsers (incl. versions), where this issue occurs, by completely filling out the bug report draft. The NVDA and the Windows version are also missing. Thanks.
OS Name Microsoft Windows 10 Enterprise Version 10.0.17763 Build 17763
Browser Chrome: Version 75.0.3770.80 (Official Build) (64-bit) Firefox: 67.0.4 (64-bit
The same problem actually happens with Narrator as well. To be fair documentation is not explaining what behavior screen reader should have in this case though I would expect it to not announce total amount of items.
cc: @jcsteh maybe you have any suggestion here, I think there might be something else that detects the number of elements, not only aria setsize.
First, the test case provided typos aria-setsize as aria-sersize, so it shouldn't be used for testing until that is corrected. That said:
As per the spec, the browser calculates the position and number of items in the set when aria-posinset and aria-setsize aren't explicitly set. The spec does note that setsize -1 means unknown, but it's unclear what a browser is supposed to do in that case. Unknown could mean "browser should calculate this from the DOM", although that's probably superfluous given the author could just leave setsize unspecified. There's also this contradiction in the Core AAM
aria-level, aria-posinset, and aria-setsize are all 1-based. When the property is not present or is "0", it indicates the property is not computed or not supported. If any of these properties are specified by the author as either "0" or a negative number, user agents SHOULD use "1" instead.
It's also difficult to know how a screen reader should handle this. If posinset is specified but setsize isn't, what should be said? Just saying "4" isn't going to make any sense to the user.
Agreed that the spec (ARIA + Core-AAM) language should provide more specific and accurate guidance.
Regarding what the screen reader should say, FWIW here's what I landed yesterday in Orca:
cc: @scottaohara at least for the ARIA spec.
Steps to reproduce:
https://codepen.io/anon/pen/OexBwZ Create the listbox. Set the aria-setsize="-1" for option.
Actual behavior:
States the position of the option in the list. 1 of 4.
Expected behavior:
Doesn't state the position https://www.w3.org/TR/wai-aria-1.1/#aria-setsize Based on documentation setting aria-setsize to -1 indicates that amount of items is unknown.