Skip to content

Conversation

scottaohara
Copy link
Member

@scottaohara scottaohara commented Sep 25, 2024

closes #1759
closes #2346
also closes w3c/core-aam#149

This PR adjusts the requirements for aria-setsize to fix the inconsistency between the ARIA and CORE AAM specs regarding the use of -1 as a value.

Test, Documentation and Implementation tracking

Once this PR has been reviewed and has consensus from the working group, tests should be written and issues should be opened on browsers. Add N/A and check when not applicable.


Preview | Diff

Copy link

netlify bot commented Sep 25, 2024

Deploy Preview for wai-aria ready!

Name Link
🔨 Latest commit 32e0608
🔍 Latest deploy log https://app.netlify.com/sites/wai-aria/deploys/67069cb8cf16df0009437f36
😎 Deploy Preview https://deploy-preview-2341--wai-aria.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

separates out aria-setsize from aria-posinset and aria-level - as the existing requirement of what to do with a 0 or -1 value made sense for the latter two attributes, but is what is causing the inconsistency for aria-setsize.

add new requirements for handling 0/-1 as an unknown/indeterminate size, and indicating user agents must not calculate a size if these values are used for setsize
@scottaohara scottaohara marked this pull request as ready for review September 25, 2024 14:58
scottaohara and others added 2 commits September 26, 2024 07:34
Co-authored-by: Melanie Sumner <melaniersumner@gmail.com>
Copy link
Contributor

@MelSumner MelSumner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to resolve the confusion, thank you!

@scottaohara
Copy link
Member Author

talking with @aleventhal about this some more, we should also add in what to do about if someone uses the empty string, or puts in literal "garbage" text strings.

So this can probably be
positive full numbers works as presently spec'd
0 and any negative number == indeterminate
anything else == undefined and thus ignore.

@aleventhal
Copy link
Contributor

So this can probably be positive full numbers works as presently spec'd 0 and any negative number == indeterminate anything else == undefined and thus ignore.

I know this is going to happen in a follow-up, but it's probably good if it's not too strict, e.g. spaces before and after the number are ok. I was going to do the following:

  1. Empty string or not present = undefined and thus ignore
  2. Pass it to a non-strict int conversion function, and comes back < 1, treat as follows:
    • aria-posinset or aria-level -> 1
    • aria-setsize -> -1 (indeterminate)

add that aria-setsize/posinset should also calculate value as if the attributes were not set, if they were provided the empty string.

clarify that aria-setsize should return indeterminate for any value set that is not a positive whole number
simplifying author's should back to just -1 for indeterminate.  core aam / User agents will be where other values are accounted for.
@scottaohara scottaohara requested a review from aleventhal October 9, 2024 15:10
@rahimabdi
Copy link
Contributor

@aleventhal @scottaohara Would this be important enough to flag a console message?

@aleventhal
Copy link
Contributor

setsize=-1 is really rare in my experience. I've never actually seen an example with it.
I'm not sure what/when the console message would be, but my quick answer based on prevalence is that it's not worth any code in the browser engine.

@spectranaut
Copy link
Contributor

@adampage to investigate the status of browsers w.r.t. this change and file issues if necessary

@spectranaut
Copy link
Contributor

Discussed in today's meeting: https://www.w3.org/2025/05/15-aria-minutes.html#ffff

@adampage
Copy link
Member

Hey all, I’ve finished investigating this and have published some results.

Some fun trivia:

  • Webkit reported a set size of 184346744073798551615 for some aria-setsize="-1 tests specimens.

  • article was the only role that exhibited no issues, seemingly on account of ignoring aria-setsize or aria-posinset altogether. Windows + Firefox + Narrator was the one exception.

  • The main browser repair techniques for calculating set size seem to be 1) reporting the actual number of DOM elements within the group, or 2) accepting the highest value reported by the author via aria-posinset.

  • Aside from repairing or misreporting the set size, many browser + AT combos also repaired or misreported each item’s stated position within the set.

The tl;dr is that every browser exhibits issues with both aria-setsize="0" and aria-setsize="-1" in relation to this PR. menuitem, option, and radio had the most.

cc: @scottaohara @spectranaut

@adampage
Copy link
Member

The PR checklist now has issue links for Webkit, Gecko, and Blink cc: @rahimabdi, @aleventhal, @jcsteh

@rahimabdi
Copy link
Contributor

An incredibly thorough investigation, thank you @adampage!

@spectranaut
Copy link
Contributor

Discussed briefly in today's meeting: https://www.w3.org/2025/05/29-aria-minutes.html#26c1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting for implementations Cannot be merged until there are two browser impls or one impl + impl commit

Projects

Status: Waiting For Implementation

8 participants