identical-iframes-same-purpose
Frames with the same name embed the same resource
Checks that <iframe>/<frame> elements sharing an accessible name embed the same resource, since one name can only describe one resource.
Applies to. Applies to each set of two or more <iframe>/<frame> elements that are included in the accessibility tree and share the same non-empty accessible name, compared with whitespace collapsed. A frame named only by a mechanism that names nothing, or hidden from the accessibility tree, is not part of a set; a set needs two surviving members to exist at all.
Expectation. Every frame in a set resolves to the same resource. A shared name describes one resource, so two frames answering to it must embed the same one.
What a finding reports.
name: the accessible name the frames share.resource: the address this frame embeds, as an absolute URL without its fragment. Empty (null) when itssrccould not be resolved (IFRAME_RESOURCE_UNRESOLVED).setSize: how many frames share the name.
These data.details fields help to read and reproduce a finding. Apart from reasonCode and the few fields Output schema names as stable, they are not a stable contract: a field may be renamed or dropped in a minor release, so don’t build on them.
Examples
<iframe title="Weather widget" src="https://example.test/weather"></iframe><iframe title="Weather widget" src="https://example.test/weather"></iframe>
Both frames share the name "Weather widget" and embed the same resource.
<iframe title="Weather widget" src="https://example.test/weather?city=nyc"></iframe><iframe title="Weather widget" src="https://example.test/weather?city=sf"></iframe>
Both frames share the same name but resolve to different resources — possibly two legitimately equivalent widgets, possibly a mislabeled frame; the markup alone doesn't settle it.
How to check
When this rule can’t decide, it reports cantTell and leaves the question to a person. Each question it can ask is listed here under its reason code, with the steps to answer it. A finding carries the same steps as howToCheck, in the scan’s language. See Output schema.
IFRAME_RESOURCE_DIFFERS
- Find the frames the report names and note the shared accessible name (usually their title).
- Look at what each frame shows and at its src address.
- Decide whether they do the same job (the same map or widget, with only tracking parameters differing) or different ones (two different videos).
Pass. The frames serve the same purpose, so sharing a name is fine.
Fail. The frames embed different content under the same name (such as two different videos both titled "YouTube video player"), so users cannot tell them apart, which fails WCAG 4.1.2 (ACT 4b1c6c).
IFRAME_RESOURCE_UNRESOLVED
- Find the frames the report names and note the shared accessible name.
- Scroll each frame into view so any lazy-loaded content loads, then inspect it for its src, data-src or srcdoc.
- Compare what each frame shows and decide whether they do the same job.
Pass. The frames serve the same purpose, so sharing a name is fine.
Fail. The frames show different content under the same name, so users cannot tell them apart, which fails WCAG 4.1.2 (ACT 4b1c6c).