dequelabs / axe-core

Accessibility engine for automated Web UI testing

Home Page:https://www.deque.com/axe/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

Zidious opened this issue · comments

commented

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

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