-
Notifications
You must be signed in to change notification settings - Fork 50
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
Disallow role of textbox on img elements #166
Comments
i'd agree with this and venture to say there are other roles that make no sense to be allowed on an image element. however, to keep this issue focused, the only addition to this that i'd suggest is also disallowed would be |
Would you like me to open another issue for the other roles? Essentially anything that requires children with roles of their own—like a |
yeh, those sorts of roles are exactly what i was thinking, and then was like "well what if someone uses |
So the way the table is setup right now, excluding roles from the element is largely done by indicating what roles are allowed. Here is the listing of the ARIA roles (from the ARIA 1.2 WD) I've come up with that could/should be allowed (note this would need to be revised further once more roles land in the latest published version. it'd also possibly warrant a note saying "the
Separating out a bit more, I think there could be an argument for these. However, allowing would not help in discouraging images of text:
For comparative purposes, these are the roles that should be excluded:
more than happy to get other opinions / thoughts on this current breakdown. I was trying to be generous in the "this could be allowed" category... though I personally find even some of those allowances to be suspect in reasonable practicality. Also, the more I think on this, I'm thinking more roles really should fall into the not allowed category...especially those that would typically consist of a lot of text, as it'd stand to reason to try and veer people away from practices that would be bad for accessibility in general (images of text being masked as content that should allow for zooming w/out loss of quality, for example) |
@scottaohara wondering about |
Was doing the same thing. I guess a |
Sorry @scottaohara , but why not banner? |
The ARIA spec says the following about the banner role:
What part of that do you think an |
Hi @ZoeBijl, |
includes (see: contains) is different than is. as @ZoeBijl mentioned, a |
Hi @scottaohara On the other hand I think there is concept misunderstanding here. One thing is the definition of "Site-content" which is the one that includes things such as search tools (forms), and other different is a banner, which is defined as Site-content, but obviously not as a search tool. Talking about search tools, I think that if role="search" can be applied to a form, role="banner" can perfectly be applied to an img. That said, I totally agree with you that all those other roles that you propose to be exclude do not make any sense on an img, in my undestanding. |
To make sure we’re all talking about the same thing: with the As an example, the top bar of GitHub which includes its logo, a search form, some links, and the profile menu is a Am I missing something? |
However guys, don't get me wrong. I'm not saying that your assertion is wrong, in fact I've been looking for a little more info and I found this:
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Banner_role Also the W3C reference says:
So yes, banner role does not fit the banner concept which I was used to: a site sponsor image. Thanks |
Thanks @ZoeBijl , now it's clear ;) |
closes #166 this PR does the following: * limits the allowed roles on an `img` with `alt=some_text`. * limits the disallows roles, or limits the allowed roles on an `img` without an `alt` attribute based on whether it is provided an accessible name via other means.
The ARIA in HTML specification already imposes this limitation on
img
-elements without analt
-attribute. Unless someone can come up with a good example of where this would be useful, I think it makes sense to disallow thetextbox
-role from being used onimg
-elements with analt
-attribute, too.As an example of potential usability, @stevefaulkner mentioned a read-only textbox. If that were indeed a valid (and valuable) situation to cater to it might be worth requiring
aria-readonly
when setting thetextbox
role on animg
.The text was updated successfully, but these errors were encountered: