Make WordPress Core

Opened 9 years ago

Closed 6 years ago

Last modified 6 years ago

#34595 closed defect (bug) (fixed)

Add aria-describedby to improve image/caption relationship

Reported by: joedolson's profile joedolson Owned by: joemcgill's profile joemcgill
Milestone: 5.1 Priority: normal
Severity: normal Version:
Component: Media Keywords: needs-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 9 years ago.
Adds aria-describedby to captioned images

Download all attachments as: .zip

Change History (35)

@joedolson
9 years ago

Adds aria-describedby to captioned images

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


9 years ago

#2 @joedolson
9 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.


9 years ago

#4 @afercia
9 years 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.


8 years ago

#6 @afercia
8 years ago

  • Milestone changed from Future Release to 4.8

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

#7 @joedolson
8 years ago

  • Status changed from assigned to accepted

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


8 years ago

#9 @juliemoynat
8 years 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.


8 years ago

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


8 years ago

#12 @joemcgill
8 years 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
8 years ago

  • Keywords needs-refresh removed

Patch still applied cleanly for me.

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


8 years ago

#16 @joemcgill
8 years 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.


8 years ago

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


7 years ago

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.


7 years ago

#20 @jbpaul17
7 years ago

  • Milestone changed from 4.9 to 4.9.1

Per discussion in today's 4.9 bug scrub, we're punting this to 4.9.1.

#21 @johnbillion
7 years ago

  • Milestone changed from 4.9.1 to 5.0

#22 @SergeyBiryukov
7 years ago

In 42690:

Media: Convert concatenation in img_caption_shortcode() to sprintf() for clarity.

See #34595.

#23 @SergeyBiryukov
7 years ago

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

In 42691:

Media: Add aria-describedby to img_caption_shortcode() output to improve image/caption relationship.

Props joedolson.
Fixes #34595.

#24 @SergeyBiryukov
7 years ago

In 42692:

Media: Make sure $caption_id does not depend on an undefined variable.

See #34595.

#25 @SergeyBiryukov
7 years ago

In 42693:

Media: Only add aria-describedby in img_caption_shortcode() if a non-empty attachment ID attribute was provided.

See #34595.

#26 @SergeyBiryukov
7 years ago

In 42694:

Media: After [42693], update HTML4 markup in img_caption_shortcode() to avoid an empty ID attribute as well.

Add a unit test for aria-describedby in img_caption_shortcode().

See #34595.

#27 @SergeyBiryukov
7 years ago

In 42704:

Media: Pass original attribute values to img_caption_shortcode_width filter instead of markup pieces.

Add caption_id to the list of documented [caption] shortcode attributes.

See #34595.

#28 @SergeyBiryukov
7 years ago

In 42705:

Docs: Use code formatting for tags in img_caption_shortcode() DocBlock.

See #34595.

#29 @SergeyBiryukov
7 years ago

In 42706:

Media: In img_caption_shortcode(), make sure $id and $caption_id are always defined.

See #34595.

#30 @SergeyBiryukov
6 years ago

  • Keywords fixed-major added
  • Milestone changed from 5.0 to 4.9.9
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for 4.9.9 consideration, per the latest Accessibility team bug scrub meeting.

#31 @pento
6 years ago

  • Keywords fixed-major removed
  • Milestone changed from 4.9.9 to 5.1

Moving to 5.1. The comment added in [42704] will need to be updated.

#32 @pento
6 years ago

  • Keywords needs-patch added; has-patch removed

#33 @desrosj
6 years ago

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

In 44548:

Media: Correct since annotation for adding the caption_id attribute.

Introduced in [42704]
Fixes #34595.

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


6 years ago

Note: See TracTickets for help on using tickets.