Fix aria-label documentation, removing statement that says it should be used only for interactive items
Description
This change closes https://github.com/mdn/content/issues/28397, by changing the first paragraph of aria-label page, based on aria-label spec https://w3c.github.io/aria/#aria-label.
Motivation
There are noninteractive elements, such as List, Img, and Meter, that allow aria-label, and it's useful to have this context announced when using assistive technologies.
- https://w3c.github.io/aria/#list aria-label is present in "Inherited States and Properties"
- https://w3c.github.io/aria/#img aria-label is present in "Inherited States and Properties"
- https://w3c.github.io/aria/#meter aria-label is present in "Inherited States and Properties"
Additional details
The confusion might have appeared because there are multiple non interactive aria roles, which aria-label is forbidden:
Used in Roles: All elements of the base markup except for the following roles: caption, code, definition, deletion, emphasis, generic, insertion, mark, none, paragraph, strong, subscript, suggestion, superscript, term, time
Related issues and pull requests
https://github.com/mdn/content/issues/28397
Might make sense to explicitly mention aria-label can be used to name an element, so long as the elements implicit or explicit aria role doesn’t prohibit naming.
Listitem, for example being a role that is incorrectly not in the name prohibited category, but will be once the spec updates to correct this. But the other example, role=list or main, article, etc are all nameable roles/elements.
Preview URLs
(comment last updated: 2024-08-27 04:32:12)
@scottaohara I’ve addressed the feedback provided in the initial review of PR. Could you please take some time to re-review? Thanks in advance 🙂
Hi @scottaohara, thanks for your previous review. I applied the change you suggested https://github.com/mdn/content/pull/35465/commits/0ead6ef8737421e4323f290ef1d82952dec270a3
Would you mind taking another look when you have a moment? I really appreciate your time and effort in helping get this PR merged
Hi @scottaohara, just following up on this PR as it’s been a few weeks since my last re-review request. I’ve addressed the feedback, and would really appreciate it if you could take another look when you have time. Thanks again!
Perhaps @estelle could also review this, if @scottaohara could not