You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ARIA in HTML update for role allowances for button/input button elements #1543
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.
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.
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).
"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”?
Activity
pkra commentedon Oct 31, 2025
👍 for #1930
sideshowbarker commentedon Nov 6, 2025
ah, in that https://w3c.github.io/html-aria/tests/button-input-button.html document, I just now noticed this:
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: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”?feat: Allow buttons to have role=treeitem, gridcell and slider
feat: Update for role allowances for button/input button