Conversation
changelog: Bug Fixes, Accessibility, Use aria-hidden for decorative SVG images
zachmargolis
approved these changes
Jul 25, 2024
Co-authored-by: Zach Margolis <zachmargolis@users.noreply.github.com>
kevinsmaster5
approved these changes
Jul 26, 2024
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🛠 Summary of changes
Updates decorative SVG images to use
aria-hiddeninstead ofrole="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-roleor PageSpeed Insights.Some background investigation leading to this:
aria-hiddenfor decoratives imagesrole="presentation"has an intended use-case for decorative images: "An element whose content is completely presentational (like a [...] decorative graphic"role="presentation"orrole="none"on an HTMLimgis equivalent to usingaria-hidden="true"."aria-hiddenaddresses the original bug📜 Testing Plan
Repeat testing plan from #10200
Optionally, run a scan using an accessibility tool like Axe to verify there are no errors.