iframe-focusable-content

Frames with tabindex="-1" must not contain focusable content

automaticWCAG 2.1.1 (A)confidence: highseverity: moderateoperable

Checks that same-origin <iframe>/<frame> elements with tabindex="-1" do not contain focusable content, since browsers do not propagate that restriction into the frame’s embedded document.

Applies to. Applies to <iframe>/<frame> elements with an explicit negative tabindex, whose embedded document is same-origin and reachable via contentDocument (cross-origin/unreachable frames assert nothing, see implementation notes).

Expectation. The frame's embedded document contains no focusable element. Browsers do not propagate tabindex="-1" on the host <iframe> into its embedded document: Tab can still reach focusable content inside, even though the frame itself is skipped. An author who set tabindex="-1" intending to remove the frame from the tab order has not actually done so if the embedded document contains focusable content. Exception: an iframe with both a `width` and `height` HTML attribute of 2px or less (a common "tracking pixel" pattern) cannot render any perceptible content, so focusable content inside it never satisfies ACT akn7bn's "visible" requirement and doesn't count.

Examples

pass
<iframe tabindex="-1" width="300" height="150" srcdoc="<p>No focusable content</p>"></iframe>

`tabindex="-1"` removes the frame from the tab order, and nothing inside it is focusable either.

fail
<iframe tabindex="-1" width="300" height="150" srcdoc="<a href='/x'>Link inside</a>"></iframe>

The host frame is skipped by `tabindex="-1"`, but the link inside it is still reachable by Tab — the browser does not propagate the negative tabindex into the embedded document.

View source