Rampsight

All rules

ARIA

aria-roledescription needs a role to describe

Why it matters

The attribute replaces the spoken name of a role. On an element with no role there is nothing to replace, so it is dropped and the custom wording never reaches anyone.

How to fix it

  1. Add an explicit role to the element before describing it.
  2. Keep the description short and in the page language — it is read out every time.
  3. Do not rename a familiar role for decoration: "Slide" helps, "Fancy box" does not.

In markup

Fails
<div aria-roledescription="Slide">...</div>
Passes
<div role="group" aria-roledescription="Slide" aria-label="1 of 5">...</div>

The requirement behind it

This rule is one way of failing the following WCAG 2.2 success criteria. The W3C, which writes the standard, explains each of them:

Further reading

Deque University on aria-roledescription (opens in new tab)

Deque maintains axe-core, the open-source engine our scanner runs. Their page documents the rule as the engine implements it.

Automated checks find failures a browser can prove. They cannot judge whether a caption is accurate, whether an alt text is useful, or whether a page can be operated end to end with a keyboard — those need a person.