EA-R79

<meta> element has refresh delay

This rule is an error and tests the following accessibility guidelines:

Description

This rule checks that the meta element is not used for delayed redirecting or refreshing.

Explanation

This rule checks that the <meta> element is not used for delayed redirecting or refreshing. If a refresh or redirect is used, then the value of the <meta> element's content attribute has to be either 0 or greater than 72000 (20 hours).

Applicability

This rule applies to the first meta element in a document for which all the following are true:

  • the element has an http-equiv attribute value of "refresh"; and
  • the element has a valid content attribute value, as described in the meta refresh pragma directive.

Expectation

For each test target, running the shared declarative refresh steps, given the target's document, the value of the target's content attribute, and the target results in time being either 0 or greater than 72000 (20 hours).

Assumptions

  • This rule assumes no functionality was provided by the website for the user to adjust the timer.
  • This rule assumes that the refresh was not essential, which is listed as a valid exception to SC 2.2.1.

Accessibility Support

Not all major web browsers parse the value of the content attribute in the same way. Some major browsers, when they are unable to parse the value, default to a 0 seconds delay, whereas others will not redirect at all. This can cause some pages to be inapplicable for this rule, while still having a redirect in a minority of web browsers.

Tip

Don't use delayed refreshes or redirect or provide a functionality for the user to adjust the timer.

Examples

Passed

Example 1 - Passed

Redirects immediately.

<head>
	<meta http-equiv="refresh" content="0; URL='https://github.com'" />
</head>

Example 2 - Passed

First valid <meta http-equiv="refresh"> redirects immediately.

<head>
	<meta http-equiv="refresh" content="0; https://w3.org" />
	<meta http-equiv="refresh" content="5; https://w3.org" />
</head>

Example 3 - Passed

Redirects after more than 20 hours.

<head>
	<meta http-equiv="refresh" content="72001; https://w3.org" />
</head>

Failed

Example 1 - Failed

Refreshes after 30 seconds.

<head>
	<meta http-equiv="refresh" content="30" />
</head>

Example 2 - Failed

Redirects after 30 seconds.

<head>
	<meta http-equiv="refresh" content="30; URL='https://w3.org'" />
</head>

Example 3 - Failed

First <meta http-equiv="refresh"> element is not valid, second one redirects after 5 seconds.

<head>
	<meta http-equiv="refresh" content="0: https://w3.org" />
	<meta http-equiv="refresh" content="5; https://w3.org" />
</head>

Example 4 - Failed

Redirects after exactly 20 hours.

<head>
	<meta http-equiv="refresh" content="72000; https://w3.org" />
</head>

Inapplicable

Example 1 - Inapplicable

No content attribute.

<head>
	<meta http-equiv="refresh" />
</head>

Example 2 - Inapplicable

No http-equiv="refresh" attribute.

<head>
	<meta content="30" />
</head>

Example 3 - Inapplicable

content attribute is invalid and therefore inapplicable.

<head>
	<meta http-equiv="refresh" content="0: https://w3.org" />
</head>

Acknowledgments

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