aria icon indicating copy to clipboard operation
aria copied to clipboard

Should `img` be named from content?

Open WilcoFiers opened this issue 5 years ago • 13 comments

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?

WilcoFiers avatar Sep 30 '20 09:09 WilcoFiers