-
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
Ambiguous whether <img alt=""> should negate the tree inclusion of accessible SVG content #290
Comments
My personal opinion is that there should be several different conflict resolutions. Listing a few here, starting with the first example above:
<img src="foo.svg" alt=""> <!-- alt="" may be accidentally applied (e.g. by the CMS) so ignore when the linked image content contains its own accessibility information -->
<svg>
<title>An accessible title</title>
<circle cx="50" cy="50" r="50">
<title>Some accessible content.</title>
</circle>
</svg>
<img src="foo.svg" alt="" aria-hidden="true"> <!-- all subtree content hidden, even though it's in a different document root -->
<img src="foo.svg" alt=""> <!-- ambiguous until linked contents reveal no accessible content -->
<svg aria-hidden="true"> <!-- unambiguously hidden in the SVG -->
<title>An accessible title</title>
<circle cx="50" cy="50" r="50">
<title>Some accessible content.</title>
</circle>
</svg> |
WebKit is unique in exposing any accessible content from a document linked via However, if you do allow that an I'm not going to get into the debate about whether To me, the most important part, is that the For clarity, the section on the mapping for |
I think the only reason other browsers don't expose SVG accessibility is just because they haven't gotten around to it yet.
IMO, that's clearly an oversight/error in the spec, but I'm open to conflicting opinions if there's a case for it.
For leaf node images, I'd agree. For linked accessible content, like some SVGs (a few accessible SVG examples) I don't agree that If you'll forgive the tangent, many CMS tools include I think the linked accessible SVG is another case where the heuristics are more nuanced than "trust the author." A significant percentage of web browser code and spec language is intended to fix problems when authors do things the wrong way. I hope we all agree that authors sometimes use
I don't agree with this. I suspect it will result in a worse behavior in more cases for users of assistive technology. Priority of constituencies indicates we should prioritize the needs of users over the needs of authors... In this case, the cost to a user (potentially making content inaccessible accidentally) is worse than the cost to the author (minor inconvenience to hide the content more explicitly), so we should err on the side of the user. |
@cookiecrook use of |
And for this reason, I've actually argued before that maybe the spec should ease up on the expectation that empty alt means completely hidden content. But if so, that should be discussed in general, for all images (e.g., so that the undescribed image could be exposed with a prompt to use an image recognition service to generate a description). There shouldn't be one behavior for raster images and another for SVG. HTML Authors often use SVG files without editing or examining the code, and extracting text from that file may be no more helpful than using the file name. |
I'm finding that if referencing an SVG with accessible content via an image element that no browser allows for the traversal of the svg conent, including Safari. This meets the expectation I've always had for svgs rendered via the FWIW, if browsers were to change their behavior and treat closing for now. can reopen in the future if things do in fact change. |
Reopening.
The reason Safari/VO doesn't is in part because of an artifact that I think Chromium, Gecko, and WebKit would all agree to change if we agreed on the specific circumstances that would result in the accessible SVG contents being exposed to the containing HTML document. |
Here's an example of interactive SVG content that IMO would be useful to have as a cross-referenced external image rather than inline markup. https://cookiecrook.com/longdesc/svg/ |
thanks for the additional info and reopening, @cookiecrook it does sound like an actual discussion around this needs to happen then. i think that'd be a good idea. |
There are a number of WebKit bug reports related to SVG, and one of the recurring themes is differences of opinion of what should happen when accessible SVG content is linked in the context of an otherwise presentational
<img>
element. For example:Some argue that
alt=""
should override the accessible contents of the image, effectively making the SVG behave as if it hadaria-hidden="true"
applied. From the authoring perspective, that's an easy solution, but ignores the fact that authors (and more often, inclusion contexts like a CMS) get accessibility wrong. From a user perspective, it's undesirable that a simple authoring mistake might make otherwise accessible content now inaccessible.I think there are two relevant spec sections, linked below. However, my initial read is that neither of them covers the case mentioned, and so there is probably some ambiguity.
alt=""
.If there is not other spec section covering this, I'd propose that one (HTML-AAM) or both (HTML-AAM and SVG-AAG) of the mapping documents be updated to address the ambiguity. I think HTML may be a slightly better location, because the concept of images with embedded accessible content is not exclusive to SVG... HTML could address this more generally as something "linked image files with accessible content, including but not limited to SVG."
The text was updated successfully, but these errors were encountered: