-
Notifications
You must be signed in to change notification settings - Fork 27
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 an img with no src be mapped to role=img? #439
Comments
personally I agree with the webkit behaviour but until the mappings are fixed it seems reasonable to flag as an error in conformance checkers. |
It's less than 1% of pages for The same problem happens (with identical browser/AT results) where src is an empty string:
This is much more common (around 3-4% of pages) because it's easy to generate from templates like the following:
|
After discussion with the wg, seems we should treat this case as an implicit |
closes #439 This PR provides more detailed conditions for when an `img` element is mapped to the `img` role. This was originally brought up to address what should happen when an `img` lacks or has been given an `src` attribute set to the empty string, as HTML defines such instances as "representing nothing". However, in trying to just add in that condition, it made me realize the mappings were lacking additional nuance to how the element is exposed re: the existence of alternative naming mechanisms besides just `alt`.
Should the following (non-conforming)
img
element withoutsrc
and withoutalt
map torole=img
Chrome: nothing rendered on screen, but exposed as role=img
Firefox: nothing rendered on screen, but exposed as role=img
Safari: nothing rendered on screen, not in accessibility tree
The HTML standard and html-aam seem to be at odds here::
The HTML spec says:
https://html.spec.whatwg.org/multipage/embedded-content.html#the-img-element
The HTML spec defines "represents nothing" as meaning the element has no semantics.
This came up in the ACT Rules face-to-face meeting. Usually an
img
with no accessible name would be a SC 1.1.1 failure, but this looks hard to justify for<img/>
since there's no non-text content because there's no src.Does it make sense to add an element without content, and that's never rendered, to the accessibility tree?
The text was updated successfully, but these errors were encountered: