Page MenuHomePhabricator

Image Browsing: Ensure carousel meets accessibility standards
Closed, ResolvedPublic5 Estimated Story Points

Description

Ensure the image carousel component meets accessibility standards, including screen reader support, keyboard navigation, and compliance with ARIA authoring practices for carousel widgets. The Aria Pattern Guide has an example gallery/carousel example that should be referenced here: https://www.w3.org/WAI/ARIA/apg/patterns/carousel/

Context

During the prototype phase, an accessibility audit (T404743) identified two unresolved issues specific to the carousel. As we scale this feature to production (T410786), these need to be addressed along with any other accessibility requirements for the new carousel implementation in its production codebase.

Known issues from prototype audit

  • Widget label: The prototype used "Image carousel" as the ARIA label. We should confirm the appropriate label for the production feature.
  • Next/previous navigation: ARIA authoring practices for carousel widgets recommend dedicated next/previous buttons. The prototype lacked these, making it difficult to browse images via keyboard or assistive technology — swiping is not available to all users.

VoiceOver image descriptions (iOS)

A community member reported (T408831) that iOS VoiceOver's on-device ML image descriptions do not work when images are wrapped in <button> elements. The prototype used buttons for interactive carousel thumbnails (since they trigger UI state changes rather than navigation), but iOS appears to only process <img> or <a> elements for its vision-based descriptions.

The production carousel markup needs to satisfy both concerns: correct semantic role for interactive images, and compatibility with iOS VoiceOver image descriptions. This may require testing different markup approaches on-device.

See: https://fr.wikipedia.org/wiki/Wikip%C3%A9dia:Le_Bistro/28_octobre_2025#c-Handisport_marmotte-20251028031000-EBlackorby-WMF-20251027192500

Additional considerations

  • Ensure carousel images have appropriate alt text
  • Keyboard focusability and navigation within the carousel
  • Sufficient touch target sizes for interactive elements
  • Behavior when carousel is empty or has only a few images

Open questions

  • Does the carousel need visible next/prev buttons, or can they be screen-reader-only? (Likely needs design input from @JScherer-WMF)
  • See T408831 for a related VoiceOver issue with image markup that may also apply to carousel thumbnails

Related

  • Prototype accessibility audit: T404743
  • Detail view accessibility will be tracked separately

Event Timeline

egardner triaged this task as Medium priority.Nov 21 2025, 8:22 PM
egardner renamed this task from Image Browsing post-MVP: accessibility improvements to Image Browsing: Ensure carousel meets accessibility standards.Feb 24 2026, 11:41 PM
egardner added a project: Accessibility.
egardner updated the task description. (Show Details)
egardner added a subscriber: JScherer-WMF.
HSwan-WMF set the point value for this task to 5.Mar 31 2026, 4:48 PM
SherryYang-WMF lowered the priority of this task from High to Medium.May 20 2026, 12:27 AM

Change #1290786 had a related patch set uploaded (by LWatson; author: LWatson):

[mediawiki/extensions/MultimediaViewer@master] Image Browsing: add URL param to enable carousel for testing

https://gerrit.wikimedia.org/r/1290786

lwatson changed the task status from Open to In Progress.May 21 2026, 2:12 PM
[WIP] Notes
  • Regarding issues with prototype wrapping images in <button> tags, the scaled version wraps the images in anchor tags (<a>). To ensure the images inside an anchor tag are accessible, the links must have an accessible name so screen readers know their destination. The image's alt text acts as an accessible name for the link surrounding it. Reference: https://www.w3.org/WAI/WCAG22/Techniques/html/H30
    • Current code: carousel is an unordered list, and each carousel item is a list item with a link wrapping an image element.
    • For images with alt text, the screen reader announces: "link, image, [alt text]".
    • For images without alt text, the screen reader announces: "link, "File:[Filename]".
    • Consider adding an aria-label to the anchor tag for images without alt text. The screen reader announces: "link, [label/descriptive text]". This approach allows us to strip file extensions and underscores from the file name.
    • Ensure proper semantics and label for carousel and consider landmark roles https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/
Lighthouse audit

Note: Chrome DevTools provides the auditing tool. The scores are out of 100, and we aim for 90 or better.

Baseline audit report: 89 Accessibility / 54 Best Practices
Issue: Links do not have a discernible name

  • Addressed the issue by providing accessible names to the links/anchor tags.
  • Ran the audit again and confirmed improvements in scores: 93 Accessibility / 73 Best Practices
  • Remaining issues are outside of the scope of the carousel, for example, 1) Minerva's menu bar (Form elements do not have associated labels) and 2) blue links in the article (Links rely on color to be distinguishable).
Keyboard navigation

Navigation between carousel items using Tab/Shift+Tab.

Carousel widget naming

Considering that our carousel uses native scroll, not the ARIA carousel pattern. The carousel name could be misleading to screen readers, as it could set incorrect interaction expectations, such as arrow-key navigation between slides. The name is pending/to be determined.

Screen reader
Desktop (macOS)
  • Testing on macOS with VoiceOver based on patchset 1:
    ImageBrowsing carousel a11y screen reader Mona lisa 1.png (1,244×308 px, 121 KB)
    ImageBrowsing carousel a11y screen reader Mona lisa 2.png (1,288×288 px, 134 KB)
    ImageBrowsing carousel a11y screen reader Mona lisa 3.png (1,268×296 px, 147 KB)
Mobile (iOS)

