WICG / WICG/PEPC

exclude decorative icons from the accessibility tree

Open
#91 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Bikeshed
Stars
72
Forks
15
PR merge metrics
No merged PRs in 30d

Description

This is Chrome 144's implementation of <geolocation>:

<geolocation>
<!-- shadow-root -->
  <div pseudo="-internal-permission-container">
    <span id="permission-icon" pseudo="permission-icon">
      <svg xmlns="http://www.w3.org/2000/svg" height="100%" viewBox="0 -960 960 960" width="100%" display="block">
        <path d="M480-480q33 0 56.5-23.5T560-560q0-33-23.5-56.5T480-640q-33 0-56.5 23.5T400-560q0 
33 23.5 56.5T480-480Zm0 294q122-112 181-203.5T720-552q0-109-69.5-178.5T480-800q-101 
0-170.5 69.5T240-552q0 71 59 162.5T480-186Zm0 106Q319-217 239.5-334.5T160-552q0-150 
96.5-239T480-880q127 0 223.5 89T800-552q0 100-79.5 217.5T480-80Zm0-480Z"></path>
      </svg>
    </span>
    <span pseudo="-internal-permission-text">Use location</span>
  </div>
</geolocation>

In the accessibility tree it looks like this:

button "Use location focusable: true
  image ""
  StaticText "Use location"
    InlineTextBox "Use location"

Unnamed images leave non-sighted users wondering what they're missing. In this case, the icon shouldn't have a name, it's decorative, an extra visual signifier accompanying the text, and should be excluded from the accessibility tree.

VoiceOver (macOS 15.7.3) says "Use location, button, group" and you can navigate within the control, finding the unnamed image followed by the "Use location" text. I believe if the image is not in the accessibility tree, VoiceOver won't categorize the button as also a group. Other assistive technologies may behave differently.

The icon could be excluded by adding aria-hidden="true" to the svg or to span#permission-icon, I don't know if there's precedent for using attributes from the ARIA spec in user agent elements. Instead of an inline SVG, it could be a decorative <img> with the SVG in a data URI (<img alt="" src='data:image/svg+xml;utf8,<svg …) but fill: currentColor likely wouldn't work. Example.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the Chrome 144 shadow markup in the issue and reproducing the shown accessibility tree with VoiceOver or another assistive technology. Compare the exposed permission-icon element with the intended control semantics, then verify that the decorative icon is absent while “Use location” remains available as the button’s text.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
accessibility
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.