Last updated:

Created by:

Success Criterion:

Description

This rule checks that the HTML page has a title

Accessibility Requirements

This conformance rule relates to:

Test procedure

Applicability

The rule applies to any page where the root element is an html element, and which is not embedded in another page.

Note: Pages may be embedded inside other pages through elements such as iframes and object elements.

Expectation 1

The page contains at least one title element.

Note: The title element exists in other namespaces such as SVG. These are not title elements for HTML document and should be ignored.

Expectation 2

The first title element contains non-empty text.

Assumptions

There are currently no assumptions

Accessibility Support

There are no major accessibility support issues known for this rule.

Background

Test Cases

Passed

Passed example 1

This page has a title.

Code Snippet:
 <html>
  <title>This page has a title</title>
</html>
 
Example Output: Open in a new tab/ window

Passed example 2

This page give a title to an iframe.

Code Snippet:
 <html>
  <title>This page gives a title to an iframe</title>
  <iframe src="../test-assets/sc2-4-2-title-page-without-title.html"></iframe>
</html>
 
Example Output: Open in a new tab/ window

Passed example 3

This page has a title.

Code Snippet:
 <html>
  <head>
    <title>Title of the page.</title>
  </head>
  <body>
    <title>Title of the page.</title>
  </body>
</html>
 
Example Output: Open in a new tab/ window

Passed example 4

Valid title provided.

Code Snippet:
 <html>
  <body>
    <title>Title of the page.</title>
  </body>
</html>
 
Example Output: Open in a new tab/ window

Passed example 5

Valid title provided.

Code Snippet:
 <html>
  <head>
    <title>Title of the page.</title>
  </head>
  <body>
     <title></title> 
  </body>
</html>
 
Example Output: Open in a new tab/ window

Failed

Failed example 1

This page has no title.

Code Snippet:
 <html>
  <h1>this page has no title</h1>
</html>
 
Example Output: Open in a new tab/ window

Failed example 2

Empty title.

Code Snippet:
 <html>
  <title></title>
</html>
 
Example Output: Open in a new tab/ window

Failed example 3

No title provided.

Code Snippet:
 <html>
  <iframe src="../test-assets/sc2-4-2-title-page-with-title.html"></iframe>
</html>
 
Example Output: Open in a new tab/ window

Failed example 4

Empty first title.

Code Snippet:
 <html>
  <head>
    <title></title>
  </head>
  <body>
    <title>Title of the page.</title>
  </body>
</html>
 
Example Output: Open in a new tab/ window

Inapplicable

Inapplicable example 1

Not applicable to svg element.

Code Snippet:
 <svg xmlns="http://www.w3.org/2000/svg">
  <title>This is an SVG</title>
</svg>
 
Example Output: Open in a new tab/ window

Glossary

Non-empty text string

A string of characters (text) is considered “non-empty” if it contains 1 or more characters that are contained within any of the following unicode categories:

  • Ll: Letter, Lowercase
  • Lu: Letter, Uppercase
  • Lt: Letter, Titlecase
  • Lo: Letter, Other
  • Lm: Letter, Modifier
  • Nd: Number, Decimal Digit

For more details on unicode categories, check out www.fileformat.info/info/unicode/category/

Test Aspects

Test aspects are defined as part of the ACT Rules format 1.0.
  • DOM Tree

Contribute






GitHub

Contributing is open to anyone. We welcome any new issues or pull requests for changes. Auto WCAG Rules has conference calls every 4 weeks. If you are interested in becoming an active contributor or reviewer, we ask that you join the Auto WCAG Rules community group through the W3C Website. This requires setting up a W3C account, may require approval by the organization you work for if they are a W3C member.

Learn more about contributing to Auto WCAG Rules Join the Auto WCAG Rules community group now!