Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aria-setsize="-1" is not consistently specified ... what is it actually for? #2346

Open
aleventhal opened this issue Oct 3, 2024 · 3 comments

Comments

@aleventhal
Copy link
Contributor

ARIA:

When specifying aria-setsize, authors MUST set the value to an integer equal to the number of items in the set. If the total number of items is unknown, authors SHOULD set the value of aria-setsize to -1.

This seems like bad or at least incomplete advice, the author does not need to pepper their content with aria-setsize="-1". The user agent will already automatically compute the setsize. As long as the DOM has all of the items, the UA can do this. Is the point of aria-setsize="-1" so that the user agent actually doesn't do this?

HTML-AAM (under aria-setsize):

If the author-provided value of aria-setsize is -1, the exposed value should be based on the number of objects in the DOM.
Object Attribute: setsize:value
State: STATE_INDETERMINATE if the author-provided value is -1
See also: Group Position

HTML-AAM (under group positon):

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.

The first part (under aria-setsize) indicates that -1 will cause an automatic computation based on the DOM objects (in which case why do we even have -1 as an option ... in that case the author could have just left it out). The second part (under group position) indicates that -1 will be converted to 1. This seems obviously wrong.

I'm genuinely confused about what aria-setsize="-1" is for.

@MelSumner
Copy link
Contributor

MelSumner commented Oct 3, 2024

What if the items are dynamically loaded though, the UA wouldn't know the total size yet.

I think the -1 is for situations where the items are perhaps in a virtualized list, and where the UI dev isn't the same one who knows about the data or does that part of the app code. Less common these days but def still exists.

WDYT?

@aleventhal
Copy link
Contributor Author

What you say makes sense. I guess -1 probably means we don't know how many items there will be but we don't want the UA to count them. However, I don't think the ARIA spec text does a good enough job of explaining this. And the CORE-ARIA mappings seem wrong and conflicting.

@scottaohara
Copy link
Member

I just made a pr to help move issues about this along last week

#2341

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants