Document has an instrument to move focus to non-repeated content

  • Rule Type:atomic
  • Rule Id: ye5d6e
  • Last modified: Feb 09, 2021
  • Accessibility Requirements Mapping:
    • G1: Adding a link at the top of each page that goes directly to the main content area
      • Learn More about technique G1
      • Not required to conformance to any W3C accessibility recommendation.
      • Outcome mapping:
        • Any failed outcomes: technique is not satisfied.
        • All passed outcomes: technique needs further testing.
        • An inapplicable outcome: technique needs further testing.
    • G123: Adding a link at the beginning of a block of repeated content to go to the end of the block
      • Learn More about technique G123
      • Not required to conformance to any W3C accessibility recommendation.
      • Outcome mapping:
        • Any failed outcomes: technique is not satisfied.
        • All passed outcomes: technique needs further testing.
        • An inapplicable outcome: technique needs further testing.
    • G124: Adding links at the top of the page to each area of the content
      • Learn More about technique G124
      • Not required to conformance to any W3C accessibility recommendation.
      • Outcome mapping:
        • Any failed outcomes: technique is not satisfied.
        • All passed outcomes: technique needs further testing.
        • An inapplicable outcome: technique needs further testing.

Description

This rule checks that there is an instrument to move focus to non-repeated content in the page

Applicability

This rule applies to any HTML web page.

Expectation

For each test target, there exists at least one instrument inside it to move focus just before a node of non-repeated content after repeated content.

Assumptions

Accessibility Support

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

Background

The intention of this rule is that focus is moved to the main area of content of a document. However, defining the main area of content in a non-ambiguous way is not really doable. Therefore, the rule takes a more lenient position and only requires to move focus to some non-repeated content. Additional conditions on this destination were considered and rejected when writing the rule since it might be acceptable, for example, to skip the first heading of the main area of content if it has the exact same content as the title element of the document. Therefore, it is possible to pass this rule but still fail the related techniques and violate Success Criterion 2.4.1 Bypass blocks.

While it is clear that a "skip link" is a valid way to satisfy Success Criterion 2.4.1 Bypass blocks, it is less clear how "deep" in the page such a skip link could be. Notably, Technique G124: Adding links at the top of the page to each area of the content is listing valid cases where it could be fairly "deep" if the page has many areas of the content. Rather than trying to fix an arbitrary value (e.g. "the skip link must be among the first 5 focusable elements"), or trying to figure out some condition on what precedes it, this rule only checks its existence. It is clear that if no "skip link" is provided, then another way to bypass blocks of repeated content must be found. However, it is possible to pass this rule without satisfying Success Criterion 2.4.1 Bypass blocks if the skip link is too far away from the start of the page.

To avoid using landmarks for the non-repeated content, which would satisfy Success Criterion 2.4.1 Bypass Block, which this rule is designed for, this rule uses <div id="main"> in its test cases to indicate where non-repeating content exists. It is recommended to use the main landmark instead. The aside and nav elements are each a block of repeated content due to the link inside the nav element to a page with similar blocks of content.

Due to the differences between the 3 techniques considered here, it is almost impossible to pass all of them at the same time. The first few Passed Examples illustrate these differences and pass different techniques. The rest of the Passed Examples illustrate variations inside the rule and are based on cases that pass Technique G1: Adding a link at the top of each page that goes directly to the main content area given that it is simpler than the other two.

The examples sometimes group the skip links inside a nav landmark (notably when there are several). According to WAI-ARIA authoring practices, if another nav landmark was present on the page (e.g. for site navigation), then each should have a different accessible name.

Test Cases

Passed

Passed Example 1

Open in a new tab

In this document, the first a element is an instrument to navigate, and thus move the focus, to the non-repeated content. This example passes Technique G1: Adding a link at the top of each page that goes directly to the main content area.

<html lang="en">
	<head>
		<title>The Three Kingdoms, Chapter 1</title>
	</head>
	<body>
		<a href="#main">Skip to main content</a>
		<a href="/test-assets/bypass-blocks-cf77f2/chapter2.html">Read Chapter 2</a>

		<aside id="about-book">
			<p>The Romance of the Three Kingdoms is a 14th century historical novel.</p>
		</aside>

		<div id="main">
			<p>
				Unity succeeds division and division follows unity. One is bound to be replaced by the other after a long span
				of time.
			</p>
		</div>
	</body>
</html>

Passed Example 2

Open in a new tab

In this document, the third a element is an instrument to move the focus to the non-repeated content. This example passes Technique G124: Adding links at the top of the page to each area of the content.

<html lang="en">
	<head>
		<title>The Three Kingdoms, Chapter 1</title>
	</head>
	<body>
		<nav id="local-navigation">
			<a href="#bio-translator">Skip to translator's biography</a>
			<a href="#about-book">Skip to information about the book</a>
			<a href="#main">Skip to main content</a>
		</nav>

		<aside id="bio-translator">
			<p>Yu Sumei is a professor of English at East China Normal University.</p>
		</aside>
		<aside id="about-book">
			<p>The Romance of the Three Kingdoms is a 14th century historical novel.</p>
		</aside>

		<div id="main">
			<p>
				Unity succeeds division and division follows unity. One is bound to be replaced by the other after a long span
				of time.
			</p>
			<a href="/test-assets/bypass-blocks-cf77f2/chapter1.html">Read Chapter 2</a>
		</div>
	</body>
</html>

Passed Example 3

Open in a new tab

In this document, the second a element (inside the second aside element) is an instrument to move the focus to the non-repeated content. This example passes Technique G123: Adding a link at the beginning of a block of repeated content to go to the end of the block.

<html lang="en">
	<head>
		<title>The Three Kingdoms, Chapter 1</title>
	</head>
	<body>
		<aside id="bio-translator">
			<a href="#about-book">Skip to information about the book</a>
			<p>Yu Sumei is a professor of English at East China Normal University.</p>
		</aside>
		<aside id="about-book">
			<a href="#main">Skip to main content</a>
			<p>The Romance of the Three Kingdoms is a 14th century historical novel.</p>
		</aside>

		<div id="main">
			<p>
				Unity succeeds division and division follows unity. One is bound to be replaced by the other after a long span
				of time.
			</p>
			<a href="/test-assets/bypass-blocks-cf77f2/chapter1.html">Read Chapter 2</a>
		</div>
	</body>
</html>

Passed Example 4

Open in a new tab

In this document, the first a element is an instrument to move the focus to the non-repeated content. In this case, the element is normally hidden but is visible when focused.

<html lang="en">
	<head>
		<link rel="stylesheet" href="/test-assets/bypass-blocks-cf77f2/styles.css" />
		<title>The Three Kingdoms, Chapter 1</title>
	</head>
	<body>
		<nav class="visible-on-focus">
			<a href="#main">Skip to main content</a>
		</nav>

		<aside id="about-book">
			<p>The Romance of the Three Kingdoms is a 14th century historical novel.</p>
		</aside>

		<div id="main">
			<p>
				Unity succeeds division and division follows unity. One is bound to be replaced by the other after a long span
				of time.
			</p>
			<a href="/test-assets/bypass-blocks-cf77f2/chapter1.html">Read Chapter 2</a>
		</div>
	</body>
</html>

Passed Example 5

Open in a new tab

In this document, the first div element is an instrument to move the focus to the non-repeated content.

<html lang="en">
	<head>
		<script src="/test-assets/bypass-blocks-cf77f2/click-on-enter.js"></script>
		<title>The Three Kingdoms, Chapter 1</title>
	</head>
	<body onload="ClickOnEnter('skip-link')">
		<div role="link" onclick="location.assign('#main');" tabindex="0" id="skip-link">Skip to main content</div>

		<aside id="about-book">
			<p>The Romance of the Three Kingdoms is a 14th century historical novel.</p>
		</aside>

		<div id="main">
			<p>
				Unity succeeds division and division follows unity. One is bound to be replaced by the other after a long span
				of time.
			</p>
			<a href="/test-assets/bypass-blocks-cf77f2/chapter1.html">Read Chapter 2</a>
		</div>
	</body>
