SIA-R95<iframe> elements with negative tabindex have no interactive elements

Accessibility requirements

This rule tests conformance of the following accessibility requirements:

Description

This rule checks that <iframe> elements with a negative tabindex attribute contain no interactive elements.

Applicability

This rule applies to any <iframe> element that has a negative tabindex attribute.

Expectations

  1. The nested browsing context of the test target does not include elements that are visible and part of the sequential focus navigation. An element is "included" in a nested browsing context if its owner document is the container document of that nested browsing context.

Assumptions

This rule assumes that interactive content inside <iframe> elements is used to provide functionality. If the interactive content does not provide functionality, for example a button that does nothing when clicked, success criterion 2.1.1 may be satisfied, even if the rule is failed.

Accessibility support

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

Background

By setting the tabindex attribute of an <iframe> element to -1 or some other negative number, it becomes impossible to move the focus into the browsing context of the <iframe> element. Even though its content is still included in the sequential focus navigation, there is no way to move the focus to any of the items in the <iframe> using standard keyboard navigation.

Examples

Passed

This <iframe> element contains no content that is part of sequential focus navigation:

<iframe tabindex="-1" srcdoc="<h1>Hello world</h1>"></iframe>

This <iframe> element contains a link that, because of its tabindex is not part of sequential focus navigation:

<iframe tabindex="-1" srcdoc="<a href='/' tabindex='-1'>Home</a>"></iframe>

This <iframe> element contains no visible content because of its small size:

<iframe
    tabindex="-1"
    width="1"
    height="1"
    srcdoc="<a href='/'>Home</a>"
></iframe>

Failed

This <iframe> element has a link that is part of sequential focus navigation:

<iframe tabindex="-1" srcdoc="<a href='/'>Home</a>"></iframe>

Inapplicable

This <iframe> element does not have a tabindex attribute that is a negative number

<iframe tabindex="0" srcdoc="<a href='/'>Home</a>"></iframe>

Acknowledgments

This document includes material copied from or derived from https://act-rules.github.io/rules/akn7bn/. Copyright © 2021 W3C® (MIT, ERCIM, Keio, Beihang).