Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image block accessibility improvements #42057

Open
glendaviesnz opened this issue Jun 29, 2022 · 3 comments
Open

Image block accessibility improvements #42057

glendaviesnz opened this issue Jun 29, 2022 · 3 comments
Labels
[Block] Image Affects the Image Block [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Status] In Progress Tracking issues with work in progress

Comments

@glendaviesnz
Copy link
Contributor

What problem does this address?

Currently if the Image does not have an alt tag, but does have a caption there is no semantic link between the image and caption in order for screen readers, etc. to make use of it.

Also, if an image is linked there is no semantic association between the link and image.

What is your proposed solution?

Use an aria-describedby to point to the existing caption if there is a caption. If there is no labeling information at all, we should not insert any; we just need to ensure that if there is labeling information available, it should be associated with the image, or the link if the image is linked.

@glendaviesnz glendaviesnz added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Block] Image Affects the Image Block labels Jun 29, 2022
@joedolson
Copy link
Contributor

Also, if an image is linked there is no semantic association between the link and image.

To clarify: There is a semantic association; a linked image is the accessible name for the link. The problem here is that if an image is linked, and has no alt attribute, then the link has no name. If an image has a caption, but no alt attribute, we can name the link by associating the caption with the link. If we're not going to implement a mechanism to enforce alt attributes on linked images, then this is the closest we can get to solving that accessibility issue.

@carolinan carolinan self-assigned this Aug 8, 2022
@carolinan
Copy link
Contributor

carolinan commented Aug 8, 2022

A simpler way would be to add the caption to the alt attribute if the alt is empty, but if you think it should use aria-describedby, I'll give that a go.

@joedolson
Copy link
Contributor

Semantically, it's more accurate to make the relationship between two things more consistent; and won't require as much duplication of code. I'd still go with the aria-describedby option.

@carolinan carolinan removed their assignment Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Image Affects the Image Block [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Status] In Progress Tracking issues with work in progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants