Dieser Inhalt ist derzeit nur auf Englisch verfügbar
Audit empty-heading
Ensure headings have discernible text
Impact:
Minor
WCAG-Konformität:
best-practice
Issue types:
failure, needs review
Heading has non-empty accessible name
This rule checks that each heading has a non-empty accessible name.
Content loading...
Autoren: Jean-Yves Moyen, Wilco Fiers
Finanzierung: WAI-Tools
Applicability
This rule applies to any HTML element that is a semanticheading, included in the accessibility tree.
Expectation
Each test target has a non-empty ("") accessible name.
Background
Completely empty headings (e.g., <h1></h1>) seem to be consistently ignored by assistive technologies. However, they fail Technique H42: Using h1-h6 to identify headings (by using heading markup for content which is not heading). Moreover, they may be rendered on screen (by breaking flow content, or because of custom styling), thus causing concerns for sighted users. Therefore, this rule also fails on these.
Assumptions
There are no assumptions.
Accessibility Support
Some assistive technologies may hide headings with empty accessible name from the users. This depends on the user agent, on how the accessible name was computed (the accessible name and description computation is not clear concerning which characters should be trimmed), and on the assistive technology itself. Hence, there are cases where the outcome of this rule is failed, but users of certain assistive technology and browser combinations will not experience an issue.
Implementation of Presentational Roles Conflict Resolution varies from one browser or assistive technology to another. Depending on this, some semanticheading elements can fail this rule with some technology but users of other technologies would not experience any accessibility issue because the same elements would have a semantic role of presentation and be hidden for these users.
The accessible name and description computation suggests that if an aria-labelledby attribute refers to an existing but empty element, the computation should stop and return an empty name without defaulting to the next steps. Several user agents and assistive technologies chose to use the next step in the computation in this case (ultimately defaulting to the content).
This h1 element has an empty accessible name given by its aria-label attribute. Its content is not exposed to assistive technologies, thus preventing the accessible name to default to the content.
This h1 element has an empty accessible name given by its aria-labelledby attribute. Its content is not exposed to assistive technologies, thus preventing the accessible name to default to the content.
This h1 element has an empty accessible name because the img element has a semantic role of presentation, and thus does not provide an accessible name to the h1 element. Note that the alt attribute does not trigger Presentational Roles Conflict Resolution because it is not an ARIA attribute.
This h1 element has an empty accessible name because the spaces and line break are trimmed by accessible name computation.
<h1><br /></h1>
Failed Example 6
This h1 element has an empty accessible name. It is nonetheless rendered by breaking the flow content, resulting in a confusing situation for sighted users.
<span>Hello</span><h1></h1><span>World!</span>
Failed Example 7
This div element with a semantic role of heading has an empty accessible name (and content). It is nonetheless rendered due to its styling, resulting in a confusing situation for sighted users.
This h1 element has an explicit role of none. However, the globalpropertyaria-label is specified. Thus it has a semantic role of heading due to Presentational Roles Conflict Resolution. It has an empty accessible name given by its aria-label attribute and the lack of accessible content to fallback to.