Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 2 additions & 20 deletions _rules/heading-descriptive-b49b2e.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Each target element describes the topic or purpose of the first [perceivable con

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

Testing tools treat empty headings `<h1></h1>` or `div role="heading" aria-level="1"></div>` differently. Some fail empty headings under 1.3.1, others under 2.4.6, others pass these headings because they are ignored by most assistive technologies, not causing accessibility barriers at all. This rule doesn't include examples of empty headings because there is currently no harmonized approach for testing them.

### 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][sc246] is still satisfied.
Expand Down Expand Up @@ -215,26 +217,6 @@ This `h1` heading element is not [included in the accessibility tree][].
</html>
```

#### Inapplicable Example 3

This `h1` heading element has an empty [accessible name][].

```html
<html lang="en">
<h1></h1>
</html>
```

#### Inapplicable Example 4

Semantic heading has an empty [accessible name][].

```html
<html lang="en">
<p role="heading" aria-level="1"></p>
</html>
```

[decorative]: https://www.w3.org/TR/WCAG22/#dfn-pure-decoration 'WCAG definition of Pure decoration'
[flat tree]: https://drafts.csswg.org/css-scoping/#flat-tree 'Definition of flat tree'
[included in the accessibility tree]: #included-in-the-accessibility-tree 'Definition of included in the accessibility tree'
Expand Down