About use 'aria-expanded' on 'role=menuitem'
Asked Answered
A

1

2

aria-expanded="bool" is not support attribute that role="menuitem".

Please refer to W3C HTML Document. (https://www.w3.org/TR/html/)

If use that, get markup error on Nu Html Checker. But when I create some menu widget I must use it. And W3C use the same way in the formula example:

What is right and what is wrong?

Aspirate answered 8/7, 2017 at 21:38 Comment(0)
E
0

As pointed out by the ARIA documentation

State and properties "Related Concepts", "Used in Roles", "Inherits into Roles" are Advisory information, but more important :

Use of a given state or property is not defined when used on roles other than those listed.

So, you have perfectly the right to use the aria-expanded on a role=menuitem element but the "Nu validator" is right as long as it emits a warning, not an error.

EDIT: HTML-ARIA documentation also specifies that section "3. Allowed ARIA roles, states and properties" is non-normative:

The following table provides an informative reference to the ARIA roles, states and properties permitted for use in HTML. All ARIA roles, states and properties are normatively defined in the ARIA 1.1 specification.

Eamon answered 9/7, 2017 at 8:10 Comment(3)
This is clearly indicated This section is non-normative., and clearly stated as informativeEamon
Sorry, we are talking about section "3. Allowed ARIA roles, states and properties" which is the only section defining "attributes applicable to the allowed roles" which you pointed out in your first comment. Section 2 only defines allowed roles and references that 3rd section for applicable attributes.Eamon
@sideshowbarker You perfectly understood my answer. Both ARIA and HTML specs clearly define "attributes applicable to the allowed roles" saying that this is advisory information, but they also say that this has unpredictable behavior. Please note that the ARIA group is in agreement that aria-expanded should be supported within menuitem roles (github.com/w3c/aria-practices/issues/145).Eamon

© 2022 - 2024 — McMap. All rights reserved.