-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should img
be named from content?
#1330
Comments
SVG title element does name an image (in ACCNAME step 2D). In the Yellow circle example, it may seem to make sense to allow name from content... however SVGs can have all sorts of text content, like all of the labels on a graph, or all of the instructions on a map, etc., which would result in a pretty verbose flat string that wouldn't be very useful as a name. I think that the best naming strategy for the Yellow circle example is to use aria-labelledby to point to the Yellow circle text element. |
role img has "Children Presentational: True", meaning that browsers may enforce them to be leaf objects. There would be no descendant content in the accessible tree. Since browsers use the accessible object subtree (and not DOM subtree), this might be a nonstarter. Changing Children Presentational to be false is probably a no go as well, as ATs expect an image to be a leaf. |
@carmacleod I understand that it uses title if one exists, but why not have it fallback to text content if any exists? @aleventhal I'm not suggesting to change presentational children. I agree with you that that could be problematic. But something can have presentational children and still be named from content. Buttons have this for example. |
Because if we did that, then the name of this SVG would be "2008 2009 2010 2011 2012 15 10 5 0 Weeks". |
This idea feels more like a suggestion for handling author errors, https://w3c.github.io/aria/#document-handling_author-errors. |
Hmm, that's a good point. It might work. Actually FYI neither Firefox nor Chrome enforce presentational children on buttons anymore, because there were too many cases where buttons had important interactive children. See issue #1174 . |
Can you explain why that would be? The way I understand it, the |
@WilcoFiers, Carolyn's example that you quoted has no |
@scottaohara My bad, but it does it have |
@WilcoFiers |
seems relevant since if it had a |
If an svg with @carmacleod is the point of what you're suggesting then to ensure that that svg is flagged as having invalid ARIA because |
Yes. [Edit: Actually, not quite sure what you mean by "flagged as having invalid ARIA"? The |
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:It seems a little counter-intuitive that the content of the
text
node isn't used to give thisimg
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?The text was updated successfully, but these errors were encountered: