Page MenuHomePhabricator

Ensures <img> elements have alternate text or a role of none or presentation.
Closed, ResolvedPublicBUG REPORT


Steps to Reproduce:

  1. Navigate to visual editor
  2. Navigate till "Insert" and navigate till "More" dropdown, hit enter.
  3. Navigate till "Gallery " control, hit enter.

Actual Results:
Image does not alternatate text or a role of none or presentation

Expected Results:
Image should have an alternate text or role of none or presentation

Event Timeline

Change 572336 had a related patch set uploaded (by Akinwale-microsoft; owner: Akinwale-microsoft):
[mediawiki/core@master] Fix: Add alt text to MediaResultWidget image

Change 578396 had a related patch set uploaded (by Akinwale-microsoft; owner: Akinwale-microsoft):
[mediawiki/extensions/VisualEditor@master] Fix: Prefill alt text with title name

This bug was initially created to address the issues related to gallery images results, a couple of talking points were spawned based on the implementation. Based on the comments, I've proposed an approach of making images uploaded to mediawiki more accessible.

Enforce the use of alt tag upon image upload: In this case, we force the user to specify an alternative tag when the image is upload if the image is not decorative. From a user's point of view, this approach ensures that all images in the gallery are accessible, the widget becomes useful to a user requiring assistive technology to understand the image. A short term fix for this allows us to provide this functionality through the mw.ForeignStructuredUpload.BookletLayout, but that only solves the problem only for the extensions that defer their upload functionality to this library. To solve this problem coast to coast, we might have to change the php implementation which is a breaking change. Giving the cost of implementation, this is not be best approach at the moment.

I would love to be able to force people to do something. But this is not how people work, any it is especially not how a community of volunteers works. Sorry, but there is no way this can happen.

Yes, we should make it possible to add alt texts to the media files on Wikimedia Commons, if a user is willing to do so. I'm pretty sure the WikibaseMediaInfo project will make this possible, when the foundation is ready. But we can not go back and somehow enforce the Commons community to retroactively add alt texts to the 60 million existing media files. So even if we can somehow change the communities behavior, and alt texts become the norm, how does this help in VisualEditor widget we are talking about here? The widget will still find the 60 million old images without alt texts. How are we going to present these to screenreaders?

I suggest to stick to the file name and mark the images in the gallery as not relevant for a screenreader user. What this effectively means is that the widget presents itself to a screenreader user not as a list of images, but as a list of filenames.

Change 578396 abandoned by Akinwale-microsoft:
Fix: Prefill alt text with title name

We no longer set the file name as the alternative text value of an image

Change 572336 merged by jenkins-bot:
[mediawiki/core@master] Fix: Add alt text to MediaResultWidget image