Skip to content

Proposed Content has alternative for visual reference

Description

This rule checks that when content is identified through a visual reference, there are also non-visual references identifying the same content.

Applicability

This rule applies to any text node that is either visible or included in the accessibility tree.

Expectation

For each test target, either it contains none of the visual reference words, or it does not identify any web content through the use of any visual reference words, or it does identify some web content and at least one of the following is true:

Background

Visual reference words that can be interpreted with the non-sensory meaning include, in English, expressions like “right after this” where “right” is a visual reference word used with the meaning “immediately”; or words like “below” that is often used with the meaning “further in reading order”.

The rule doesn’t require the non-visual characteristic description to be included in the accessibility tree. If the alternatives are not included in the accessibility tree, only Success Criteria 1.3.1 Info and Relationships would fail instead of Success Criterion 1.3.3 Sensory Characteristics. Hence, the rule passes in these cases as it is not a failure of the accessibility requirements of this rule.

The identified web content does not have to be positioned on the same web page and doesn’t need to be linked to from the tested web page.

Assumptions

This rule assumes that visual reference words are forms of information conveyed through visual presentation. Therefore, failing this rule fails Success Criterion 1.3.3 Sensory Characteristics. Visual presentation is not limited to CSS and includes images such as the image of a circle with text.

Accessibility Support

There are no accessibility support issues known.

Bibliography

Accessibility Requirements Mapping

Input Aspects

The following aspects are required in using this rule.

Test Cases

These HTML and CSS files are used in several examples:

File /test-assets/non-visual-reference-alternative-9bd38c/triangle-menu-with-heading.html:

<html>
	<body>
		<div>
			<h1>Triangle Menu</h1>
			<ul>
				<li>
					<a href="https://www.w3.org/Consortium/contact">Contact</a>
				</li>
				<li>
					<a href="https://www.w3.org/Help/">Help and FAQ</a>
				</li>
				<li>
					<a href="https://www.w3.org/Consortium/sponsor/">Donate</a>
				</li>
				<li>
					<a href="https://www.w3.org/Consortium/siteindex">Sitemap</a>
				</li>
			</ul>
		</div>
	</body>
</html>

File /test-assets/non-visual-reference-alternative-9bd38c/star-with-heading.html:

<html>
	<body>
		<p></p>
		<h1>Examples</h1>
		<ul>
			<li>Example 1</li>
			<li>Example 2</li>
			<li>Example 3</li>
			<li>Example 4</li>
		</ul>
	</body>
</html>

File /test-assets/non-visual-reference-alternative-9bd38c/triangle-menu-without-heading.html:

<html>
	<body>
		<div>
			<h1></h1>
			<ul>
				<li>
					<a href="https://www.w3.org/Consortium/contact">Contact</a>
				</li>
				<li>
					<a href="https://www.w3.org/Help/">Help and FAQ</a>
				</li>
				<li>
					<a href="https://www.w3.org/Consortium/sponsor/">Donate</a>
				</li>
				<li>
					<a href="https://www.w3.org/Consortium/siteindex">Sitemap</a>
				</li>
			</ul>
		</div>
	</body>
</html>

File /test-assets/non-visual-reference-alternative-9bd38c/star-without-heading.html:

<html>
	<body>
		<p></p>
		<ul>
			<li>Example 1</li>
			<li>Example 2</li>
			<li>Example 3</li>
			<li>Example 4</li>
		</ul>
	</body>
</html>

File /test-assets/non-visual-reference-alternative-9bd38c/columns.css:

.col-container {
	display: table;
	width: 100%;
}
.col {
	display: table-cell;
	padding: 16px;
}

Passed

Passed Example 1

Open in a new tab

This paragraph includes the visual reference word “right”. The content in the second column is identified with the word “right” but also identified by referencing the word “howdy”, thus matching the non-visual reference condition.

<html lang="en">
	<head>
		<title>Passed example 1 9bd38c</title>
		<link rel="stylesheet" type="text/css" href="/test-assets/non-visual-reference-alternative-9bd38c/columns.css" />
	</head>
	<body>
		<div class="col-container">
			<div class="col">
				<p>Click the button labelled "howdy", on the right, for a surprise</p>
			</div>
			<div class="col">
				<button onclick="alert('Surprise!')">Howdy</button>
			</div>
		</div>
	</body>
</html>

Passed Example 2

Open in a new tab

This paragraph includes the visual reference word “below” which can here be accurately interpreted as “further in the reading order”. Hence, the paragraph matches the non-sensory meaning condition.

<html lang="en">
	<p>Interact with the button below this paragraph, for a surprise</p>
	<button onclick="alert('Surprise!')">Howdy</button>
</html>

Passed Example 3

Open in a new tab

This paragraph includes the visual reference word “right”. The visual reference made by the word “right” is complemented by the non-visual reference made by the word “menu” to the content identified by the “Menu” heading, thus matching the non-visual reference condition.

<html lang="en">
	<head>
		<title>Passed example 3 9bd38c</title>
		<link rel="stylesheet" type="text/css" href="/test-assets/non-visual-reference-alternative-9bd38c/columns.css" />
	</head>
	<body>
		<div class="col-container">
			<div class="col">
				<p>Find the menu on the right, to navigate</p>
			</div>
			<div class="col">
				<h1>Menu</h1>
				<ul>
					<li>
						<a href="https://www.w3.org/Consortium/contact">Contact</a>
					</li>
					<li>
						<a href="https://www.w3.org/Help/">Help and FAQ</a>
					</li>
				</ul>
			</div>
		</div>
	</body>
</html>

Passed Example 4

Open in a new tab

This text includes the visual reference word “tilted” and identifies web content (namely itself). But the text also includes the word “this” which makes it apparent that the description is about the same content, thus matching the non-visual reference condition.

<html lang="en">
	<head>
		<title>Passed example 4 9bd38c</title>
		<style>
			div.tilt {
				height: 750px;
				width: 150px;
				-ms-transform: rotate(20deg); /* IE 9 */
				-webkit-transform: rotate(20deg); /* Safari 3-8 */
				transform: rotate(20deg);
			}
		</style>
	</head>
	<body>
		<div class="tilt">Search this pieCe of tiLted text fOr clueS on whEre to find The monster.</div>
	</body>
</html>

Passed Example 5

Open in a new tab

This paragraph includes the visual reference word “round”. The button is identified by this word which is also included in the visible text content of the element, thus matching the visible words condition.

<html lang="en">
	<head>
		<title>Passed example 5 9bd38c</title>
		<link rel="stylesheet" type="text/css" href="/test-assets/non-visual-reference-alternative-9bd38c/columns.css" />
	</head>
	<body>
		<div class="col-container">
			<div class="col">
				<p>Click the round button, for a surprise</p>
			</div>
			<div class="col">
				<button style="border-radius: 50%; height: 100px; width: 100px;" onclick="alert('Surprise!')">
					Round button
				</button>
			</div>
		</div>
	</body>
</html>

Passed Example 6

Open in a new tab

This paragraph includes the visual reference word “triangle” which is included in the heading of the menu, thus matching the visible words condition. The fact that the described content is on another page of the same website does not restrict this rule.

<html lang="en">
	<p>
		On the
		<a href="/test-assets/non-visual-reference-alternative-9bd38c/triangle-menu-with-heading.html">information page</a>
		you can find more examples within the triangle menu.
	</p>
</html>

Passed Example 7

Open in a new tab

This paragraph includes the visual reference words “wide” and “narrow”. The images are indicated by these words which are also included in the accessible names of the images, thus matching the accessible words condition.

<html lang="en">
	<p>The wide image is awesome. The narrow image isn't.</p>
	<img
		scr="/test-assets/non-visual-reference-alternative-9bd38c/awesome_wide.jfif"
		alt="Wide photo of an awesome landscape."
	/>
	<img
		scr="/test-assets/non-visual-reference-alternative-9bd38c/non_awesome_narrow.jpg"
		alt="Narrow photo of a dull landscape."
	/>
</html>

Passed Example 8

Open in a new tab

This paragraph includes the visual reference words “square” and “right” but in this case they are not identifying any web content.

<html lang="en">
	<p>A square is a regular quadrilateral with four equal sides and four right angles.</p>
</html>

Passed Example 9

Open in a new tab

This paragraph includes the visual reference word “circle” but in this case it is not an instruction about any web content, thus matching the no instruction condition.

<html lang="en">
	<p>
		This circle is nice.
		<span
			role="presentation"
			style="height: 25px;
		     width: 25px;
		     background-color: #bbb;
		     border-radius: 50%;
		     display: inline-block;"
		>
		</span>
	</p>
</html>

Passed Example 10

Open in a new tab

This paragraph includes the visual reference word “star” but there is also a heading “examples” that can be referenced, thus matching the non-visual references condition. The fact that the identified content is in an iframe does not restrict this rule.

<html lang="en">
	<p>More examples can be found when you look underneath the star or you can search for the "Examples" heading</p>
	<iframe title="star" src="/test-assets/non-visual-reference-alternative-9bd38c/star-with-heading.html"></iframe>
</html>

Passed Example 11

Open in a new tab

This paragraph includes the visual reference word “right”. The content in the second column is identified with the word “right” but also identified by referencing the word “howdy”, thus matching the non-visual reference condition. Note that, despite the fact that the text is not visible, this example is applicable because it is included in the accessibility tree.

<html lang="en">
	<head>
		<title>Passed example 11 9bd38c</title>
		<link rel="stylesheet" type="text/css" href="/test-assets/non-visual-reference-alternative-9bd38c/columns.css" />
	</head>
	<body>
		<div class="col-container">
			<div class="col">
				<p style="position:absolute; top:-9999em">Click the button labelled "howdy", on the right, for a surprise</p>
			</div>
			<div class="col">
				<button onclick="alert('Surprise!')">Howdy</button>
			</div>
		</div>
	</body>
</html>

Passed Example 12

Open in a new tab

This paragraph includes the visual reference word “green”. The content in the second column is identified with the word “green” but also identified by referencing the word “howdy”, thus matching the non-visual reference condition. Note that, despite the fact that the text is not included in the accessibility tree, this example is applicable because it is visible.

<html lang="en">
	<head>
		<title>Passed example 12 9bd38c</title>
		<link rel="stylesheet" type="text/css" href="/test-assets/non-visual-reference-alternative-9bd38c/columns.css" />
	</head>
	<body>
		<div class="col-container">
			<div class="col">
				<p aria-hidden="true">Click the green button labelled "howdy" for a surprise</p>
			</div>
			<div class="col">
				<button style="background-color: green" onclick="alert('Surprise!')">Howdy</button>
			</div>
		</div>
	</body>
</html>

Passed Example 13

Open in a new tab

This paragraph includes the visual reference word “right”. The user is told to find the navigation on the right and the navigation is also correctly identified by a nav element whose accessible name contains the word “navigation”, thus matching the non-visual reference condition.

<html lang="en">
	<head>
		<title>Passed example 13 9bd38c</title>
		<link rel="stylesheet" type="text/css" href="/test-assets/non-visual-reference-alternative-9bd38c/columns.css" />
	</head>
	<body>
		<div class="col-container">
			<div class="col">
				<p>Find the navigation on the right, for the non-essential links</p>
			</div>
			<nav>
				<div class="col">
					<ul>
						<li>
							<a href="https://www.w3.org/Consortium/contact">Contact</a>
						</li>
						<li>
							<a href="https://www.w3.org/Help/">Help and FAQ</a>
						</li>
					</ul>
				</div>
			</nav>
		</div>
	</body>
