Video: add aria-label for uncaptioned video in save function#70364
Video: add aria-label for uncaptioned video in save function#70364shubhtoy wants to merge 1 commit into
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @shubhtoy! In case you missed it, we'd love to have you join us in our Slack community. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
t-hamano
left a comment
There was a problem hiding this comment.
Thanks for the PR!
Unfortunately, I believe that labeling video elements as 'Uncaptioned video' makes no sense and would not improve anything in accessibility. I will close this PR and revisit the ideal approach.
What?
Closes #70297
Add
aria-labelto the<video>element in the Video block when no caption is provided.Why?
To improve accessibility for screen reader users. Previously, when a video block lacked a caption, screen readers would receive no contextual information about the video content. This change provides a default label
"Uncaptioned video"in such cases, improving clarity and compliance with accessibility standards.How?
captionattribute is empty usingRichText.isEmpty.aria-labelwith the value__('Uncaptioned video').aria-labelso the screen reader can rely on the figcaption.Testing Instructions
.mp4).<video>element includesaria-label="Uncaptioned video".aria-labelis no longer present when the caption exists.Screenshots or screencast
Before
No
aria-labelwhen no caption presentAfter
aria-label="Uncaptioned video"added to<video>element