Give every iframe a descriptive title
Every iframe needs a title attribute naming what is inside it. Booking calendar. Payment card form. Advertisement. W3C lists H64 as sufficient for 4.1.2 Name, Role, Value in combination with the general technique for exposing name and role. It is separately sufficient for 2.4.1 Bypass Blocks, where the frame is a repeated block somebody can skip, which is why an ad frame titled Advertisement does real work. The title names the frame rather than the content inside it, because its job is helping a person decide whether to go in. Three things get confused with each other here. The title attribute labels the frame for people, the name attribute labels it for scripts and window targeting and is never announced, and the title element inside the framed document names that document. All three should be there, because they do different jobs.
How we find it in an audit
An iframe with no title is one of the most reliable automated checks on the list, so a scanner handles that pass. The human pass is the values, because iframe, widget-container and vendor boilerplate all clear the machine and none of them answers the only question that matters, which is whether to enter this frame or move past it.
How affected users experience it
A checkout page usually carries several frames at once. Payment fields, a chat widget, an embedded video, an ad slot. A screen reader announces each one as it arrives. Titled, that is Payment card form, frame, and the person goes in. Untitled, it is frame, frame, frame, or a URL read aloud character by character, and finding the card number field inside the third anonymous frame is work nobody signed up for.
Passes vs. fails
Passes
<iframe src="https://pay.example.com/card" name="pay-frame" title="Payment card form"></iframe>Fails
<iframe src="https://pay.example.com/card"></iframe>How this gets tested
The W3C publishes test rules that define what a checker looks for here.
- Image button has non-empty accessible nameA tool can check this
- Link has non-empty accessible nameA tool can check this
- ARIA attribute is defined in WAI-ARIAA tool can check this
- ARIA state or property has valid valueA tool can check this
- Element with role attribute has required states and propertiesA tool can check this
- Form field has non-empty accessible nameA tool can check this
- Role attribute has valid valueA tool can check this
- ARIA state or property is permittedA tool can check this
- Button has non-empty accessible nameA tool can check this
- Element with aria-hidden has no content in sequential focus navigationA tool can check this
- Element with presentational children has no focusable contentA tool can check this
- Menuitem has non-empty accessible nameA tool can check this
- Summary element has non-empty accessible nameA tool can check this
- Iframe element has non-empty accessible nameA tool can check this
- Iframe elements with identical accessible names have equivalent purposeA tool finds candidates, you decide
- Bypass Blocks of Repeated ContentA tool finds candidates, you decide
- Document has heading for non-repeated contentNothing implements this yet
- Document has a landmark with non-repeated contentA tool can check this
- Block of repeated content is collapsibleNothing implements this yet
- Document has an instrument to move focus to non-repeated contentNothing implements this yet
Other ways to satisfy this rule
23 guides on this site are filed under 4.1.2 Name, Role, Value. W3C lists this one as sufficient for that rule only alongside G108, so the pair is what passes and neither half does on its own.
- ARIA4sufficientGive custom widgets a real ARIA role
- ARIA5sufficientExpose widget state with ARIA attributes
- ARIA14sufficientLabel icon-only controls with aria-label
- ARIA16sufficientName controls from visible text with aria-labelledby
- G10sufficientBuild custom components on accessibility-supported tech
- G108sufficientExpose name, role, and changes through markup
This guide is our interpretation of W3C technique H64: Using the title attribute of the iframe element. W3C publishes its techniques as guidance rather than as the standard, and says so on every one of them. The success criterion is what conformance is measured against, and a technique is one documented way to meet it.