question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: Add title attribute for iframes created from Wagtail embeds

See original GitHub issue

Is your proposal related to a problem?

Wagtail creates iframes without title with its EmbedBlock and embed chooser / rich text embed feature. iframes without title are just announced as “frame” for screen reader users, without any further details, which isn’t enough for them to determine what the frame contains, and decide whether to enter it or skip it.

Note: I believe this is also a problem with Wagtail’s embed template tag, which doesn’t seem to support setting a title.

Steps to Reproduce

  1. Create an embed, either with the EmbedBlock or rich text “Embed”
  2. Save / publish the page
  3. Access the page with a screen reader
  4. Try to navigate the page sequentially, or with region navigation (rotor for VoiceOver)

Technical details

  • Browser version: Latest Chrome and Safari with VoiceOver on macOS 10.14.

Describe the solution you’d like

I can see two potential fixes for this,

  • Either we add a “Title” field to both the embed chooser and the EmbedBlock, with relevant help text for editors (e.g. “Concise description of the embed for screen reader users – for example, title of the embedded content”)
  • Or we automatically populate the title based on the embed’s metadata. I believe embeds already have a title field, but I’m not sure whether it’s always filled, and if so with what kind of content

Describe alternatives you’ve considered

An alternative would be to create a custom Embed block / rich text feature that is more easily customisable / more screen-reader-friendly, however I believe this is better suited as an enhancement directly in Wagtail

Additional context

This might be further complicated by the fact that we might just be inserting the oembed / Embedly provided HTML into the template, rather than something crafted by Wagtail – in which case it would be good to see whether Wagtail can add a title in there, or otherwise we could:

  • Provide an opt-in way to use Wagtail’s own <iframe> generation instead of the platform-specific html.
  • At least document the fact that this is an issue.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
nimasmicommented, Oct 8, 2021

As far as I’m aware, the title attribute is the only valid way of describing the contents of an iframe, and that’s exactly what the above code does.

Then I suspect the Siteimprove report has been misrepresented. I found an article at https://www.wtamu.edu/siteimprove/inline-frame-without-text-alternative.html which equates the fault “Inline frame without a text alternative” with populating the title attribute.

I have asked for access to the Siteimprove report.

1reaction
thibaudcolascommented, Nov 6, 2020

Tagging @nimasmi who has recently fixed this on a project in a way I find quite elegant. We may need to validate with other core developers that they are happy with his approach being backported to Wagtail, if so this could be quite a nice fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Embedded content - Wagtail's documentation
Wagtail supports generating embed code from URLs to content on external providers such as Youtube or Twitter. By default, Wagtail will fetch the...
Read more >
Thibaud on Twitter: "In practical terms I found 2 content issues with it ...
Feature request : Add title attribute for iframes created from Wagtail embeds · Issue #5982 ·... Is your proposal related to a problem?...
Read more >
Be Sure to Provide Titles for Iframes | Accessibility Tips
Always Provide a Title for an Iframe​​ For iframes that have meaningful content, provide a title using the title attribute.
Read more >
Resizing wagtail embedded videos - Stack Overflow
in your base settings file add this WAGTAILEMBEDS_RESPONSIVE_HTML = True; In the template file you are using the embed with add these styles:...
Read more >
Add Title attribute to the iframe embed code - Jotform
I have also raised this as feature requests so the title attribute will be added to the iframe embed code by default. Then...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found