Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify the semantic scope of the menu element #7562

Open
kantoche opened this issue Feb 1, 2022 · 1 comment
Open

Clarify the semantic scope of the menu element #7562

kantoche opened this issue Feb 1, 2022 · 1 comment
Labels
accessibility Affects accessibility

Comments

@kantoche
Copy link

kantoche commented Feb 1, 2022

The definition of a menu element is currently rather restrictive from the point of view of its semantic scope, since it is assimilated to a type of list which is only valid for a toolbar (https://html.spec.whatwg.org/multipage/grouping-content.html#the-menu-element).

However, from an accessibility point of view, if we look at the correspondence established in the ARIA in HTML specification (https://www.w3.org/TR/html-aria/#el-menu), the implicit ARIA semantics of a menu element is that of a list, but other roles can be associated with it: directory, group, listbox, menu, menubar, none, presentation, radiogroup, tablist, toolbar or tree. The toolbar role is therefore only one role among others.

So what is the coherence between the restricted scope of the current HTML specification and the extended scope proposed by WAI-ARIA?

@scottaohara
Copy link
Collaborator

@kantoche, I would submit your issue is more with understanding the scope of what the ARIA in HTML specification outlines, rather than needing clarification for the semantics of the menu element. Otherwise, your question would need to apply to every HTML element.

In reality, any ARIA role can be specified on any HTML element to overwrite its implicit ARIA semantics. ARIA in HTML is not proposing an extended scope for the semantics of HTML elements, but rather is identifying a more limited set of ARIA roles that most align with the semantics of the native HTML element. The limiting of allowed roles is to reduce potential author misuse in specifying roles that would more greatly conflict with the intended semantics for the HTML element.

Ideally, you would not choose an HTML element with specific semantics with the intent to override those semantics using ARIA. Use the HTML element as defined, and if you need something more malleable, use a <div>, <span>, or custom element which represent nothing without further authoring.

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

No branches or pull requests

3 participants