SIA-R95<iframe>
element with interactive elements does not have a negative tabindex
Accessibility requirements
This rule tests conformance of the following accessibility requirements:
Description
This rule checks that <iframe>
elements which contain interactive elements do not have a negative tabindex
attribute.
Applicability
This rule applies to any <iframe>
element whose nested browsing context includes at least one element that is both visible and part of the <iframe>
's sequential focus navigation.
Note: An element is "included" in a nested browsing context if its owner document is the container document of that nested browsing context.
Expectations
- The test target does not have a negative
tabindex
attribute.
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
Setting the tabindex
attribute of an <iframe>
element to a negative value effectively excludes its content from the tab-order of the page. An element may be in the tab-order of an <iframe>
, but if the <iframe>
itself is taken out of the tab-order, the element is effectively keyboard inaccessible.
Each document, including documents inside an <iframe>
, has its own sequential focus navigation order. These focus orders are combined to get the page's global tab-order (called the flattened tabindex-ordered focus navigation scope). For an <iframe>
with a negative tabindex
, its sequential focus navigation order is not included in the page's global tab-order (as a consequence for the rules to build the tabindex-ordered focus navigation scope).
Examples
Passed
These <iframe>
elements do not have a tabindex
attribute that is a negative number
<iframe srcdoc="<a href='/'>Home</a>"></iframe>
<iframe tabindex="0" 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 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>
Acknowledgments
This document includes material copied from or derived from https://www.w3.org/WAI/standards-guidelines/act/rules/akn7bn/. Copyright © 2024 W3C® (MIT, ERCIM, Keio, Beihang).