</html>

Passed Example 6

Open in a new tab

In this document, the first a element is an instrument to move the focus to the non-repeated content.

<html lang="en">
	<head>
		<title>The Three Kingdoms, Chapter 1</title>
	</head>
	<body>
		<a href="#main" aria-label="Skip to main content">📖</a>

		<aside id="about-book">
			<p>The Romance of the Three Kingdoms is a 14th century historical novel.</p>
		</aside>

		<div id="main">
			<p>
				Unity succeeds division and division follows unity. One is bound to be replaced by the other after a long span
				of time.
			</p>
			<a href="/test-assets/bypass-blocks-cf77f2/chapter1.html">Read Chapter 2</a>
		</div>
	</body>
</html>

Passed Example 7

Open in a new tab

In this document, the first a element is an instrument to move the focus to the non-repeated content. Even though its target is inside a block of repeated content, it is still just before some non-repeated content after repeated content because there is no perceivable content between the link target and the non-repeated content. Thus, following the link does skip all the repeated content.

<html lang="en">
	<head>
		<title>The Three Kingdoms, Chapter 1</title>
	</head>
	<body>
		<a href="#just-before-main">Skip to main content</a>

		<aside id="about-book">
			<p>The Romance of the Three Kingdoms is a 14th century historical novel.</p>
			<span id="just-before-main"></span>
		</aside>

		<div id="main">
			<p>
				Unity succeeds division and division follows unity. One is bound to be replaced by the other after a long span
				of time.
			</p>
			<a href="/test-assets/bypass-blocks-cf77f2/chapter1.html">Read Chapter 2</a>
		</div>
	</body>
</html>

Passed Example 8

Open in a new tab

In this document, the first a element is an instrument to move the focus to the non-repeated content. Even though its target is not the first element after it, it is still just before the first non-repeated content after repeated content. Thus, following the link does not skip any non-repeated content.

<html lang="en">
	<head>
		<title>The Three Kingdoms, Chapter 1</title>
	</head>
	<body>
		<a href="#just-before-main">Skip to main content</a>

		<aside id="about-book">
			<p>The Romance of the Three Kingdoms is a 14th century historical novel.</p>
		</aside>

		<div id="main">
			<hr />
			<span id="just-before-main"></span>
			<p>
				Unity succeeds division and division follows unity. One is bound to be replaced by the other after a long span
				of time.
			</p>
			<a href="/test-assets/bypass-blocks-cf77f2/chapter1.html">Read Chapter 2</a>
		</div>
	</body>
</html>

Failed

Failed Example 1

Open in a new tab

This document has no instrument to skip to the non-repeated content.

<html lang="en">
	<head>
		<title>The Three Kingdoms, Chapter 1</title>
	</head>
	<body>
		<a href="/test-assets/bypass-blocks-cf77f2/chapter1.html">Read Chapter 2</a>

		<aside id="about-book">
			<p>The Romance of the Three Kingdoms is a 14th century historical novel.</p>
		</aside>

		<div id="main">
			<p>
				Unity succeeds division and division follows unity. One is bound to be replaced by the other after a long span
				of time.
			</p>
		</div>
	</body>
</html>

Failed Example 2

Open in a new tab

In this document, the link to skip to the non-repeated content does not reference a valid id attribute and thus when activated will not move focus to the non-repeated content.

