SIA-R1Documents have a <title> element

Accessibility requirements

This rule tests conformance of the following accessibility requirements:

Description

This rule checks that documents have a <title> element that isn't empty or consists solely of whitespace.

Applicability

This rule applies to every document where the document element is an <html> element in the HTML namespace.

Expectations

  1. The document has at least one descendant that is an <title> element in the HTML namespace.

  2. The first <title> element in the HTML namespace that is a descendant of the document has child text content that is neither empty nor only whitespace.

Assumptions

This rule makes no assumptions.

Accessibility support

This rule has no known accessibility support concerns.

Examples

Passed

This document has a <title> element that has child text content that is neither empty nor only whitespace and therefore passes the rule:

<html>
    <head>
        <title>This is a title</title>
    </head>
    <body>
        This is some content
    </body>
</html>

Failed

This document has no <title> element and therefore fails the rule:

<html>
    <body>
        This is some content
    </body>
</html>

This document has a <title> element with child text content that is empty and therefore fails the rule:

<html>
    <head>
        <title></title>
    </head>
    <body>
        This is some content
    </body>
</html>

This document has a <title> element with child text content that is only whitespace and therefore fails the rule:

<html>
    <head>
        <title> </title>
    </head>
    <body>
        This is some content
    </body>
</html>

Inapplicable

In this document the document element is an <svg> element, not an <html> element, and the document is therefore inapplicable:

<svg xmlns="http://www.w3.org/2000/svg">
  <title>This is a circle</title>
  <circle cx="150" cy="75" r="50" fill="green"></circle>
</svg>

Acknowledgments

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