Skip to content
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

SVG image role should align with HTML on missing versus empty alt #32

Open
cookiecrook opened this issue Nov 16, 2023 · 7 comments
Open

Comments

@cookiecrook
Copy link

In SVG-AAM section on Including Elements says unlabeled images should note be exposed and use the generic/none role, but implementations disagree. I think the implementation behavior is correct (currently returning the image role), and the spec should change to match...

A few reasons:

  1. Some screen reader users will want to know that an image is there, even if it is not labelled.
  2. Many AT users have some vision so forcing these to be excluded from the accessibility tree penalizes AT users who aren't fully blind. (No navigation stop for a sighted SR user, for example.)
  3. Machine vision is getting very good, and several tools (including VoiceOver and maybe others) can describe a lot of images despite them missing a label. But if the image weren't exposed to the tree at all, that may be more challenging.
@pkra
Copy link
Member

pkra commented Nov 16, 2023

Somewhat related: I had filed #25 a while back because aXe complained about image elements even when they have an aria-label.

@jcsteh
Copy link

jcsteh commented Dec 11, 2023

implementations disagree. I think the implementation behavior is correct (currently returning the image role)

Firefox currently implements this per the spec; i.e. it only exposes labelled images.

On one hand, it seems inconsistent to expose unlabelled HTML img but not unlabelled SVG image. On the other hand, why are image elements special in contrast to other SVG elements? We explicitly don't expose rect, circle, line, path, etc. if they're unlabelled. Do we want that to change as well? Some of the same arguments could apply here: low vision users, etc.

@jcsteh
Copy link

jcsteh commented Dec 11, 2023

It looks like Chrome also implements this per the spec, at least according to the WPT dashboard.

@cookiecrook
Copy link
Author

Yes, I agree that Firefox and Chrome are implemented to spec, but I think the spec is wrong here, and should match the precedence set in HTML for unlabeled images.

Given that SVG-AAM is not being maintained at the moment, we can move the specific test into a speculative directory or something to pull it out of the Interop 2024 Focus Area while the spec issue is being resolved.

@jcsteh
Copy link

jcsteh commented Dec 13, 2023

FWIW, I don't have an objection to this change, but as per my above comment, I think there should: a) be a good explanation documented here for why image is different to shapes (rect, circle, etc.) with respect to them being exposed when unlabelled; or b) be an equivalent change to shapes to expose them when unlabelled. b) doesn't seem ideal - it'd result in a whole bunch of unlabelled stuff - but I'm also finding it difficult to justify why image is different enough in the context of SVG to warrant different behaviour to shapes.

@cookiecrook
Copy link
Author

a good explanation documented here for why image is different to shapes (rect, circle, etc.) with respect to them being exposed when unlabelled

Quick answer: Unless you have a fully transparent or solid color image, there is always more information embedded in the pixel data of an image than in the vector data of an SVG shape. The spec requiring the engine to not expose them actively requires the engine suppress data from a blind user that sighted users will receive. There could be a similar shorthand to mark as decorative (Like HTML's alt=""), but without that de facto pattern, they should be passed through to the platform APIs.

@cookiecrook cookiecrook changed the title SVG-AAM spec says unlabeled images should use the generic/none role, but implementations and others disagree SVG-AAM spec says unlabeled images should use the generic/none role, but the HTML spec and WebKit disagree Jan 12, 2024
@cookiecrook cookiecrook changed the title SVG-AAM spec says unlabeled images should use the generic/none role, but the HTML spec and WebKit disagree SVG image role should align with HTML on missing versus empty alt Feb 7, 2024
@cookiecrook
Copy link
Author

There could be a similar shorthand to mark as decorative

Tentative WPT tests use an empty <title> element inside the <image> element.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants