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
Nested button elements are exposed inconsistently across browsers, and ARIA specifications don't fully align with HTML's native behavior. It's unclear whether this inconsistency is expected or not.
user agents SHOULD NOT include the following elements in the accessibility tree: ... Any descendants of elements that have the characteristic "Children Presentational: True" unless the descendant is not allowed to be presentational because it meets one of the conditions for exception described in Presentational Roles Conflict Resolution. However, the text content of any excluded descendants is included.
In this case, the inner button should be excluded because its ancestor has presentational children. The inner button doesn't fall under a roles conflict resolution exception. Although it has role="button", it is not focusable and thus is treated as presentational.
Browsers:
Chromium and Gecko expose the nested button role, but per specs the SHOULD NOT
WebKit ignores the button role, as per specs.
HTML version:
If an element is focusable, user agents MUST ignore the none/presentation role and expose the element with its implicit role, in order to ensure that the element is operable.
In this version, the nested button is focusable by default. Because it is focusable, it falls under the roles conflict resolution exception, and its role as a button is exposed.
Browsers:
Chromium and Gecko expose the button role, as per specs
WebKit ignores the button role, but per roles conflict resolution rule in ARIA specs, it shouldn't.
Given the above, is this inconsistent behavior between ARIA and native HTML expected and desired?
Note: I'll also open an issue in WPT related to this.
The text was updated successfully, but these errors were encountered:
Nested button elements are exposed inconsistently across browsers, and ARIA specifications don't fully align with HTML's native behavior. It's unclear whether this inconsistency is expected or not.
Example: https://codepen.io/Giacomo-Petri/pen/bNbrWxz
ARIA version
HTML + JS version
ARIA version and HTML+JS version behave inconsistently:
ARIA version: According to ARIA specs 7.1 Excluding Elements from the Accessibility Tree:
In this case, the inner button should be excluded because its ancestor has presentational children. The inner button doesn't fall under a roles conflict resolution exception. Although it has role="button", it is not focusable and thus is treated as presentational.
HTML version:
In this version, the nested button is focusable by default. Because it is focusable, it falls under the roles conflict resolution exception, and its role as a button is exposed.
Given the above, is this inconsistent behavior between ARIA and native HTML expected and desired?
Note: I'll also open an issue in WPT related to this.
The text was updated successfully, but these errors were encountered: