Skip to content

posinset/setsize for radiogroups #598

In review
w3c/aria
#2919

Description

@slender789

Given:

<input name=test type=radio>radio1</input>
<input name=test type=radio>radio2</input>
<input name=test type=radio>radio3</input>
<input name=test type=radio>radio4</input>
<input name=test type=radio>radio5</input>
<input name=test type=radio>radio6</input>

html AAM says
"With aria-setsize value reflecting number of type=radio input elements within the radio button group and aria-posinset value reflecting the elements position within the radio button group."

The radio button group is defined by the html standard:

  • The input element b's type attribute is in the Radio Button state.
  • Either a and b have the same form owner, or they both have no form owner.
  • Both a and b are in the same tree.
  • They both have a name attribute, their name attributes are not empty, and the value of a's name attribute equals the value of b's name attribute.

Now, given:

<div role="radiogroup">
  <input name=test type=radio>radio1</input>
  <input name=test type=radio>radio2</input>
  <input name=test type=radio>radio3</input>
</div>
<div role="radiogroup">
  <input name=test type=radio>radio4</input>
  <input name=test type=radio>radio5</input>
  <input name=test type=radio>radio6</input>
</div>

neither html AAM nor core AAM give any guidance.

Should the role=radiogroup alter the computation of posinset/setsize by treating them as two isolated radiogroups?

