Skip to content

Use aria-hidden for decorative SVG images#10986

Merged
aduth merged 5 commits intomainfrom
aduth-svg-role
Jul 26, 2024
Merged

Use aria-hidden for decorative SVG images#10986
aduth merged 5 commits intomainfrom
aduth-svg-role

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented Jul 25, 2024

🛠 Summary of changes

Updates decorative SVG images to use aria-hidden instead of role="img".

This builds upon #10200, and seeks to address the original issue while avoiding some incompatibilities between the role and expectations around decorative images.

This is partly motivated by errors surfaced by automated checking tools, e.g. Axe's aria-allowed-role or PageSpeed Insights.

Some background investigation leading to this:

📜 Testing Plan

Repeat testing plan from #10200

Optionally, run a scan using an accessibility tool like Axe to verify there are no errors.

changelog: Bug Fixes, Accessibility, Use aria-hidden for decorative SVG images
@aduth aduth requested a review from kevinsmaster5 July 25, 2024 20:15
@aduth aduth merged commit 5a01dc3 into main Jul 26, 2024
@aduth aduth deleted the aduth-svg-role branch July 26, 2024 14:22
mitchellhenke pushed a commit that referenced this pull request Jul 31, 2024
* Use aria-hidden for decorative SVG images

changelog: Bug Fixes, Accessibility, Use aria-hidden for decorative SVG images

* Fix error on missing key method

* Use positive check for selecting non-aria-hidden img

Co-authored-by: Zach Margolis <zachmargolis@users.noreply.github.com>

* Add explainer to accessibility matcher

* Update accessibility matcher name to match  new behavior

---------

Co-authored-by: Zach Margolis <zachmargolis@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants