iframe elements with identical accessible names have equivalent purpose

  • Rule Type:atomic
  • Rule Id: 4b1c6c
  • Last modified: Aug 24, 2020
  • Accessibility Requirements Mapping:
    • 4.1.2 Name, Role, Value (Level A)
      • Learn More about 4.1.2 Name, Role, Value
      • Required for conformance to WCAG 2.0 and later on level A and higher.
      • Outcome mapping:
        • Any failed outcomes: success criterion is not satisfied.
        • All passed outcomes: success criterion needs further testing.
        • An inapplicable outcome: success criterion needs further testing.

Description

This rule checks that iframe elements with identical accessible names embed the same resource or equivalent resources.

Applicability

This rule applies to any set of any two or more iframe elements which:

Note: The test target for this rule is the full set of iframe elements that share the same matching accessible name.

Expectation

The iframe elements in each set of target elements embed the same resource or equivalent resources.

Note: Resolving the embedded resource includes any redirects that are instant.

Assumptions

  • This rule assumes that, within the context of the test subject, the description provided by the accessible name of an iframe can only accurately describe one resource (notably, homonyms alone are not used as iframe names). Thus, if two or more iframe elements have the same accessible name but embed different resources, at least one of them does not describe its purpose.
  • This rule assumes that the language of each test target can be correctly determined (either programmatically or by analyzing the content), and sufficiently understood.

Accessibility Support

This rule assumes that assistive technologies are exposing all iframe elements on the page in the same way no matter which document tree they are in. If an assistive technology requires the user to "enter" an iframe or a shadow tree before exposing its content (notably nested iframe), then it is possible for two iframe to have identical name but embed different resources without failing Success Criterion 4.1.2: Name, Role, Value (if said iframe are in separate documents or shadow trees)

Background

Test Cases

Passed

Passed Example 1

Open in a new tab

Two iframe elements within the same document tree have the same accessible name (given by the title attribute) and embed the same resource.

<html lang="en">
	<iframe title="List of Contributors" src="/test-assets/iframe-unique-name-4b1c6c/page-one.html"> </iframe>

	<iframe title="List of Contributors" src="/test-assets/iframe-unique-name-4b1c6c/page-one.html"> </iframe>
</html>

Passed Example 2

Open in a new tab

Two iframe elements within the same document tree have the same accessible name (given by the title and aria-label attributes) and embed the same resource.

<html lang="en">
	<iframe title="List of Contributors" src="/test-assets/iframe-unique-name-4b1c6c/page-one.html"> </iframe>

	<iframe aria-label="List of Contributors" src="/test-assets/iframe-unique-name-4b1c6c/page-one.html"> </iframe>
</html>

Passed Example 3

Open in a new tab

Two iframe elements within the same document tree have the same accessible name (given by the aria-labelledby attribute and corresponding elements) and embed the same resource.

<html lang="en">
	<div id="desc-for-title">List of Contributors</div>
	<iframe aria-labelledby="desc-for-title" src="/test-assets/iframe-unique-name-4b1c6c/page-one.html"> </iframe>

	<div id="desc-for-title1">List of Contributors</div>
	<iframe aria-labelledby="desc-for-title1" src="/test-assets/iframe-unique-name-4b1c6c/page-one.html"> </iframe>
</html>

Passed Example 4

Open in a new tab

Two iframe elements within the same document tree have the same accessible name (given by the title attribute) and embed equivalent resources. Only the navigation options (bread crumbs and local sub menus) differ due to different placement in navigation hierarchy.

<html lang="en">
	<iframe title="Contact us" src="/test-assets/iframe-unique-name-4b1c6c/page-one.html"> </iframe>

	<iframe title="Contact us" src="/test-assets/iframe-unique-name-4b1c6c/sub-dir/page-one.html"> </iframe>
</html>

Passed Example 5

Open in a new tab

Two iframe elements within the same document tree have the same accessible name (given by the title attribute) and embed equivalent resources.

<html lang="en">
	<iframe title="Contact us" src="/test-assets/iframe-unique-name-4b1c6c/page-one.html"> </iframe>

	<iframe title="Contact us" src="/test-assets/iframe-unique-name-4b1c6c/page-one-copy.html"> </iframe>
</html>

Passed Example 6

Open in a new tab

Two iframe elements within the same document tree have the same accessible name (given by the title attribute) and embed the same resource. src attributes only differ due to trailing slashes, but resolves to the same resource after redirects caused by user agent.

<html lang="en">
	<iframe title="Contact us" src="/test-assets/iframe-unique-name-4b1c6c/sub-dir-2/"> </iframe>

	<iframe title="Contact us" src="/test-assets/iframe-unique-name-4b1c6c/sub-dir-2"> </iframe>
</html>

Passed Example 7

Open in a new tab

Two iframe elements within the same document tree have the same accessible name (given by the title attribute) and embed equivalent resources. Resources differ by the amount of information available and/or a differently worded information.

<html lang="en">
	<iframe title="Contact us" src="/test-assets/iframe-unique-name-4b1c6c/page-one.html"> </iframe>

	<iframe title="Contact us" src="/test-assets/iframe-unique-name-4b1c6c/page-three-same-as-page-one.html"> </iframe>
</html>

Passed Example 8

Open in a new tab

Two iframe elements within the same document tree have the same accessible name (given by the title attribute) and embed equivalent resources. Each iframe refers to a different url that referenced different advertising content (giving by a third party) but embed resources has equivalent purpose: showing an advertising.

<html lang="en">
	<iframe title="advertising" src="/test-assets/iframe-unique-name-4b1c6c/advertising-one.html"> </iframe>

	<iframe title="advertising" src="/test-assets/iframe-unique-name-4b1c6c/advertising-two.html"> </iframe>
</html>

Passed Example 9

Open in a new tab

All three iframe elements have the same accessible name. The second iframe (with id "light" ) is only part of the light tree. When the shadow tree is attached to host and flattened, this iframe is overwritten and therefore not part of the flat tree. Hence, only the first and third iframe are considered by this rule and they both point to the same resource.

<iframe id="always" title="List of Contributors" src="/test-assets/iframe-unique-name-4b1c6c/page-one.html"> </iframe>

<div id="host">
	<iframe id="light" title="List of Contributors" src="/test-assets/iframe-unique-name-4b1c6c/page-two.html"> </iframe>
</div>

<script>
	const host = document.getElementById('host')
	const shadowRoot = host.attachShadow({ mode: 'open' })
	shadowRoot.innerHTML =
		'<iframe id="shadow" title="List of Contributors" src="/test-assets/iframe-unique-name-4b1c6c/page-one.html"> </iframe>'
</script>

Passed Example 10

Open in a new tab

The browsing context of the iframe with id "container" has the browsing context of the main document as an ancestor browsing context. Hence, they share the same top-level browsing context (namely, the browsing context of the main document) and are part of the same web page (HTML). Therefore, both iframe with id "top-level" and "nested" are considered and, since they embed the same document, the rule passes.

<iframe id="top-level" title="List of Contributors" src="/test-assets/iframe-unique-name-4b1c6c/page-one.html">
</iframe>

<iframe
	id="container"
	srcdoc="<iframe id='nested' title='List of Contributors' src='/test-assets/iframe-unique-name-4b1c6c/page-one.html'> </iframe>"
></iframe>

Failed

Failed Example 1

Open in a new tab

Two iframe elements within the same document tree have the same accessible name (given by the title attribute) but don't embed equivalent resources.

<html lang="en">
	<iframe title="List of Contributors" src="/test-assets/iframe-unique-name-4b1c6c/page-one.html"> </iframe>

	<iframe title="List of Contributors" src="/test-assets/iframe-unique-name-4b1c6c/page-two.html"> </iframe>
</html>

Failed Example 2

Open in a new tab

Two iframe elements within the same document tree have the same accessible name (given by the aria-label attribute) but don't embed equivalent resources.

<html lang="en">
	<iframe aria-label="List of Contributors" src="/test-assets/iframe-unique-name-4b1c6c/page-one.html"> </iframe>

	<iframe aria-label="List of Contributors" src="/test-assets/iframe-unique-name-4b1c6c/page-two.html"> </iframe>
</html>

Failed Example 3

Open in a new tab

Two iframe elements within the same document tree have the same accessible name (given by the title and aria-label attributes) but don't embed equivalent resources.

<html lang="en">
	<iframe title="List of Contributors" src="/test-assets/iframe-unique-name-4b1c6c/page-one.html"> </iframe>

	<iframe aria-label="List of Contributors" src="/test-assets/iframe-unique-name-4b1c6c/page-two.html"> </iframe>
</html>

Failed Example 4

Open in a new tab

The browsing context of the iframe with id "container" has the browsing context of the main document as an ancestor browsing context. Hence, they share the same top-level browsing context (namely, the browsing context of the main document) and are part of the same web page (HTML). Therefore, both iframe with id "top-level" and "nested" are considered and the rule fails.

<iframe id="top-level" title="List of Contributors" src="/test-assets/iframe-unique-name-4b1c6c/page-one.html">
</iframe>

<iframe
	id="container"
	srcdoc="<iframe id='nested' title='List of Contributors' src='/test-assets/iframe-unique-name-4b1c6c/page-two.html'> </iframe>"
></iframe>

Inapplicable

Inapplicable Example 1

Open in a new tab

There is only one iframe element within the document tree. Therefore, there is no set of two or more iframe elements with the same accessible name and the rule is inapplicable.

<html lang="en">
	<iframe title="List of Contributors" src="/test-assets/iframe-unique-name-4b1c6c/page-one.html"> </iframe>
</html>

Inapplicable Example 2

Open in a new tab

Each of the two iframe elements within the document tree has a different accessible name (given by the title attribute). Therefore, there is no set of two or more iframe elements with the same accessible name and the rule is inapplicable.

<html lang="en">
	<iframe title="List of Contributors to Repository 1" src="/test-assets/iframe-unique-name-4b1c6c/page-one.html">
	</iframe>

	<iframe title="List of Contributors to Repository 2" src="/test-assets/iframe-unique-name-4b1c6c/page-two.html">
	</iframe>
</html>

Inapplicable Example 3

Open in a new tab

Each of the two iframe elements within the document tree has a different accessible name (given by the aria-label attribute). Therefore, there is no set of two or more iframe elements with the same accessible name and the rule is inapplicable.

<html lang="en">
	<iframe aria-label="List of Contributors to Repository 1" src="/test-assets/iframe-unique-name-4b1c6c/page-one.html">
	</iframe>

	<iframe aria-label="List of Contributors to Repository 2" src="/test-assets/iframe-unique-name-4b1c6c/page-two.html">
	</iframe>
</html>

Inapplicable Example 4

Open in a new tab

Each of the two iframe elements within the document tree has a different accessible name (given by the aria-labelledby attribute and matching elements). Therefore, there is no set of two or more iframe elements with the same accessible name and the rule is inapplicable.

<html lang="en">
	<div id="desc-for-title">List of Contributors</div>
	<iframe aria-labelledby="desc-for-title" src="/test-assets/iframe-unique-name-4b1c6c/page-one.html"> </iframe>

	<div id="desc-for-title1">List of Reviewers</div>
	<iframe aria-labelledby="desc-for-title1" src="/test-assets/iframe-unique-name-4b1c6c/page-two.html"> </iframe>
</html>

Inapplicable Example 5

Open in a new tab

Both iframe elements have the same accessible name (given by the title attribute) within the same document tree, but one of them is not included in the accessibility tree. Therefore, there is no set of two or more iframe elements that are included in the accessibility tree and have the same accessible name, and the rule is inapplicable.

<html lang="en">
	<iframe aria-hidden="true" title="List of Contributors" src="/test-assets/iframe-unique-name-4b1c6c/page-one.html">
	</iframe>

	<iframe title="List of Contributors" src="/test-assets/iframe-unique-name-4b1c6c/page-two.html"> </iframe>
</html>

Inapplicable Example 6

Open in a new tab

The alt attribute does not provide an accessible name for iframe elements. Therefore, these iframe elements do not have an accessible name and the rule is inapplicable.

<html lang="en">
	<iframe alt="Some" src="/test-assets/iframe-unique-name-4b1c6c/page-one.html"> </iframe>

	<iframe alt="Some" src="/test-assets/iframe-unique-name-4b1c6c/page-one.html"> </iframe>
</html>

Inapplicable Example 7

Open in a new tab

The rule does not apply to object elements.

<html lang="en">
	<object title="List of Contributors" src="/test-assets/iframe-unique-name-4b1c6c/page-one.html"> </object>

	<object aria-label="List of Contributors Clone" src="/test-assets/iframe-unique-name-4b1c6c/page-two.html"> </object>
</html>

Inapplicable Example 8

Open in a new tab

These iframe elements do not have accessible names.

<html lang="en">
	<iframe src="/test-assets/iframe-unique-name-4b1c6c/page-two.html"> </iframe>

	<iframe src="/test-assets/iframe-unique-name-4b1c6c/page-one.html"> </iframe>
</html>

Inapplicable Example 9

Open in a new tab

These iframe elements are not included in the accessibility tree, because of the display:none styling.

<html lang="en">
	<iframe style="display:none;" title="Document One" src="/test-assets/iframe-unique-name-4b1c6c/page-one.html">
	</iframe>

	<iframe style="display:none;" aria-label="Document One" src="/test-assets/iframe-unique-name-4b1c6c/page-two.html">
	</iframe>
</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.

Accessibility Support for Accessible Name

  • Because the accessible name and description computation is not clear about which whitespace are considered, browsers behave differently when trimming and flattening the accessible name. For example, some browsers completely trim non-breaking spaces while some keep them in the accessible name.
  • There exists a popular browser which does not perform the same trimming and flattening depending whether the accessible name comes from content, an aria-label attribute, or an alt attribute.
  • There exists a popular browser which assign no accessible name (null) when none is provided, instead of assigned an empty accessible name ("").
  • The accessible name and description computation suggest that if an aria-labelledby attribute refers to an existing but empty element, the computation should stop and return an empty name without defaulting to the next steps. Several user agents and assistive technologies chose to use the next step in the computation in this case.

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.

Matching characters

A sequence of characters is considered to match another if, after removing leading and trailing space characters and replacing remaining occurrences of one or more space characters with a single space, the two sequences of characters are equal character-by-character, ignoring any differences in letter casing.

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.

Same resource

Two or more resources can be the same resource even though the URLs for them are different. This can be due to URL parsing, server settings, redirects and DNS aliasing.

If the parsed URLs for two resources are identical, the resources are the same resource.

Depending on the server, URLs can either be case-sensitive or case-insensitive, meaning that <a href="page1.html"> and <a href="Page1.html"> lead to either the same or two different pages.

Fully parsed URLs can be different, but still lead to the same resource after making the HTTP request, due to redirects and DNS aliasing. For example, these URLs are all fully normalized: http://example.com/, http://www.example.com/, https://www.example.com/. The server can however be configured to serve the same site for http and https, and the same site for example.com and www.example.com. This is common, but not guaranteed.

Some types of redirects are also caused by user agents, e.g. ensuring that http://example.com/ and http://example.com resolve to the same resource.

On the other hand, identical relative URLs do not necessarily resolve to the same resource, even if they are in the same web page (HTML). This happen because external content can be included through iframe and URLs in or out of it will resolve relatively to different base URLs.

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
AlfaconsistentYesView Report
QualWebpartially-consistentYesView Report

Acknowledgments

Table of Contents