Test on mobile device via patchdemo with URL params to enable the carousel. Example: https://fafde56dd0.catalyst.wmcloud.org/wiki/Mona_lisa?useformat=mobile&mobileCarousel=1

  • Navigation to next/previous carousel image via swipe with VoiceOver.
  • The carousel label, "Images in [article name]", is announced.
  • The images are announced as link images ("Link, image") when alt text is present.
  • The active list item number of total items is announced when the link has an accessible label.
  • Next step: Explore adding an accessible label to the links unconditionally.

Mona Lisa article with screen reader caption:
[video too large to upload]

Image 1 of 23Image 2 of 23Image 3 of 23
{F83494397}{F83494441}{F83494472}

my ideal proposal for the widget label would be:  "list: Images in [article name], XX items"

  • if article name adds nontrivial work, we can just say "article"
  • if number of images adds nontrivial work, then skip altogether

@JScherer-WMF feel free to adjust too

with respect to:

Ensure carousel images have appropriate alt text

scope for launch should be just testing that carousel images inherit existing alt text. if editors haven't added alt text for an image currently showing in the article, the image can also show in the carousel still.

and with respect to:

Does the carousel need visible next/prev buttons, or can they be screen-reader-only?

@JScherer-WMF confirmed during standup that they'll be screen-reader-only

Change #1290939 had a related patch set uploaded (by LWatson; author: LWatson):

[mediawiki/extensions/MultimediaViewer@master] Image Browsing: add accessible labels to carousel elements

https://gerrit.wikimedia.org/r/1290939

Test wiki on Patch demo by LWatson-WMF using patch(es) linked to this task was deleted:

https://e675019bcc.catalyst.wmcloud.org/wiki/Main Page

Test wiki on Patch demo by LWatson-WMF using patch(es) linked to this task was deleted:

https://c4c4738cbd.catalyst.wmcloud.org/wiki/Main Page

Test wiki created on Patch demo by KSarabia-WMF using patch(es) linked to this task:
https://9f3a44f650.catalyst.wmcloud.org/w/

QA Instructions

Patch Demo: https://9f3a44f650.catalyst.wmcloud.org/wiki/Paris?useskin=minerva&mobileCarousel=1

Turn on VoiceOver
  1. Navigate to the carousel by swiping, not tapping
  2. Use one-finger swipe right/left to move through elements.
  3. Do not rely only on tapping visually, because the accessibility question is whether a screen-reader user can discover and operate the carousel through the accessibility tree.
  4. You want to hear something like:

“Images in Mona Lisa”
“list”
“23 items”
“link, image, [description/alt text]”
“Image 1 of 23”


Exact phrasing may vary, but the important parts are
  1. The carousel/list has a meaningful label.
  2. The user knows these are article images.
  3. Each image/link has an accessible name.
  4. The current item position is announced, ideally like “1 of 23.”
  5. Images with alt text announce useful alt text.
  6. Images without alt text still announce something usable, likely a cleaned-up filename or fallback label.

Change #1296578 had a related patch set uploaded (by Matthias Mullie; author: Matthias Mullie):

[mediawiki/extensions/MultimediaViewer@master] A11y improvements

https://gerrit.wikimedia.org/r/1296578

Change #1296578 abandoned by Matthias Mullie:

[mediawiki/extensions/MultimediaViewer@master] A11y improvements

https://gerrit.wikimedia.org/r/1296578

Change #1296632 had a related patch set uploaded (by Matthias Mullie; author: LWatson):

[mediawiki/extensions/MultimediaViewer@wmf/1.47.0-wmf.5] Image Browsing: add accessible labels to carousel elements

https://gerrit.wikimedia.org/r/1296632

Change #1290939 merged by jenkins-bot:

[mediawiki/extensions/MultimediaViewer@master] Image Browsing: add accessible labels to carousel elements

https://gerrit.wikimedia.org/r/1290939

Change #1296632 merged by jenkins-bot:

[mediawiki/extensions/MultimediaViewer@wmf/1.47.0-wmf.5] Image Browsing: add accessible labels to carousel elements

https://gerrit.wikimedia.org/r/1296632

Mentioned in SAL (#wikimedia-operations) [2026-06-03T08:05:32Z] <mszwarc@deploy1003> Started scap sync-world: Backport for [[gerrit:1296632|Image Browsing: add accessible labels to carousel elements (T407793)]]

Mentioned in SAL (#wikimedia-operations) [2026-06-03T08:22:45Z] <mszwarc@deploy1003> mlitn, mszwarc: Backport for [[gerrit:1296632|Image Browsing: add accessible labels to carousel elements (T407793)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2026-06-03T08:37:43Z] <mszwarc@deploy1003> Finished scap sync-world: Backport for [[gerrit:1296632|Image Browsing: add accessible labels to carousel elements (T407793)]] (duration: 32m 11s)

QAed on test wiki with Android's TalkBack: seems to work fine ✅

Assuming this task is about the MediaViewer code project, hence adding that project tag so other people who don't know or don't care about team tags can also find this task when searching via projects or looking at workboards. Please set appropriate project tags when possible. Thanks.

Change #1290786 abandoned by LWatson:

[mediawiki/extensions/MultimediaViewer@master] Image Browsing: add URL param to enable carousel for testing

Reason:

the URL param is no longer needed

https://gerrit.wikimedia.org/r/1290786

Test wiki on Patch demo by KSarabia-WMF using patch(es) linked to this task was deleted:

https://9f3a44f650.catalyst.wmcloud.org/w/

Test wiki on Patch demo by LWatson-WMF using patch(es) linked to this task was deleted:

https://fafde56dd0.catalyst.wmcloud.org/wiki/Main Page