<html lang="en">
	<head>
		<title>The Three Kingdoms, Chapter 1</title>
	</head>
	<body>
		<a href="#invalid-id">Skip to main content</a>
		<a href="/test-assets/bypass-blocks-cf77f2/chapter1.html">Read Chapter 2</a>

		<aside id="about-book">
			<p>The Romance of the Three Kingdoms is a 14th century historical novel.</p>
		</aside>

		<div id="main">
			<p>
				Unity succeeds division and division follows unity. One is bound to be replaced by the other after a long span
				of time.
			</p>
		</div>
	</body>
</html>

Failed Example 3

Open in a new tab

In this document, the skip link does not move focus just before some non-repeated content after repeated content. The focus is moved on perceivable content which is inside the block of repeated content. Thus, following the link does not skip all the repeated content.

<html lang="en">
	<head>
		<title>The Three Kingdoms, Chapter 1</title>
	</head>
	<body>
		<a href="#before-main">Skip to main content</a>
		<a href="/test-assets/bypass-blocks-cf77f2/chapter1.html">Read Chapter 2</a>

		<aside id="about-book">
			<p id="before-main">The Romance of the Three Kingdoms is a 14th century historical novel.</p>
		</aside>

		<div id="main">
			<p>
				Unity succeeds division and division follows unity. One is bound to be replaced by the other after a long span
				of time.
			</p>
		</div>
	</body>
</html>

Inapplicable

Inapplicable Example 1

Open in a new tab

This document is not an HTML web page.

<svg xmlns="http://www.w3.org/2000/svg">
  <title>This is an SVG</title>
</svg>

Glossary

Block of content

A block of content in an HTML web page is a set of nodes from that page for which all the following are true:

  • content: there is at least one node which is perceivable content in the block; and
  • continuity: if two nodes are in the block, then any node between them (in tree order) is also in the block; and
  • downward closure: if a node is in the block, then all its descendants are also in the block; and
  • parent closure: if all children of a node are in the block, then this node is also in the block.

Assumptions for Block of content

This definition assumes that the rendering order of nodes on a page does not greatly differ from the DOM tree order. Otherwise, blocks of content as defined here may be different from what is visually perceived as "content in a close relationship".

Block of repeated content

A block of content B, inside an HTML web page P, is a block of repeated content if both the following are true:

Background for Block of repeated content

This definition only considers pages at "distance 1" from the current page. The instrument leading there is usually a link, sometimes a button. In addition, P' can be any page and is not restricted, for example, to pages of the same website.

The blocks of repeated content are not uniquely defined. For example <div><span id="repeated-1"></span><span id="repeated-2"></span><span id="not-repeated"></span></div> can be considered to have two blocks of repeated content (each of the first two span) or one (both the first two span together).

Equivalent resource

Non-identical resources can still be equivalent resources by equally complying to the expectation formed by the user when navigating to them, thus serving an equivalent purpose. This would usually involve that the advertised key content is the same.

Web pages and documents (e.g. PDFs, office formats etc.) may be equivalent resources, even if the resources:

  • are located on different URLs, including different domains
  • present different navigation options, e.g. through bread crumbs or local sub menus
  • contain different amounts of information and/or differently worded information
  • use different layouts.

If all resources cover the user's expectations equally well, the resources are considered to be equivalent.

Note: The user's expectations for the resource can be formed by different things, e.g. the name of the link leading to the resource, with or without the context around the link. This depends on the accessibility requirement that is tested.

Note: If the same content is presented in different formats or languages, the format or language itself is often part of the purpose of the content, e.g. an article as both HTML and PDF, an image in different sizes, or an article in two different languages. If getting the same content in different formats or languages is the purpose of having separate links, the resources are not equivalent.

Included in the accessibility tree

Elements included in the accessibility tree of platform specific accessibility APIs. Elements in the accessibility tree are exposed to assistive technologies, allowing users to interact with the elements in a way that meet the requirements of the individual user.

The general rules for when elements are included in the accessibility tree are defined in the core accessibility API mappings. For native markup languages, such as HTML and SVG, additional rules for when elements are included in the accessibility tree can be found in the HTML accessibility API mappings (working draft) and the SVG accessibility API mappings (working draft).

For more details, see examples of included in the accessibility tree.

Note: Users of assistive technologies might still be able to interact with elements that are not included in the accessibility tree. An example of this is a focusable element with an aria-hidden attribute with a value of true. Such an element could still be interacted using sequential keyboard navigation regardless of the assistive technologies used, even though the element would not be included in the accessibility tree.

Outcome

An outcome is a conclusion that comes from evaluating an ACT Rule on a test subject or one of its constituent test target. An outcome can be one of the three following types:

  • Inapplicable: No part of the test subject matches the applicability
  • Passed: A test target meets all expectations
  • Failed: A test target does not meet all expectations

Note: A rule has one passed or failed outcome for every test target. When there are no test targets the rule has one inapplicable outcome. This means that each test subject will have one or more outcomes.

Note: Implementations using the EARL10-Schema can express the outcome with the outcome property. In addition to passed, failed and inapplicable, EARL 1.0 also defined an incomplete outcome. While this cannot be the outcome of an ACT Rule when applied in its entirety, it often happens that rules are only partially evaluated. For example, when applicability was automated, but the expectations have to be evaluated manually. Such "interim" results can be expressed with the incomplete outcome.

Perceivable content

A node is perceivable content if all the following are true:

Perceivable content corresponds to nodes that contain information and are perceived by some categories of users.

Assumptions for Perceivable content

This definition assumes that elements with a semantic role of none or presentation are pure decoration and that elements which are pure decoration either are not included in the accessibility tree or have a semantic role of none or presentation. Note that if this is not the case, then Success Criterion 1.3.1: Info and Relationship is likely not satisfied.

Semantic Role

The semantic role of an element is determined by the first of these cases that applies:

  1. Conflict If the element is marked as decorative, but the element is included in the accessibility tree; or would be included in the accessibility tree when its hidden state is false, then its semantic role is its implicit role.
  2. Explicit If the element has an explicit role, then its semantic role is its explicit role.
  3. Implicit The semantic role of the element is its implicit role.

Accessibility Support for Definition of Semantic Role for Semantic Role

  • There exist popular web browsers and assistive technologies which do not correctly implement Presentational Roles Conflict Resolution. These technologies will not include in the accessibility tree elements that should be, according to Specifications. Thus, some elements that should have their semantic role fixed by case Conflict above are instead falling into case Explicit and are hidden for users of assistive technologies.
  • A similar conflict exists for focusable elements with a aria-hidden="true" attribute. The WAI ARIA specification does not explain how to solve it. Some browsers give precedence to the element being focusable (and expose it in the accessibility tree) while some give precedence to the aria-hidden attribute (and hide the element).

Visible

Content perceivable through sight.

Content is considered visible if making it fully transparent would result in a difference in the pixels rendered for any part of the document that is currently within the viewport or can be brought into the viewport via scrolling.

Content is defined in WCAG.

For more details, see examples of visible.

Web page (HTML)

An HTML web page is the set of all fully active documents which share the same top-level browsing context.

Note: Nesting of browsing context mostly happens with iframe and object. Thus a web page will most of the time be a "top-level" document and all its iframe and object (recursively).

Note: Web pages as defined by WCAG are not restricted to the HTML technology but can also include, e.g., PDF or DOCX documents.

Note: Although web pages as defined here are sets of documents (and do not contain other kind of nodes), one can abusively write that any node is "in a web page" if it is a shadow-including descendant of a document that is part of that web page.


Useful Links


Implementations

This section is not part of the official rule. It is populated dynamically and not accounted for in the change history or the last modified date. This section will not be included in the rule when it is published on the W3C website.

ToolConsistencyCompleteReport
QualWebconsistentYesView Report

Acknowledgments

Assets

  • _The Three Kingdoms_ by Luo Guanzhong, translation by Yu Sumei (Tuttle publishing, 2014, ISBN 9780804843935)
Table of Contents