aria-hidden with focusable content

  • Rule Typeatomic
  • Rule ID: 6cfa84
  • Last modified: Aug 21, 2019
  • Accessibility Requirements Mapping
    • 1.3.1 Info and Relationships (Level: A)
      • Learn More about 1.3.1 (Info and Relationships)
      • Required for conformance to WCAG 2.0 and above on level A and above
      • Outcome mapping:
        • Any failed outcomes: not satisfied
        • All passed outcomes: further testing is needed
        • An inapplicable outcome: further testing is needed
    • 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 above on level A and above
      • Outcome mapping:
        • Any failed outcomes: not satisfied
        • All passed outcomes: further testing is needed
        • An inapplicable outcome: further testing is needed
  • Input Aspects

Description

This rule checks that elements with an aria-hidden attribute do not contain focusable elements.

Applicability

The rule applies to any element with an aria-hidden="true" attribute.

Note: Using aria-hidden="false" on a descendant of an element with aria-hidden="true" does not expose that element. aria-hidden="true" hides itself and all its content from assistive technologies.

Expectation

None of the target elements are part of sequential focus navigation, nor do they have descendants in the flat tree (work in progress) that are part of sequential focus navigation.

Assumptions

There are currently no assumptions

Accessibility Support

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

Background

By adding aria-hidden="true" to an element, content authors ensure that assistive technologies will ignore the element. This can be used to hide decorative parts of a web page, such as icon fonts - that are not meant to be read by assistive technologies.

A focusable element with aria-hidden="true" is ignored as part of the reading order, but still part of the focus order, making it's state of visible or hidden unclear.

Test Cases

Passed

Passed Example 1

Content not focusable by default.

<p aria-hidden="true">Some text</p>

Passed Example 2

Content hidden through CSS.

<div aria-hidden="true">
	<a href="/" style="display:none">Link</a>
</div>

Passed Example 3

Content taken out of sequential focus order using tabindex.

<div aria-hidden="true">
	<button tabindex="-1">Some button</button>
</div>

Passed Example 4

Content made unfocusable through disabled attribute.

<input disabled aria-hidden="true" />

Passed Example 5

aria-hidden can't be reset once set to true on an ancestor.

<div aria-hidden="true">
	<div aria-hidden="false">
		<button tabindex="-1">Some button</button>
	</div>
</div>

Passed Example 6

Content taken out of sequential focus order using tabindex.

<div aria-hidden="true">
	<button tabindex="-2">Some button</button>
</div>

Failed

Failed Example 1

Focusable off screen link.

<div aria-hidden="true">
	<a href="/" style="position:absolute; top:-999em">Link</a>
</div>

Failed Example 2

Focusable form field, incorrectly disabled.

<div aria-hidden="true">
	<input aria-disabled="true" />
</div>

Failed Example 3

aria-hidden can't be reset once set to true on an ancestor.

<div aria-hidden="true">
	<div aria-hidden="false">
		<button>Some button</button>
	</div>
</div>

Failed Example 4

Focusable content through tabindex.

<p tabindex="0" aria-hidden="true">Some text</p>

Failed Example 5

Focusable summary element.

<details aria-hidden="true">
	<summary>Some button</summary>
	<p>Some details</p>
</details>

Inapplicable

Inapplicable Example 1

Ignore aria-hidden with null value.

<button tabindex="-1" aria-hidden>Some button</button>

Inapplicable Example 2

Ignore aria-hidden false.

<p aria-hidden="false">Some text</p>

Inapplicable Example 3

Incorrect value of aria-hidden.

<div aria-hidden="yes">
	<p>Some text</p>
</div>

Glossary

Outcome

key: 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 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: Implementers 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.


Changelog

Aug 21, 2019fix: update links to WCAG21 resources (#776)
Aug 21, 2019Editorial changes (#725)
May 7, 2019Template update - aria-hidden with focusable content (#496)
May 2, 2019chore: add manual reporting download links to rule (#492)
Apr 29, 2019chore: rename files and update associations (#489)
Apr 16, 2019chore: add unique id to all rules (#478)
Apr 15, 2019chore: WCAG ACT RULES CG Website Update (#437)
Apr 10, 2019Rule update: "aria-hidden with focusable content" (#439)
Apr 5, 2019Changed succescriteria from 4.1.2 to 1.3.1 (#449)
Mar 3, 2019fix: update rule type frontmatter (#427)
Jan 29, 2019fix: update test case for rule "aria-hidden-focus" (#384)
Nov 12, 2018chore: remove selector `data-rule-target` (#347)
Oct 9, 2018Fix: testcase generation (#296)
Aug 30, 2018Chore: Update test cases format and descriptions (#230)
Jul 19, 2018Rule: SC4-1-2-aria-hidden-focus (#175)

Useful Links


Implementations

Tool NameCreated ByReport
AlfaSiteimproveView Report
Axe-coreDeque SystemsView Report

Acknowledgements