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
tighten up rules for invalid use of aria-label and aria-labelledby #1334
ARIA in HTML has identified the HTML elements which share these roles, and in some cases, have no corresponding ARIA role but too should be prohibited from being named by authors. The following list of elements should flag an author error if aria-label or aria-labelledby are specified on them UNLESS a role which allows for naming is also specified.
Note: many of these roles already flag a warning for use of aria-label, but the message implies that if someone feels this is in error, to respond as such. These warnings, as well as other elements from the following list which are not presently flagged would need to flag an error for using these attributes without an explicit role which allows naming from authors.
Many of the following elements map to (generic) or no corresponding role - often which does not adequately support naming from author. Or, to roles which also explicitly prohibit naming from authors.
Does these same rules now also apply to use of aria-braillelabel and aria-brailleroledescription?
Though aria-braillelabel is ARIA 1.3: yes. It has the same restrictions on roles as aria-label, so aria-in-html's changes for ARIA 1.2 have the same effect for brailleLabel.
(I'm guessing you didn't mean brailleroledescription but something like brailleLabelledBy - which doesn't exist.)
Does these same rules now also apply to use of aria-braillelabel and aria-brailleroledescription?
Though aria-braillelabel is ARIA 1.3: yes. It has the same restrictions on roles as aria-label, so aria-in-html's changes for ARIA 1.2 have the same effect for brailleLabel.
OK, thanks
(I'm guessing you didn't mean brailleroledescription
Right
but something like brailleLabelledBy - which doesn't exist.)
The following list of elements should flag an author error if aria-label or aria-labelledby are specified on them UNLESS a role which allows for naming is also specified.
Can you please clarify exactly what “a role which allows for naming” means?
Does it just mean the role cannot be caption, code, deletion, emphasis, generic, insertion, paragraph, presentation, strong, subscript, or superscript?
If that’s not what it means, please instead either explicitly enumerate here exactly which roles allow naming, or else point me to somewhere else normative where I can find a single list of exactly what those roles are.
here's the newer issue about hgroup/address - #1626
maybe rp was a miss, or was clarified sometime in the years gap and i forgot to file an issue? thanks @pkra for helping out with clarifying this / yes the spec is at least all up to date for any gaps in the pr
<divclass=test-case><h3><code>footer</code> not scoped to <code>body</code></h3><article><footeraria-label="aria">fail</footer><footeraria-labelledby=name>fail</footer></article></div>
If not a descendant of an article, aside, main, nav or section element, or an element with role=article, complementary, main, navigation or region then role=contentinfo
all of the test cases are contained within a main element, so none of them are scoped to the body.
but, all of this will be moot, since within the last year there has been new roles created to replace the generic fallback roles for header and footer (sectionheader and sectionfooter) - so once this html aam PR lands (w3c/aria#2543) then header and footer will not have a name prohibited condition anymore, as both of their implicit roles will accept naming.
tldr; you probably want to ignore the conditions for header and footer since in the past 3.5 years things changed :D
Activity
pkra commentedon Oct 31, 2025
👍 for #1930
sideshowbarker commentedon Nov 6, 2025
Does these same rules now also apply to use of
aria-braillelabelandaria-brailleroledescription?pkra commentedon Nov 7, 2025
Though
aria-braillelabelis ARIA 1.3: yes. It has the same restrictions on roles as aria-label, so aria-in-html's changes for ARIA 1.2 have the same effect for brailleLabel.(I'm guessing you didn't mean
brailleroledescriptionbut something likebrailleLabelledBy- which doesn't exist.)sideshowbarker commentedon Nov 8, 2025
OK, thanks
Right
Yeah, I was just confused 😄
sideshowbarker commentedon Nov 8, 2025
Per https://w3c.github.io/html-aria/#el-rp,
rpis a “Naming prohibited” element, right?Is there a reason
rpisn’t included in the list in the issue description here, and not included in the tests at https://w3c.github.io/html-aria/tests/prohibit-names.html?sideshowbarker commentedon Nov 8, 2025
At https://w3c.github.io/html-aria/#el-address and https://w3c.github.io/html-aria/#el-hgroup and https://w3c.github.io/html-aria/#el-label, the ARIA in HTML spec doesn’t identify
address,hgroup, andlabelas “Naming prohibited” — yet, those elements are included in the list in the issue description here, and in the tests at https://w3c.github.io/html-aria/tests/prohibit-names.html.Is there something I’m missing, or does the ARIA in HTML spec need to be updated to identify those as “Naming prohibited”? Or what?
sideshowbarker commentedon Nov 8, 2025
Can you please clarify exactly what “a role which allows for naming” means?
Does it just mean the role cannot be
caption,code,deletion,emphasis,generic,insertion,paragraph,presentation,strong,subscript, orsuperscript?If that’s not what it means, please instead either explicitly enumerate here exactly which roles allow naming, or else point me to somewhere else normative where I can find a single list of exactly what those roles are.
pkra commentedon Nov 9, 2025
I think the confusion stems from the fact that Scott filed this issue in 2022 and the spec has evolved since then.
For example in 2023 there's w3c/html-aria#463 adjusting hgroup, address, rp and in 2024 w3c/html-aria#556 adjusts label.
I would recommend following the spec and seeking clarification on the spec tracker so the ARIA WG can help clarify.
scottaohara commentedon Nov 9, 2025
yup, that's exactly it.
here's the newer issue about hgroup/address - #1626
maybe rp was a miss, or was clarified sometime in the years gap and i forgot to file an issue? thanks @pkra for helping out with clarifying this / yes the spec is at least all up to date for any gaps in the pr
sideshowbarker commentedon Nov 9, 2025
I’m confused about the following test case:
…and the corresponding one for
header.Why is
failthe expected result for that?At https://w3c.github.io/html-aria/#el-footer the ARIA in HTML spec says:
So, what I see is:
footeris a descendant of anarticle.generic(but instead has the implicit rolecontentinfo).generic”.What am I misunderstanding?
scottaohara commentedon Nov 9, 2025
all of the test cases are contained within a
mainelement, so none of them are scoped to thebody.but, all of this will be moot, since within the last year there has been new roles created to replace the generic fallback roles for header and footer (sectionheader and sectionfooter) - so once this html aam PR lands (w3c/aria#2543) then header and footer will not have a name prohibited condition anymore, as both of their implicit roles will accept naming.
tldr; you probably want to ignore the conditions for header and footer since in the past 3.5 years things changed :D
sideshowbarker commentedon Nov 27, 2025
@pkra @scottaohara I’ve landed a change for this and pushed it to https://validator.w3.org/nu/
Please take a look there at and the changes in fb1bf7b and let me know what I missed.
feat: Emit errors for misuse of aria-label, aria-labelledby, and aria…