aria
aria copied to clipboard
Should `img` be named from content?
This came up during the AGWG call when discussing the svg element with explicit role has non-empty accessible name ACT rule. Why should an img only be named from author? Take the following example:
<svg xmlns="http://www.w3.org/2000/svg" role="img" width="100" height="100">
<circle cx="50" cy="50" r="40" fill="yellow"></circle>
<text x="50%" y="50%" dominant-baseline="middle" text-anchor="middle">
Yellow circle
</text>
</svg>
It seems a little counter-intuitive that the content of the text node isn't used to give this img an accessible name. Definitely if there is a title element, or aria-label that should be used, but absent those, wouldn't it make sense to use text content if there is any?