SIA-R115Heading is descriptive

Accessibility requirements

This rule is not required for conformance to any accessibility requirements.

Description

This rule checks that headings describe the topic or purpose of the content.

Applicability

This rule applies to any element with a semantic role of heading that is included in the accessibility tree and has a non-empty (””) accessible name.

Expectations

  1. The target heading describes the topic or purpose of the first non-decorative perceivable content after it that is not decorative. The order of elements is determined by the flat tree.

Headings do not need to be lengthy. A word, or even a single character, may be sufficient.

Assumptions

This rule assumes that the flat tree order is close to the reading order as elements are rendered on the page. Due to positioning, it is possible to render a document in an order that greatly differs from the tree order, in which case the content which is visually associated with a heading might not be the content following it in tree order and this rule might fail while Success Criterion 2.4.6 Headings and Label is still satisfied.

This rule assumes that collapsible sections (e.g. accordions) are opened when evaluating it. Otherwise, relevant content might be non-[perceivable][] and the rule might fail while Success Criterion 2.4.6 Headings and Label is still satisfied.

Accessibility Support

This rule has no known accessibility support concerns.

Background

Headings that are visible but not in the accessibility tree are a failure of Success Criterion 1.3.1 Info and Relationships. These are not tested by this rule, but they can still fail Success Criterion 2.4.6 Headings and Labels.

Examples

Passed

This <h1> heading element describes the topic of the following paragraph.

<html lang="en">
    <h1>Opening Hours</h1>
    <p>We are open Monday through Friday from 10 to 16</p>
</html>

This element with an explicit role of heading describes the topic of the following paragraph.

<html lang="en">
    <span role="heading" aria-level="1">Opening Hours</span>
    <p>We are open Monday through Friday from 10 to 16</p>
</html>

This <h1> heading element has a single character text that describes the topic of the following description list.

<html lang="en">
    <h1>A</h1>
    <dl>
        <dt>airplane</dt>
        <dd>
            a powered flying vehicle with fixed wings and a weight greater than
            that of the air it displaces.
        </dd>
        <dt>apple</dt>
        <dd>
            the round fruit of a tree of the rose family, which typically has
            thin green or red skin and crisp flesh.
        </dd>
    </dl>
</html>

Failed

This <h1> heading element does not describe the topic of the following paragraph.

<html lang="en">
    <h1>Weather</h1>
    <p>We are open Monday through Friday from 10 to 16</p>
</html>

This element with an explicit role of heading does not describe the topic of the following paragraph.

<html lang="en">
    <span role="heading" aria-level="1">Weather</span>
    <p>We are open Monday through Friday from 10 to 16</p>
</html>

Inapplicable

There is no heading.

<html lang="en">
    <p>We are open Monday through Friday from 10 to 16</p>
</html>

This <h1> heading element is not included in the accessibility tree.

<html lang="en">
    <h1 hidden>Opening Hours</h1>
    <p>We are open Monday through Friday from 10 to 16</p>
</html>

This <h1> heading element has an empty accessible name.

<html lang="en">
    <h1></h1>
    <p>We are open Monday through Friday from 10 to 16</p>
</html>

Implementation details

The rule is semi-automated, asking users whether the heading describes the topic or purpose of the following content.

Acknowledgments

This document includes material copied from or derived from https://www.w3.org/WAI/standards-guidelines/act/rules/b49b2e/proposed/. Copyright © 2024 W3C® (MIT, ERCIM, Keio, Beihang).