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

[Draft - WPT F2F Example] - Accessibility Support - Image has non-empty accessible name [23a2a8] #2237

Open
giacomo-petri opened this issue Jan 29, 2025 · 0 comments

Comments

@giacomo-petri
Copy link
Collaborator

giacomo-petri commented Jan 29, 2025

Case 1 - Existing WPT testcase:

There are several popular browsers that do not treat images with an empty alt attribute (alt="") as having a role of presentation but instead add the img element to the accessibility tree with a semantic role of either img or graphic.

IMO, this is quite outdated. Also, when checking the WPT test for el-img-empty-alt, it shows consistent support.


Case 2 - Missing WPT testcase:

Images can have their role set to presentation through an empty alt attribute. Presentational Roles Conflict Resolution does not specify what to do if such an image is focusable (it only specifies what to do in case of explicit role="none" or role="presentation"). Some browsers expose these images and some don’t. Thus, this rule may fail for technologies that expose these without creating an accessibility issue for users of other technologies.

Also, this one, in my opinion, should be updated a bit. I'm fine with keeping the first part (raised a point in the WAI-ARIA group about that one - w3c/aria#2415), but I think we should change "Some browsers expose these images and some don’t," since major browsers now expose the element with a role of "image," which triggers the presentational roles conflict resolution.

I'm planning to create a PR for a WPT test for:

<img alt="" data-testname="focusable img[empty alt]" class="ex" tabindex="0" data-expectedrole="image">

returns the following locally:

  • Safari: Action get_computed_role completed with result image
  • Chrome: Action get_computed_role completed with result image
  • Firefox: Action get_computed_role completed with result image

which demonstrates consistent support.

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

No branches or pull requests

1 participant