Cover Block: fixed background image fails a11y test #49902
Labels
[Block] Cover
Affects the Cover Block - used to display content laid over a background image
[Focus] Accessibility (a11y)
Changes that impact accessibility and need corresponding review (e.g. markup changes).
[Status] In Progress
Tracking issues with work in progress
[Type] Enhancement
A suggestion for improvement.
Description
This is related to #30505 which was fixed and closed, but a slightly different issue.
When a regular background image is used in a cover block, the alt text is correctly added and displayed in an img tag. However, if the "Fixed background" or "Repeated background" options are checked, the img tag switches to a div with role="img". SiteImprove then flags it as not having alt text, because an element with role="img" is supposed to have alt text. This happens regardless of whether or not the image has alt text in the media library.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
Environment info
WP 6.2 using a custom theme. Gutenberg not installed, just using block editor.
Mac Chrome with SiteImprove extension.
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: