Decorative element still exposed to assistive technology
aria/presentation-conflict
- WCAG success criterion
- 4.1.2 (level A)
- Outcome class
- Automatic. An automated check that can report a confirmed violation.
- Area
- Accessibility, Technical Robustness
- Default severity
- medium
- axe-core rule
aria/presentation-conflict
Why we flag this
Screen reader users meet an element the author meant to hide, without a name or purpose.
role=none/presentation or <img alt=""> with a global ARIA attribute or focusable, so the role is ignored.
What the rule checks
Scope. Elements in the accessibility tree marked as decorative: role none or presentation, or an img with an empty alt and no role.
Expectation. Fails when such an element carries a global ARIA attribute (aria-label, aria-labelledby, aria-describedby, ...) or is focusable: WAI-ARIA 1.2 then makes user agents ignore the presentational role, so what the author meant to hide is exposed and announced after all. Reported once, at the element. An attribute on a child does not count, and alt is not an ARIA attribute (an img with role presentation and a non-empty alt passes this rule). Elements not in the accessibility tree (hidden) are out of scope.
Source. WCAG 2.2 SC 4.1.2 Name, Role, Value and SC 1.3.1 Info and Relationships; WAI-ARIA 1.2 §9.3 Presentational Roles Conflict Resolution; HTML-AAM img with alt=""; ACT 46ca7f
Detection: shared; needs dom, ax_tree.
Failing example
The check reports a violation here. Corpus case aria_presentation_conflict, element div#toolbar. The page may contain further findings for other rules.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Your documents - Example cloud</title>
<style>
body { color: #111111; background: #ffffff; font-size: 16px; }
</style>
</head>
<body>
<header>
<a href="#main" style="display: inline-block; min-width: 44px; min-height: 44px; line-height: 44px; padding: 0 8px">Skip to main content</a>
<p>Example cloud</p>
<nav aria-label="Main"><a href="#main" aria-current="page" style="display: inline-block; min-width: 44px; min-height: 44px; line-height: 44px; padding: 0 8px">Overview</a></nav>
</header>
<main id="main">
<h1>Your documents</h1>
<!-- Marked as decorative, but a global ARIA attribute keeps it in the tree
(WAI-ARIA 1.2, Presentational Roles Conflict Resolution). -->
<div id="toolbar" role="presentation" aria-label="Document actions"><p>Three documents</p></div>
<!-- An empty alt maps to role presentation (HTML-AAM); aria-labelledby
brings it back. -->
<img id="logo" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" alt="" aria-labelledby="logo-label" width="40" height="40"><span hidden id="logo-label">Example cloud logo</span>
<!-- Focusable: the presentation role does not apply. -->
<p><span id="more" role="none" tabindex="0">More documents</span></p>
<!-- Children of a button are presentational (Children Presentational: True);
the focusable span inside gets no role or name for a screen reader. -->
<button id="save" type="button">Save <span role="button" tabindex="0" aria-label="Save options">▼</span></button>
<!-- Same with an explicit role: the link inside a checkbox. -->
<p><span id="terms" role="checkbox" aria-checked="false" tabindex="0">I accept the <a href="/terms">terms of use</a></span></p>
</main>
<footer><p>Footer text</p></footer>
</body>
</html>Passing example
The check passes here and reports nothing. Corpus case aria_presentation_valid. The page may contain further findings for other rules.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Your documents - Example cloud</title>
<style>
body { color: #111111; background: #ffffff; font-size: 16px; }
</style>
</head>
<body>
<header>
<a href="#main" style="display: inline-block; min-width: 44px; min-height: 44px; line-height: 44px; padding: 0 8px">Skip to main content</a>
<p>Example cloud</p>
<nav aria-label="Main"><a href="#main" aria-current="page" style="display: inline-block; min-width: 44px; min-height: 44px; line-height: 44px; padding: 0 8px">Overview</a></nav>
</header>
<main id="main">
<h1>Your documents</h1>
<!-- Decorative image without any global ARIA attribute. -->
<img id="divider" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" alt="" width="200" height="4">
<!-- The ARIA attribute sits on the child, not on the presentational element. -->
<div id="layout" role="presentation"><a href="/archive" aria-label="Archived documents">Archive</a></div>
<!-- Not in the accessibility tree: nothing to conflict with. -->
<img id="hidden-logo" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" alt="" hidden aria-label="Example cloud logo" width="40" height="40">
<!-- Two buttons side by side instead of one inside the other. -->
<button id="save" type="button">Save</button>
<button id="save-options" type="button" aria-label="Save options">▼</button>
<!-- A checkbox whose content is only text. -->
<p><span id="terms" role="checkbox" aria-checked="false" tabindex="0">I accept the terms of use</span> <a href="/terms">Read the terms of use</a></p>
<!-- Not rendered: no keyboard stop inside. -->
<div hidden><span id="hidden-terms" role="checkbox" aria-checked="false" tabindex="0">I accept the <a href="/privacy">privacy policy</a></span></div>
</main>
<footer><p>Footer text</p></footer>
</body>
</html>This page is generated from the rule catalogue and the rule contracts; see therule overview for how the outcome classes are derived.