Skip to content

ARIA in HTML update for role allowances for button/input button elements #1543

Description

@scottaohara

ARIA in HTML (w3c/html-aria#446) is updating the role allowances for the button element, as well as input type=button, image, reset, submit. ARIA in HTML spec update preview.

This update serves two purposes:

  1. to add new role allowances to these elements - specifically treeitem, gridcell and slider. Each of these roles - if implemented correctly - can work just fine with the button element. Other potential accessibility gaps due to author implementation may be found via other existing automated or manual checks.
  2. The various input buttons were in misalignment with each other, as well as the button element. These input types now all have the same allowances as the button element. input type=reset, submit and image have been revised to allow all the same roles, but note that authors are NOT RECOMMENDED to use them. The reason for this is that the LOE of making a proper implementation of these roles, compared to using a button element or other element (like a div), is likely far greater than using these input types due to the limitations of their styling and content models, in comparison.

The full list of allowed roles for these elements now would be:
checkbox, combobox, gridcell, link, menuitem, menuitemcheckbox, menuitemradio, option, radio, slider, switch, tab, or treeitem. (button is also allowed, but NOT RECOMMENDED.)

The expectation here would be that all the allowed roles would no longer be exposed as errors or warnings.
For the input types (image, reset, submit) where roles are allowed but NOT RECOMMENDED, a warning message indicating that a more malleable HTML element, such as a <button> or <div> may be more appropriate to ease the development of the custom feature.

Test cases - button and input type=button tests and
input type=reset, image, submit tests

Activity

  1. pkra commented on Oct 31, 2025

    @pkra

    👍 for #1930

  2. sideshowbarker commented on Nov 6, 2025

    @sideshowbarker
    Member

    ah, in that https://w3c.github.io/html-aria/tests/button-input-button.html document, I just now noticed this:

    Expected result: These test cases would pass checks for an allowed role, but other failures would be expected as the elements are not contained or owned by their expected accessibility parents (gridcell or treeitem), or lack other expected properties required by authors (slider).

    After updating the schemas to allow role=gridcell, slider, treeitem on a button and input type=button elements, and testing with the document at https://w3c.github.io/html-aria/tests/button-input-button.html, I still get these errors:

    "file:/Users/mike/workspace/validator/button-input-button.html":71.6-71.27: error: An element with “role=gridcell” must be contained in, or owned by, an element with “role=row”.
    "file:/Users/mike/workspace/validator/button-input-button.html":72.6-72.27: error: An element with “role=treeitem” must be contained in, or owned by, an element with “role=tree” or “role=group”.
    "file:/Users/mike/workspace/validator/button-input-button.html":73.6-73.25: error: Element “button” is missing one or more of the following attributes: “aria-valuenow”, “type”.
    "file:/Users/mike/workspace/validator/button-input-button.html":113.6-113.60: error: An element with “role=gridcell” must be contained in, or owned by, an element with “role=row”.
    "file:/Users/mike/workspace/validator/button-input-button.html":114.6-114.60: error: An element with “role=treeitem” must be contained in, or owned by, an element with “role=tree” or “role=group”.
    "file:/Users/mike/workspace/validator/button-input-button.html":115.6-115.56: error: Element “input” is missing required attribute “aria-valuenow”.
    

    So, for example, is the rule for <button role=gridcell>role=gridcell</button> that it doesn’t need to be contained in, or owned by, an element with “role=row”?

    And is it not required to have “aria-valuenow” or “type”?

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions