WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#34583 closed defect (bug) (fixed)

Missing image alt attributes in core

Reported by: afercia Owned by: afercia
Milestone: 4.4 Priority: normal
Severity: normal Version: 4.3
Component: Administration Keywords: has-patch
Focuses: ui, accessibility Cc:

Description

Searched for all the <img occurrences in core and found some places where images miss an alt attribute. In some cases they're a minor issue I guess. Though it's invalid HTML5, they don't seem to cause major accessibility issues. In other cases the lack of the required alt attribute is more important. For example, in Press This, when adding a suggested image in the editor in HTML mode there's a chance users will save the content "as is" and output in the front-end a bit of invalid, not accessible, code:

https://cldup.com/Ifx8Whn2Wd.png

Worth noting as soon as users switch the editor to "Visual" mode, the alt attribute will be automatically added.

Other cases are really minor, for example the "locked post" dialog spinner:

https://cldup.com/MDvMw3lnll.png

Same for images used in the media templates, JavaScript templates, in TinyMCE, and so on.

It would be pretty easy to fix all the missing alt attributes, it's definitely not "rocket science", but I'm a bit unsure what to do here. Just one big patch to fix everything (have a patch already) or maybe specific tickets for each small bit of code that needs to be fixed? Any feedback more than welcome.

Attachments (2)

34583.patch (18.5 KB) - added by afercia 5 years ago.
34583.2.patch (18.5 KB) - added by afercia 5 years ago.

Download all attachments as: .zip

Change History (9)

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.


5 years ago

#2 @afercia
5 years ago

  • Milestone changed from Awaiting Review to 4.4
  • Owner set to afercia
  • Status changed from new to assigned

Forgot to mention two relevant cases:

  • the About page
  • the plugin contributors list in the Plugin detail modal dialog

@afercia
5 years ago

#3 @afercia
5 years ago

  • Keywords has-patch added

Uploaded patch for the "fix everything" approach.

@afercia
5 years ago

#4 @afercia
5 years ago

Refreshed patch. Adds an "Image preview" alt attribute to the image in the Image Editor (when resizing, cropping, etc.).

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.


5 years ago

#6 @joedolson
5 years ago

This looks sound to me; I didn't verify the usage context of every single image applied here, but the ones where the usage was pretty obvious were definitely good.

#7 @wonderboymusic
5 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 35567:

Accessibility: add missing alt attributes to a gaggle of <img>s.

Props afercia.
Fixes #34583.

Note: See TracTickets for help on using tickets.