Opened 8 months ago
Closed 2 weeks ago
#27402 closed defect (bug) (fixed)
Add aria-describedby to image gallery output
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.1 | Priority: | normal |
Severity: | normal | Version: | 3.9 |
Component: | Gallery | Keywords: | has-patch 4.0-early commit |
Focuses: | accessibility | Cc: |
Description
With the addition of figcaption and figure support to gallery output, there's limited support for assistive technology to programmatically associate images with their descriptions. Adding aria-describedby to the output would improve cross-browser support as well as adding a programmatic relationship when figcaption/figure is not being used.
See: #26697
Attachments (4)
Change History (24)
comment:1
DrewAPicture
— 8 months ago
- Keywords 2nd-opinion added
- Milestone changed from Awaiting Review to 3.9
Seems like this would be a logical pairing with the HTML5 stuff added in #26697.
Looking at 27402.patch, should we not also add the attribute to the $captiontag/figcaption section a few lines down?
comment:2
joedolson
— 8 months ago
Yes; there are problems with this patch. I didn't look carefully enough at what the variables actually represented. I'll take another stab at it. Rally, the $selector-$id ID pair should be moved off $icontag and onto $captiontag.
Will upload update patch shortly.
comment:3
joedolson
— 8 months ago
Actually, I'm going to need to pass the aria-describedby parameter into the <img> element, otherwise, this won't work properly in screen readers. Will revise and update.
comment:4
joedolson
— 7 months ago
Patch updated. In order to make this work, I had to be able to pass an $attr array through wp_get_attachment_link into wp_get_attachment_image. Tested and works; hopefully I updated the docs appropriately, as well.
comment:6
nacin
— 7 months ago
- Keywords 4.0-early added
- Milestone changed from 3.9 to Future Release
I did some reading on this. I think it's a good change, but it came in a bit late for 3.9. (It also doesn't factor into the HTML5 caption stuff, as in it isn't critical to be paired with it.) Let's get this thoroughly tested and ship it in 4.0.
comment:7
DrewAPicture
— 6 months ago
- Keywords 2nd-opinion removed
27402.3.patch adds some coding standards stuff and clarifies the parameter description for $attr.
comment:8
wonderboymusic
— 7 weeks ago
- Milestone changed from Future Release to 4.1
$image_output = wp_get_attachment_link( $id, $size, false, false, false, $attr ); .... good times.
comment:9
ircbot
— 6 weeks ago
This ticket was mentioned in IRC in #wordpress-ui by _Redd. View the logs.
comment:10
ircbot
— 6 weeks ago
This ticket was mentioned in IRC in #wordpress-ui by _Redd. View the logs.
comment:11
rianrietveld
— 2 weeks ago
Added a refresh of 27402.3.patch (meaning version 3.patch in stead of 4.patch as I mentioned in the description with the patch)
comment:12
rianrietveld
— 2 weeks ago
- Keywords needs-testing added
comment:13
ircbot
— 2 weeks ago
This ticket was mentioned in IRC in #wordpress-ui by RianRietveld. View the logs.
comment:14
bramd
— 2 weeks ago
- Keywords needs-testing removed
Tested with NVDA + Firefox, works fine. However, be aware most users will read the page line by line (e.g. in virtual mode) en miss the semantic relation.
We can't fix that and just have to wait until fig and figcaption improves in user agents and assistive tech.
comment:15
arush
— 2 weeks ago
- Keywords needs-testing added
Expected behavior by screen reader users is that links are accessible in the tab order while captions are generally read using the arrow keys. Browsers are not passing the figcaption info correctly to the DOM yet, so this info isn't getting passed to screen readers. Nonetheless this is the correct way to use the standard and browsers/screen readers will catch up so I recommend this patch be passes.
comment:16
arush
— 2 weeks ago
Tested with VoiceOver and it works.
comment:17
arush
— 2 weeks ago
Tested with Jaws, see comment above concerning screen reader expected behavior
comment:18
rianrietveld
— 2 weeks ago
- Keywords needs-testing removed
comment:19
DrewAPicture
— 2 weeks ago
- Keywords commit added
comment:20
wonderboymusic
— 2 weeks ago
- Owner set to wonderboymusic
- Resolution set to fixed
- Status changed from new to closed
In 29914:
Add aria-describedby support to gallery output