role-img-text-alternative-present

[role="img"/"graphics-symbol"/"graphics-document"] must have an accessible text alternative

automaticWCAG 1.1.1 (A)confidence: highseverity: seriousperceivable

Checks that elements with role="img", "graphics-symbol" or "graphics-document" provide an accessible text alternative using aria-label, aria-labelledby, a title attribute, or (for SVG elements) a first-child <title>.

Applies to. Applies to elements with role="img", role="graphics-symbol" or role="graphics-document" that are included in the accessibility tree (ACT 23a2a8's "programmatically hidden" exemption: display:none/visibility:hidden/aria-hidden="true" on the element or an ancestor, with no carve-out for focusable or IDREF-referenced elements, aria-hidden-focus and duplicate-id-aria own those separately). Per ACT 7d6734, this reaches any element carrying one of these roles, not only the <svg> root, e.g. a <circle role="graphics-symbol"> nested inside a plain <svg>. The <svg> root itself is left to svg-text-alternative-present's own (already ACT-clean) title/aria-name handling; the <img> tag is excluded here since it has its own dedicated rule.

Expectation. Each applicable element has an accessible text alternative:

  • aria-label with a non-empty value; OR
  • aria-labelledby referencing at least one existing element that contributes non-empty text; OR
  • a non-empty title attribute (last-resort accessible-name source per HTML-AAM); OR
  • for an SVG-namespace element, a non-empty first-child <title> (SVG-AAM's own naming mechanism, not only for the <svg> root).

Examples

pass
<span role="img" aria-label="Notifications"></span>

`aria-label` provides the text alternative.

fail
<span role="img">notifications</span>

Text content is not a valid name source for an element with an explicit role="img".

View source