</html>

Passed Example 14

Open in a new tab

No text node on this page includes any of the visual reference words.

<html lang="en">
	<p>Click the button, for a surprise</p>
	<button onclick="alert('Surprise!')">Howdy</button>
</html>

Passed Example 15

Open in a new tab

No text node on this page includes any of the visual reference words. The word “square” in French (the language of the page) never has the meaning of the geometrical figure. Hence, it is not the translation of any of the visual reference words. The sentence means “After school, he’s taking his kids to the public garden.”

<html lang="fr">
	<p>
		Après l'école, il emmène ses enfants jouer au square.
	</p>
</html>

Failed

Failed Example 1

Open in a new tab

This paragraph includes the visual reference word “right”. The user is told to find the menu on the right but the menu is not identified in any other way.

<html lang="en">
	<head>
		<title>Failed example 1 9bd38c</title>
		<link rel="stylesheet" type="text/css" href="/test-assets/non-visual-reference-alternative-9bd38c/columns.css" />
	</head>
	<body>
		<div class="col-container">
			<div class="col">
				<p>Find the menu on the right, to navigate</p>
			</div>
			<div class="col">
				<ul>
					<li>
						<a href="https://www.w3.org/Consortium/contact">Contact</a>
					</li>
					<li>
						<a href="https://www.w3.org/Help/">Help and FAQ</a>
					</li>
				</ul>
			</div>
		</div>
	</body>
</html>

Failed Example 2

Open in a new tab

This paragraph includes the visual reference word “right”. The user is told to find the navigation on the right and the navigation is correctly identified by a nav element, but there are 2 nav elements on the page so the user doesn’t know which one to use (the non-visual reference is ambiguous and does not identify a specific web content).

<html lang="en">
	<head>
		<title>Failed example 2 9bd38c</title>
		<link rel="stylesheet" type="text/css" href="/test-assets/non-visual-reference-alternative-9bd38c/columns.css" />
	</head>
	<body>
		<nav>
			<ul>
				<li>
					<a href="https://www.w3.org/">W3C homepage</a>
				</li>
				<li>
					<a href="https://www.w3.org/standards/">Standards</a>
				</li>
			</ul>
		</nav>
		<div class="col-container">
			<div class="col">
				<p>Find the navigation on the right, for the non-essential links</p>
			</div>
			<nav>
				<div class="col">
					<ul>
						<li>
							<a href="https://www.w3.org/Consortium/contact">Contact</a>
						</li>
						<li>
							<a href="https://www.w3.org/Help/">Help and FAQ</a>
						</li>
					</ul>
				</div>
			</nav>
		</div>
	</body>
</html>

Failed Example 3

Open in a new tab

This paragraph includes the visual reference word “triangle” (which is not included in the identified content) and no other indication is present so the rule fails. The fact that the triangle menu is on a different page of the same website does not restrict the rule.

<html lang="en">
	<body>
		<p>
			On the
			<a href="/test-assets/non-visual-reference-alternative-9bd38c/triangle-menu-without-heading.html"
				>information page</a
			>
			you can find more examples within the triangle menu
		</p>
	</body>
</html>

Failed Example 4

Open in a new tab

This paragraph includes the visual reference word “star” (which is not included in the identified content) and there is no other indication. The content described is in an iframe.

<html lang="en">
	<body>
		<p>More examples can be found when you look underneath the star</p>
		<iframe src="/test-assets/non-visual-reference-alternative-9bd38c/star-without-heading.html"></iframe>
	</body>
</html>

Inapplicable

Inapplicable Example 1

Open in a new tab

This image link contains no text node.

<html lang="en">
	<a href="https://act-rules.github.io/"><img src="test-assets/shared/act-logo.png" alt="ACT rules"/></a>
</html>

Inapplicable Example 2

Open in a new tab

This document contains no text node that is either visible or included in the accessibility tree.

<html lang="en">
	<div style="display:none">
		<p>Click the box, for a surprise</p>
		<button onclick="alert('Surprise!')">Howdy</button>
	</div>
</html>

Glossary

Accessible Name

The accessible name is the programmatically determined name of a user interface element that is included in the accessibility tree.

The accessible name is calculated using the accessible name and description computation.

For native markup languages, such as HTML and SVG, additional information on how to calculate the accessible name can be found in HTML Accessibility API Mappings 1.0, Accessible Name and Description Computation (working draft) and SVG Accessibility API Mappings, Name and Description (working draft).

For more details, see examples of accessible name.

Note: As per the accessible name and description computation, each element always has an accessible name. When no accessible name is provided, the element will nonetheless be assigned an empty ("") one.

Note: As per the accessible name and description computation, accessible names are flat string trimmed of leading and trailing whitespace. Notably, it is not possible for a non-empty accessible name to be composed only of whitespace since these must be trimmed.

Focusable

An element is focusable if one or both of the following are true:

Exception: Elements that lose focus and do not regain focus during a period of up to 1 second after gaining focus, without the user interacting with the page the element is on, are not considered focusable.

Notes:

Included in the accessibility tree

Elements included in the accessibility tree of platform specific accessibility APIs are exposed to assistive technologies. This allows users of assistive technology to access the elements in a way that meets 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.

Programmatically hidden elements are removed from the accessibility tree. However, some browsers will leave focusable elements with an aria-hidden attribute set to true in the accessibility tree. Because they are hidden, these elements are considered not included in the accessibility tree. This may cause confusion for users of assistive technologies because they may still be able to interact with these focusable elements using sequential keyboard navigation, even though the element should not be included in the accessibility tree.

Outcome

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 five following types:

Note: A rule has one passed or failed outcome for every test target. When a tester evaluates a test target it can also be reported as cantTell if the rule cannot be tested in its entirety. For example, when applicability was automated, but the expectations have to be evaluated manually.

When there are no test targets the rule has one inapplicable outcome. If the tester is unable to determine whether there are test targets there will be one cantTell outcome. And when no evaluation has occurred the test target has one untested outcome. This means that each test subject always has one or more outcomes.

Outcomes used in ACT Rules can be expressed using the outcome property of the [EARL10-Schema][].

Programmatically Hidden

An HTML element is programmatically hidden if either it has a computed CSS property visibility whose value is not visible; or at least one of the following is true for any of its inclusive ancestors in the flat tree:

Note: Contrary to the other conditions, the visibility CSS property may be reverted by descendants.

Note: The HTML standard suggests setting the CSS display property to none for elements with the hidden attribute. While not required by HTML, all modern browsers follow this suggestion. Because of this the hidden attribute is not used in this definition. In browsers that use this suggestion, overriding the CSS display property can reveal elements with the hidden attribute.

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.

Visible Text Content

The visible text content of an element is a set of all visible text nodes that are descendants in the flat tree of this element

Visual Reference Words

Any word in a text node that is included in the translated version of the following lists, where the language of the translation is the programmatically determinable language of the text node. Some words can be translated in multiple ways or have plural forms. In such cases each translation or form must be included. Some words can be spelled in multiple ways (For example: sometimes the word is capitalized and sometimes it isn’t). In such cases each spelling must be included.

Note: This list is not exhaustive. As soon as more visual reference words are found they can be added to this list.

Visual location:

Shape:

Size:

Orientation:

Color

Rule Versions

This is the first version of this ACT rule.

Implementations

There are currently no known implementations for this rule. If you would like to contribute an implementation, please read the ACT Implementations page for details.

Back to Top

This is an unpublished draft preview that might include content that is not yet approved. The published website is at w3.org/WAI/.