Problem/Motivation
The <iframe>/<object>/<embed> elements output by the renderers have no title attribute. Screen reader users hear an unnamed frame and can’t tell which document it contains. This fails WCAG 2.x 4.1.2 Name, Role, Value (technique H64).
Steps to reproduce
Use a screenreader to access the document
Proposed resolution
Pass a document name into each renderer’s template and output it as the frame’s title.
Name source, in this order: the media entity’s label (when the field is on a media entity), then the file’s description, then the filename.
The change only adds a title attribute. Existing template overrides keep working, because a new theme variable is ignored by templates that don’t use it.
Remaining tasks
- Review
- Rebase once #3635944: Add GitLab CI and kernel test coverage for the PDF Reader formatter passes it depends, on that for test coverage
User interface changes
None
API changes
Adds a title variable to the pdf_reader, pdf_reader_embed (and any other affected) hooks.
Data model changes
None
Issue fork pdf_reader-3635968
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
whthat commented