-
Notifications
You must be signed in to change notification settings - Fork 14
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.