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

aria-label and aria-labelledby on name-prohibited roles should have clearer message #3205

Closed
Zidious opened this issue Oct 13, 2021 · 1 comment
Labels
pr A pr has been created for the issue rule metadata Issues in the rule metadata code (lib/rules)

Comments

@Zidious
Copy link
Contributor

Zidious commented Oct 13, 2021

Ref: dequelabs/axe-core-npm#275

As per the ARIA 1.2 spec some roles introduced Roles which cannot be named (Name prohibited) with aria-label and aria-labelledby. These roles include:

caption code deletion emphasis generic insertion paragraph presentation strong subscript superscript

Example provided: name-prohibited.html.

Note: it does flag as a violation but message is not clear.

  <div id="aria-label-1" role="code" aria-label="foo">bar</div>

Output:

Fix all of the following: ARIA attribute cannot be used, add a role attribute or use a different element: aria-label
  <code aria-label="foo">bar</code>

Output:

Fix all of the following: ARIA attribute is not well supported on the element and the text content will be used instead: aria-label
@straker straker added the rule metadata Issues in the rule metadata code (lib/rules) label Oct 13, 2021
@WilcoFiers WilcoFiers changed the title bug: aria-label and aria-labelledby on name-prohibited roles should be flagged as a violation aria-label and aria-labelledby on name-prohibited roles should have clearer message Oct 13, 2021
@straker
Copy link
Contributor

straker commented Oct 13, 2021

Will update the message to say that the attribute is not supported on the current role or element.

@Zidious Zidious added the pr A pr has been created for the issue label Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr A pr has been created for the issue rule metadata Issues in the rule metadata code (lib/rules)
Projects
None yet
Development

No branches or pull requests

3 participants