Activity

  1. JAWS-test commented on Feb 18, 2026

    @JAWS-test

    ARIA roles override HTML roles, so in your second example, role=radiogroup should take precedence when determining the radio button group.

  2. scottaohara commented on Feb 18, 2026

    @scottaohara
    Member

    What’s the use case for this?

    Treating them as separate seems like a bad idea, since they’re all associated with each other.

    But also, going off the example markup alone, without accname the radiogroups are likely to be ignored anyway. So….

  3. slender789 commented on Feb 23, 2026

    @slender789
    Author

    @JAWS-test about aria overriding html, my concern is radio button groups are not roles in html but instead a concept in html defined by the listed criteria above.

    @scottaohara (context)[https://g-issues.chromium.org/issues/40919211]
    I also agree that if we were to treat the example as two separate, the developer would have to override native radio button keyboard behaviors.

    What I think we're looking for is the documentation stating the precise means by which (radiogroup)[https://www.w3.org/TR/core-aamz-1.2/#role-map-radiogroup] overrides the computation of radio button group, e.g. role radiogroup overrides the posinset/setsize computation for html radio button groups.

  4. slender789 commented on Apr 7, 2026

    @slender789
    Author

    .

  5. spectranaut commented on Sep 9, 2026

    @spectranaut
    Contributor

    I think we should make clear that ARIA role="radiogroups" can not overwrite html "radio groups" for the same reason aria-checked can't override HTML checkbox states on an HTML checkbox.

    But I'm not sure where to specify that -- maybe here? https://www.w3.org/TR/html-aria/#docconformance-attr

    Putting on the ARIA WG agenda.

  6. spectranaut commented on Sep 9, 2026

    @spectranaut
    Contributor

    Also I tested that markup using named role=radiogroup on Chrome, Firefox and Safari -- all of them respect the HTML grouping and ignore the ARIA radiogroup.

  7. spectranaut commented on Sep 22, 2026

    @spectranaut
    Contributor

    Can we also somewhere forbid the mixing of role=radio with native html radios?

  8. css-meeting-bot commented on Sep 24, 2026

    @css-meeting-bot
    Member

    The ARIA Working Group just discussed posinset/setsize for radiogroups.

    The full IRC log of that discussion <Zakim> agendum 5 -- -> posinset/setsize for radiogroups https://github.com//issues/598 -- taken up [from agendabot]
    <front-endian-jane> zakim, next item
  9. daniel-montalvo commented on Sep 24, 2026

    @daniel-montalvo
    Contributor

    The ARIA Working Group just discussed Add explicit language and direction metadata to AriaNotificationOptions, and agreed to the following:

    • RESOLUTION: aria radiogroups and named input radios should not mix and we can add an AUTHORS must, but need to consider browser repair for named radiogroups (demote to named group)
    The full IRC log of that discussion <Zakim> agendum 4 -- -> Add explicit language and direction metadata to AriaNotificationOptions https://github.com/w3c/aria/pull/2869 -- taken up [from agendabot]
    <front-endian-jane> spectranaut_: We wanted to give people reminders to review this one, but it has a number of reviews now
    <front-endian-jane> Daniel: It should be ready to merge now
    <front-endian-jane> zakim, next item
    <Zakim> agendum 4 was just opened, front-endian-jane
    <front-endian-jane> zakim, close this item
    <Zakim> agendum 4 closed
    <Zakim> I see 6 items remaining on the agenda; the next one is
    <Zakim> 5. -> posinset/setsize for radiogroups https://github.com//issues/598 [from agendabot]
    <front-endian-jane> spectranaut_: There are a few radiogroup issues from me trying to fix issues in Chrome. HTML radio buttons are associated by name, ARIA ones are associated by being in the same radiogroup. This issue was made by someone else but I want to get a resolution
    <Matt_King> q+
    <front-endian-jane> ... I think we shouldn't mix HTML and ARIA radios. there is an example in this issue which shows a mix of the two, but I think ARIA radiogroups shouldn't apply to HTML, and the name wouldn't work for ARIA radio groups.
    <jamesn> q+
    <front-endian-jane> Brian: I think this looks good.
    <spectranaut_> ack Matt_King
    <front-endian-jane> front-endian-jane: If this is how it works in currently in browsers, that seems okay.
    <front-endian-jane> spectranaut_: There are bugs and inconsistencies in browsers and I want to be able to tell them that those are bugs.
    <front-endian-jane> Matt_King: So if HTML elements are used, the radiogroup would not be added to the accessibility tree?
    <front-endian-jane> spectranaut_: Are there ever real world examples of radios without names?
    <front-endian-jane> jamesn: I've often seen it for things like controlling tab stops and selecting in tables. If they don't have a name you should be able to mix them, though I'm not sure why someone would do that.
    <front-endian-jane> Matt_King: What if someone had a group with only one name?
    <front-endian-jane> Matt_King: I'd recommend if any children have name, ignore the radio-group.
    <front-endian-jane> s/radio-group/radiogroup/
    <front-endian-jane> front-endian-jane: Could that break any sites?
    <siri> q
    <jamesn> Ack me
    <front-endian-jane> Matt_King: The radiogroup acts as bookends, so it shouldn't break things in terms of user experience in the real world.
    <siri> q-
    <front-endian-jane> front-endian-jane: There was a CSS bug with fieldsets for a long time, so people may have used radiogroups as the label for those.
    <front-endian-jane> Matt_King: What if in that case the radiogroup becomes a group so the browser isn't changing the way the radio group works but the label remains?
    <front-endian-jane> spectranaut_: I like that suggestion
    <front-endian-jane> spectranaut_: So we shouldn't be mixing radiogroups with HTML elements and that would be an author suggestion. Browsers which see a radiogroup around a group containing one or more names would treat it as a group.
    <front-endian-jane> Matt_King: Browser implementors would have to make sure that is reasonable.
    <front-endian-jane> spectranaut_: The current mix of bugs is already unreasonable, so we need a fix.
    <giacomo-petri> q+
    <spectranaut_> ack giacomo-petri
    <front-endian-jane> giacomo-petri: Let's double check if this applies to other roles like checkbox too.
    <spectranaut_> RESOLUTION: aria radiogroups and named input radios should not mix and we can add an AUTHORS must, but need to consider browser repair for named radiogroups (demote to named group)
    <front-endian-jane> zakim, next item
  10. self-assigned this
    on Sep 24, 2026
  11. spectranaut commented on Sep 25, 2026

    @spectranaut
    Contributor

    Putting agenda on so we don't forget to discuss the PR on html-aria: w3c/html-aria#604

  12. SaekiTominaga commented on Sep 26, 2026

    @SaekiTominaga

    Since the aria-invalid or aria-errormessage properties cannot be specified on the <fieldset> element, role=radiogroup is sometimes set instead.

    <fieldset role="radiogroup" aria-invalid="true" aria-errormessage="validation-sex">
    	<legend>Sex</legend>
    
    	<p>
    		<label><input type="radio" name="sex" required> Male</label>
    		<label><input type="radio" name="sex" required> Female</label>
    		<label><input type="radio" name="sex" required> Neither</label>
    	</p>
    
    	<p role="alert" id="validation-sex"></p>
    </fieldset>

    In this case, it would be problematic if a mix of role=radiogroup and named input radios were prohibited.

  13. spectranaut commented on Sep 28, 2026

    @spectranaut
    Contributor

    Hi @SaekiTominaga, thanks for that valid use case. I've closed the PR that adds the author requirement, and instead just explained what browser should do in html-aam: w3c/aria#2919

    My main concern is making clear that the existence of radiogroup does not effect the posinset/setsize calculation of named inputs, regardless of where an author wants to put a radiogroup. So no author requirement is really needed.

  14. spectranaut commented on Sep 29, 2026

    @spectranaut
    Contributor

    To further go into odd edge cases about set position calculations when mixing html radios and aria radios, I made this example: https://spectranaut.github.io/examples/aria/aria-html-radio-grouping.html

    The examples are:

    • A: Radiogroup with two HTML radios with the same name, then two ARIA radios.
    • B: Radiogroup with two HTML radios with no name, then two ARIA radios.
    • C: No radiogroup container. Two HTML radios with no name, then two ARIA Radios.

    Current testing on the browsers:

    Safari:

    • A: Html radios are "1 of 2" etc, aria radios are "3 of 4" etc (grouped with html radios)
    • B: Html radios have no set position announcements, aria radios are "group 3 of 4" etc (grouped with html radios)
    • C: No set position announced for any.

    Firefox:

    • A: Html radios are "1 of 2" etc, aria radios are "3 of 4" etc (grouped with html radios)
    • B: Html radios have no set position announcements, aria radios are "3 of 4" etc (group with html radios)
    • C: No set position announced for any.

    Chrome proposed (see the code):

    • A: Html radios are "1 of 2" etc, aria radios are "group 1 of 2" etc (grouped on their own)
    • B: All radios have set position "X of 4"
    • C: No set position announced? On the otherhand, grouping by neighbors could be a reasonable fallback.

    fwii, Chrome's current calculation is buggy on top of being different than current Safari and Firefox, and is:

    • A: Html radios are "1 of 2" etc, aria radios are "3 of 4" etc (grouped with html radios)
    • B: Html radios are "1 of 4" etc BUT are grouped with the last to radio inputs in the page, in example "C", aria radios are "3 of 4" etc (grouped with html radios in this example)
    • C:: Html radios are "3 of 4" etc BUT are grouped with the last two radio inputs in the page, in example "C", aria radios have not set position announcement.
  15. css-meeting-bot commented on Oct 8, 2026

    @css-meeting-bot
    Member

    The ARIA Working Group just discussed posinset/setsize for radiogroups.

    The full IRC log of that discussion <Zakim> agendum 7 -- -> posinset/setsize for radiogroups https://github.com//issues/598 -- taken up [from agendabot]
    <pkra> scribe+
    <pkra> spectranaut_: we discussed it a while back and the resolution had issues.
    <pkra> ... ARIA cannot really override what native name does. I have a PR that says that.
    <pkra> ... when working on this in Chrome, we have some edge cases that Chrome handles oddly and Firefox and Safari don't handle either.
    <jamesn> https://github.com//issues/598#issuecomment-5897576293
    <pkra> ... there are 3 examples about missing HTML and ARIA radios.
    <pkra> ... first one mixes HTML radios with name and ARIA radios.
    <pkra> ... second one, without named radios and two ARIAs.
    <pkra> ... third, without any
    <pkra> ... turns out that browser group first one together but confusingly.
    <Rahim> q+
    <pkra> ... so I'm proposing to separate them.
    <pkra> ... jamie said that Firefox groups them by neighbors. But not on Mac, probably because mac APIs are a little different.
    <pkra> ... I have a PR for Chrome. It's somewhat of a browser repair. I'm wondering what people think.
    <jamesn> Ack Rahim
    <front-endian-jane> q+
    <jcraig> q+
    <pkra> Rahim: why might this be allowed? Why not follow the order of elements.
    <pkra> spectranaut_: I think it's reasonable to allow it. I think we should allow grouping of nameless native radios.
    <pkra> ... it can provide native functionality.
    <pkra> Rahim: would it visually not be the same?
    <pkra> spectranaut_: if you get to grouped-by-name, they are connected for keyboard grouping. I think we should try to match.
    <pkra> ... grouping from name should be preserved. The other ARIA radios in case 1 should be a separate group. But browsers announce group of 4.
    <jcraig> q+ to ask if we're considering 1. bikeshed aria-grouping, and 2. whether radiogroup can work more like optgroup on native radios
    <scott> q+
    <pkra> Rahim: what if radios are not next to each other?
    <jamesn> Ack front-endian-jane
    <pkra> spectranaut_: in case 1 and 2 it doesn't matter if they're next to each other. Just a parent radiogroup.
    <pkra> front-endian-jane: don't radios get grouped together by siblings in firefox?
    <pkra> spectranaut_: that's what Jamie said but I found it's not no Mac.
    <pkra> front-endian-jane: radio buttons get used as check-only checkboxes.
    <pkra> spectranaut_: ok. I don't know.
    <jamesn> Ack jcraig
    <Zakim> jcraig, you wanted to ask if we're considering 1. bikeshed aria-grouping, and 2. whether radiogroup can work more like optgroup on native radios
    <pkra> front-endian-jane: Right. We should allow people to group but giving people a way to break grouping seems dangerous.
    <pkra> jcraig: I remember seeing an "aria grouping" proposed somewhere.
    <pkra> ... which seems reasonable to consider.
    <pkra> ... also, when you have 2 groups around multiple native radios with same name, we could consider them more like opt-groups. The group's name might be announced but maybe it's not important enough.
    <jamesn> Ack scott
    <pkra> ... but I don't want to conflict with decades of how radios work and have always worked. The rest seems doable.
    <pkra> scott: re the first example, I agree with Val. Mixing native and aria radios as a single group doesn't mean they work as they're supposed to. It doesn't seem worthwhile. Authors can force it if they need that complexity.
    <pkra> ... but grouping has so much cases of breaking where suddenly we get 1-of-1 announcements. It's very messy and needs improvements.
    <pkra> jamesn: seconding that.
    <jcraig> Test the Web Forward!
    <pkra> spectranaut_: chrome was also broken in ways where Firefox and Safari agreed so I want to be sure we find agreement.
    <pkra> ... Chrome is broken in a bad way though. And I'd like to fix it better in general.
    <pkra> jamesn: can we test this with the new properties bag?
    <jamesn> q?
    <pkra> jcraig: there's probably smarter ways of doing things. We chose content attributes but there are smarter ways now.
    <pkra> spectranaut_: ok. jcraig, rahim, could you take a look at my chrome proposal? And object if need be?
    <pkra> jamesn: and let's ping jamie
    <pkra> spectranaut_: we could try to get a group decision but I'm not sure where to resolve it.
    <pkra> jamesn: it's not illegal, right?
    <pkra> spectranaut_: no we just need to fix it
    <jamesn> agenda?
    <pkra> zakim, next item
  16. cookiecrook commented on Oct 8, 2026

    @cookiecrook
    Collaborator

    ℹ️ Summary below generated by Claude at my request to join and lay out the linked examples with the explanations and results above. May be updated/corrected.

    Example A — Radiogroup with two HTML radios with the same name, then two ARIA radios.

    <div class="radiogroup" role="radiogroup" aria-label="Pet Names">
      <input type="radio" name="cat" value="ursula" id="ursula" checked>
      <label for="ursula">Ursula</label>
      <input type="radio" name="cat" value="maynard" id="maynard">
      <label for="maynard">Maynard</label>
      <button role="radio">Fido</button>
      <button role="radio">Scout</button>
    </div>
    Safari (current) Firefox (current) Chrome (current) @spectranaut proposal (Chrome PR)
    HTML radios are "1 of 2" etc; ARIA radios are "3 of 4" etc (grouped with HTML radios). HTML radios are "1 of 2" etc; ARIA radios are "3 of 4" etc (grouped with HTML radios). HTML radios are "1 of 2" etc; ARIA radios are "3 of 4" etc (grouped with HTML radios). HTML radios are "1 of 2" etc; ARIA radios are "group 1 of 2" etc (grouped on their own).

    Example B — Radiogroup with two HTML radios with no name, then two ARIA radios.

    <div class="radiogroup" role="radiogroup" aria-label="Pet Names">
      <input type="radio" value="biz" id="biz" checked>
      <label for="biz">Biz</label>
      <input type="radio" value="baz" id="baz">
      <label for="baz">Baz</label>
      <button role="radio">Foo</button>
      <button role="radio">Bar</button>
    </div>
    Safari (current) Firefox (current) Chrome (current) @spectranaut proposal (Chrome PR)
    HTML radios have no set position announcements; ARIA radios are "group 3 of 4" etc (grouped with HTML radios). HTML radios have no set position announcements; ARIA radios are "3 of 4" etc (grouped with HTML radios). HTML radios are "1 of 4" etc BUT grouped with the last two radio inputs on the page (in example C); ARIA radios are "3 of 4" etc (grouped with HTML radios in this example). All radios have set position "X of 4".

    Example C — No radiogroup container. Two HTML radios with no name, then two ARIA radios.

    <div>
      <input type="radio" value="biz" id="biz2" checked>
      <label for="biz2">Biz</label>
      <input type="radio" value="baz" id="baz2">
      <label for="baz2">Baz</label>
      <button role="radio">Foo</button>
      <button role="radio">Bar</button>
    </div>
    Safari (current) Firefox (current) Chrome (current) @spectranaut proposal (Chrome PR)
    No set position announced for any. No set position announced for any. HTML radios are "3 of 4" etc BUT grouped with the last two radio inputs on the page (in example C); ARIA radios have no set position announcement. No set position announced? On the other hand, grouping by neighbors could be a reasonable fallback.
  17. spectranaut commented on Oct 8, 2026

    @spectranaut
    Contributor

    I want to emphasize that @front-endian pointed out that we shouldn't group radios based on direct neighbors, because there isn't anyway to ungroup them.

  18. cookiecrook commented on Oct 9, 2026

    @cookiecrook
    Collaborator

    My hot takes:

    • Example A: Since the engines are already aligned, let's keep them as-is.
    • Example B: I'm torn on this one, but I think your proposal makes sense.
    • Example C: Align Chromium with the already-aligned WebKit/Gecko. (aligns with @front-endian's concern)

    PS. @spectranaut I hope my Claude data pivot represents your examples accurately. I needed to see it shifted/combined to better understand the issues.

  19. spectranaut commented on Oct 9, 2026

    @spectranaut
    Contributor

    @cookiecrook and I talked a little bit more about this, and mainly differ on what to do for the Example A

    Basically, with this markup:

    <div class="radiogroup" role="radiogroup" aria-label="Pet Names">
            <input type="radio" name="cat" value="ursula" id="ursula" checked>
            <label for="ursula">Ursula</label>
            <input type="radio" name="cat" value="maynard" id="maynard">
            <label for="maynard">Maynard</label>
            <button role="radio">Fido</button>
            <button role="radio">Scout</button>
    </div>
    

    I believe the working group agrees that the first two inputs are grouped together because of the name attribute -- at the moment, in a conflict between radiogroups and named inputs, the name grouping wins in the browser in every situation. So I think we can assume we are keeping the announcement of the first two radios as:

    • [1 of 2]
    • [2 of 2]

    But the second two buttons are ARIA radios, so what is the set of radios they belong to? Do we ignore the already grouped input radios?

    Right now all the browsers announce this for the ARIA radios:

    • [3 of 4]
    • [4 of 4]

    My first instinct was to change them to be in their own set, basically, when calculating sets of radios using role=radiogroup, ignore all the HTML input with a name, because those inputs follow a different grouping mechanism. That would lead the browser to announce the following for the ARIA radios:

    • [1 of 2]
    • [2 of 2]

    @cookiecrook brought up the fact that this will change what browsers already agree on, so we need a really good reason to change it. Do we have a good enough reason? Questions:

    • Is it an author error to put input radios with a name in a radiogroup.....?
    • If its not an author error, how should we interpret this scenario?
    • What do users want in this scenario?
  20. spectranaut commented on Nov 12, 2026

    @spectranaut
    Contributor
  21. spectranaut commented on Dec 3, 2026

    @spectranaut
    Contributor

    Deep dive discussion topics

    Problem: Right now, the AAMs do not explain how to expose the grouping information on groups of radios. By grouping information, I mean, the setsize and posinset: when a radio is read out as "1 of 3, 2 of 3". ARIA and related specs also do not make clear whether ARIA radiogroups can group html input radios.

    Topic 1: about grouping radios based on being children of the same parent (without radiogroups)

    There has been talk about radios being grouped based on whether they are neighbors -- that change was made in chrome but that code is buggy so we've been fixing it. From my testing, no browser actually does this (Firefox doesn't seem to group based on neighbors).

    Topic 2: I'd like to get consensus on whether radiogroups can group html input radios:

    Proposal:

    1. radiogroups cannot override the name-grouping of HTML input radios
    2. radiogroups CAN group HTML input radios without a name

    Note: this is a change, because it doesn't seem like browsers currently allow this, and it has never been specified whether radiogroups can effect html input radios.

    Topic 3: what should browsers do when html input radios and ARIA radios are mixed?

    Example A and B here: https://spectranaut.github.io/examples/aria/aria-html-radio-grouping.html

    I think, if we agree with the proposal above:

    In example A:

    • The first two radios should be grouped together (html input radios with the same name)
    • The second two radios should be grouped together (aria radios in the same radiogroup)
    • This is different then what browsers currently do.

    In example B:

    • All radios should be grouped together
    • This is different what browsers do
  22. spectranaut commented on Dec 4, 2026

    @spectranaut
    Contributor

    We reached some resolutions from the deep dive: https://www.w3.org/2026/12/03-aria-dive-minutes.html

    I'll update the spec PR (w3c/aria#2919) and make a PR against ARIA in HTML.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions