-
Notifications
You must be signed in to change notification settings - Fork 4.8k
A11y: Decorative images in a figure element cause VoiceOver screen reader reading the file name. #75027
Copy link
Copy link
Open
Labels
Needs TestingNeeds further testing to be confirmed.Needs further testing to be confirmed.[Block] ImageAffects the Image BlockAffects the Image Block[Focus] Accessibility (a11y)Changes that impact accessibility and need corresponding review (e.g. markup changes).Changes that impact accessibility and need corresponding review (e.g. markup changes).[Status] StaleGives the original author opportunity to update before closing. Can be reopened as needed.Gives the original author opportunity to update before closing. Can be reopened as needed.[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Metadata
Metadata
Assignees
Labels
Needs TestingNeeds further testing to be confirmed.Needs further testing to be confirmed.[Block] ImageAffects the Image BlockAffects the Image Block[Focus] Accessibility (a11y)Changes that impact accessibility and need corresponding review (e.g. markup changes).Changes that impact accessibility and need corresponding review (e.g. markup changes).[Status] StaleGives the original author opportunity to update before closing. Can be reopened as needed.Gives the original author opportunity to update before closing. Can be reopened as needed.[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Type
Fields
Give feedbackNo fields configured for Bug.
Description
When you add an image in a post, it is put inside a
figureHTML element, which is a semantic HTML element.So, when the image is decorative, it should not be inside a
figurebut it is.So, VoiceOver, the screen reader for MacOS and iOS, does not ignore these images because the
figuretells that they're not decorative images. And VoiceOver reads the filename for the images because thealtattribute is empty (alt="").In order to fix it:
figcaptionelement) should be inside afigureelement;aria-hidden="true"attribute onfigureonly when the image has no alternative text.Step-by-step reproduction instructions
imgelement with emptyaltattribute (alt="") inside afigureelement);figure(with the browser inspector) and VoiceOver will ignore the image as it should do.Screenshots, screen recording, code snippet
Example of generated code to understand:
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.