WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 11 days ago

#34595 assigned defect (bug)

Add aria-describedby to improve image/caption relationship

Reported by: joedolson Owned by: joemcgill
Milestone: 4.9 Priority: normal
Severity: normal Version:
Component: Media Keywords: has-patch
Focuses: accessibility Cc:

Description

See also #27402, where we added aria-describedby to gallery output. Probably should have thought to deal with captioned images at the same time!

Currently, there's minimal semantic relationship between the caption and the image, and none that will reliably be recognized by assistive technology. In theory figure and figcaption should provide a relationship, but this doesn't have adequate support.

In the HTML mode, no relationship exists at all. In HTML mode, I have doubts about the method to add aria-describedby used in this patch; str_replace feels dirty, but it would be backwards-compatible, where adding aria-describedby to the img element at input would only effect future images. In HTML4 mode, the relationship has to be between the img and the description, not the container, as in the figure relationship.

Attachments (1)

34595.patch (1.5 KB) - added by joedolson 2 years ago.
Adds aria-describedby to captioned images

Download all attachments as: .zip

Change History (19)

@joedolson
2 years ago

Adds aria-describedby to captioned images

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


2 years ago

#2 @joedolson
2 years ago

An alternate approach could be to use role='group' for this relationship. I'm not sure I like the approach, but could be convinced.

WAI on role=group: http://www.w3.org/WAI/tutorials/images/groups/#a-collection-of-images
Drupal ticket on this issue: https://www.drupal.org/node/2509700

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


16 months ago

#4 @afercia
16 months ago

  • Keywords needs-refresh added; dev-feedback removed
  • Milestone changed from Awaiting Review to Future Release
  • Owner set to joedolson
  • Status changed from new to assigned

'aria-describedby' looks simpler and effective, also for consistency with the gallery. Moving to future release and assigning @joedolson :) Probably needs a refresh.

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


9 months ago

#6 @afercia
9 months ago

  • Milestone changed from Future Release to 4.8

Moving to 4.8 as discussed in today's accessibility meeting.

#7 @joedolson
9 months ago

  • Status changed from assigned to accepted

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


6 months ago

#9 @juliemoynat
6 months ago

For information, in our French accessibility reference "RGAA" based on WCAG, we have to give "figure" tag a "role='group'" attribute.

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


5 months ago

This ticket was mentioned in Slack in #core-media by joemcgill. View the logs.


5 months ago

#12 @joemcgill
5 months ago

  • Milestone changed from 4.8 to 4.8.1

Lets move this to 4.8.1 per @afercia's suggestion in Slack.

#13 @desrosj
5 months ago

  • Keywords needs-refresh removed

Patch still applied cleanly for me.

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


5 months ago

#16 @joemcgill
4 months ago

  • Milestone changed from 4.8.1 to 4.9
  • Owner changed from joedolson to joemcgill
  • Status changed from accepted to assigned

Moving this to 4.9 for review.

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


3 months ago

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


11 days ago

Note: See TracTickets for help on using tickets.