Page MenuHomePhabricator

Accessibility Audit - Images Entry Points
Closed, ResolvedPublic3 Estimated Story Points

Assigned To
Authored By
KSarabia-WMF
Jul 22 2025, 4:29 PM
Referenced Files
F66025534: screenshot 26.mov.gif
Sep 16 2025, 5:24 AM
F66025526: screenshot 162.png
Sep 16 2025, 5:24 AM
F66025525: screenshot 161.png
Sep 16 2025, 5:24 AM
F66025524: screenshot 163.png
Sep 16 2025, 5:24 AM
F66025523: screenshot 165.png
Sep 16 2025, 5:24 AM
F66025522: screenshot 164.png
Sep 16 2025, 5:24 AM
F66025521: screenshot 166.png
Sep 16 2025, 5:24 AM
F66025516: screenshot 25.mov.gif
Sep 16 2025, 5:24 AM

Description

Description

Implement a horizontally scrollable image gallery for the entry point experiment, ensuring baseline WCAG compliance.

WCAG Compliance Checklist: Horizontal Scroll Gallery

  • All images have meaningful alt text or alt="" if decorative
  • Fully keyboard navigable (left/right arrows, tab/shift+tab)
  • Visible, high-contrast focus state on all interactive elements
  • Logical DOM order for sequential screen reader navigation
  • Responsive layout: gallery reflows at 320px (no horizontal scroll for text or UI)
  • All overlaid text/icons meet 4.5:1 contrast ratio against background
  • Swipe gestures have keyboard-accessible alternatives
  • ARIA roles and labels applied to all interactive elements

Context

Requirement

Implement a horizontally scrollable image gallery for the entry point experiment that meets baseline WCAG compliance. Accessibility must cover alt text, keyboard navigation (where applicable), focus visibility, logical DOM order, responsive layout at 320px, contrast ratios, ARIA roles/labels, and swipe gesture alternatives. The scope applies to horizontal scroll functionality on mobile, but must still account for accessible roles and labels on interactive elements. Missing alt text must be flagged, and captions or filenames may be used as fallback, translated to the page language.

BDD

Feature: Accessibility compliance for horizontal scroll image gallery

  Scenario: Images in the gallery provide meaningful alternative text
    Given an image is displayed in the horizontal scroll gallery
    When assistive technologies query the image
    Then the image must have a meaningful alt attribute or alt="" if decorative

  Scenario: Interactive elements support keyboard navigation
    Given a user navigates the gallery with a keyboard
    When tab, shift+tab, or arrow keys are pressed
    Then focus moves logically between interactive elements
    And focus state is visibly indicated with high contrast

  Scenario: Gallery reflows responsively at 320px width
    Given the viewport is resized to 320px
    When the gallery is rendered
    Then the layout must reflow without introducing horizontal scroll for text or UI

  Scenario: Overlay text and icons have sufficient contrast
    Given overlay text or icons are displayed in the gallery
    When contrast ratio is calculated against the background
    Then it must be at least 4.5:1

  Scenario: Swipe gestures have alternatives
    Given a user navigates using swipe gestures
    When the same action is attempted with a keyboard
    Then an equivalent keyboard-accessible interaction must exist

Test Steps

Test Case 1: Verify alt text compliance for gallery images

  1. Load the horizontal scroll image gallery on mobile
  2. Inspect each image element for alt attributes or role="none"/"presentation"
  3. AC1: Each non-decorative image has a meaningful alt attribute
  4. AC2: Decorative images use alt="" or appropriate ARIA role
  5. AC3: Alt text is derived from caption or file name if otherwise missing, and matches page language

Test Case 2: Verify keyboard accessibility of gallery navigation

  1. Navigate the gallery using Tab, Shift+Tab, and arrow keys
  2. Observe focus and interaction
  3. AC4: Focus moves logically between interactive elements in DOM order
  4. AC5: Focus state is visible and has a high-contrast indicator
  5. AC6: Carousel items are implemented as focusable <button> elements with accessible labels

Test Case 3: Verify responsive layout at 320px

  1. Resize viewport to 320px width
  2. Observe gallery layout
  3. AC7: Gallery reflows without horizontal scroll for text or UI

Test Case 4: Verify overlay text and icons contrast ratio

  1. Inspect any overlaid text/icons in gallery images
  2. Calculate contrast ratio against background
  3. AC8: Contrast ratio is ≥ 4.5:1

Test Case 5: Verify swipe gesture alternatives

  1. Attempt to navigate the gallery using swipe gestures
  2. Attempt the same navigation with keyboard
  3. AC9: Equivalent keyboard-accessible interaction exists for swipe gesture actions

https://phabricator.wikimedia.org/T400182#11183501

QA Results - Patchdemo

Event Timeline

ovasileva set the point value for this task to 3.Jul 22 2025, 4:47 PM
ovasileva moved this task from Incoming/Inbox to Ready on the Reader Growth Team board.
lwatson subscribed.
ovasileva lowered the priority of this task from High to Medium.Aug 5 2025, 4:33 PM

I'm reviewing the accessibility requirements and have a few clarifying questions:

Assumptions:

  • This audit focuses on horizontal scroll functionality and related components.
  • The audit excludes the vertical scroll because it is a work-in-progress.

Questions:

  1. Is the assumption correct that this audit is for the horizontal scroll UI only?
  1. Article images may or may not have alt text. Should we flag article images that lack alt text as accessibility issues, treat missing alt text, or can we exclude this from the audit scope?

All images have meaningful alt text or alt="" if decorative

  1. Given that this experiment targets mobile users, should we still include keyboard navigation requirements in the audit, or would you prefer to deprioritize this for now?

Fully keyboard navigable (left/right arrows, tab/shift+tab)

  1. Do the current designs include defined focus states for interactive elements? If not, should I note this as a gap in the audit?

Visible, high-contrast focus state on all interactive elements

  1. Based on the current designs, does the responsive layout requirement at 320px still apply?

Responsive layout: gallery reflows at 320px (no horizontal scroll for text or UI)

  1. The text contrast ratio requirement applies more to the vertical scroll (overlay), correct?

All overlaid text/icons meet 4.5:1 contrast ratio against background

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

[mediawiki/extensions/ReaderExperiments@master] ImageBrowsing: accessibility audit fixes

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

Converting Carousel items from <figure> elements to <button> elements in this patch resolved keyboard focus issues discussed earlier because buttons are natively focusable and support Enter key selection. This eliminates the scrollable content keyboard access requirement.

Remaining audit items are addressed in 1183242: ImageBrowsing: accessibility audit fixes

  • Add accessible button labels (image button)
  • Ensure all images have alt text or appropriate roles (role="none"/"presentation")

Many images don't have alt text. We can provide alt text by using the image caption or file name. Also, ensure the alt text is translated to match the language of the page content.

Change #1183242 merged by jenkins-bot:

[mediawiki/extensions/ReaderExperiments@master] ImageBrowsing: entry point accessibility audit fixes

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

Test wiki created on Patch demo by ETadros (WMF) using patch(es) linked to this task:
https://patchdemo.wmcloud.org/wikis/33e355bd3d/w/

Test wiki created on Patch demo by ETadros (WMF) using patch(es) linked to this task:
https://patchdemo.wmcloud.org/wikis/834cc4376b/w/

Test wiki created on Patch demo by ETadros (WMF) using patch(es) linked to this task:
https://patchdemo.wmcloud.org/wikis/2d9020e81e/w/

Test Result - Patchdemo

Status: ✅ PASS / ❓Need More Info
Environment: beta/enwiki
OS: macOS Sequoia 15.5
Browser: Chrome Canary (latest as of test date)
Device: MS
Emulated Device: NA

Test Case 1: Verify alt text compliance for gallery images

  1. Load the horizontal scroll image gallery on mobile
  2. Inspect each image element for alt attributes or role="none"/"presentation"
  3. AC1: Each non-decorative image has a meaningful alt attribute
  4. AC2: Decorative images use alt="" or appropriate ARIA role
  5. AC3: Alt text is derived from caption or file name if otherwise missing, and matches page language

Each of the images has an alt attribute

Vector
screenshot 155.png (1×3 px, 2 MB)
screenshot 156.png (1×3 px, 1 MB)

Per T400182#11152386 the alt attribute should match the text of the language. Using https://patchdemo.wmcloud.org/wikis/834cc4376b/w/index.php?title=%D7%95%D7%A8%D7%9E%D7%95%D7%A0%D7%98&wprov=rarw1 we can see that only some of the alt text is Hebrew. Is this acceptable? Are there reasons for the lack of Hebrew on specific images?

screenshot 156.png (1×3 px, 1 MB)

Minerva

screenshot 158.png (1×2 px, 838 KB)

None of the images in Minerva are int he correct language.

screenshot 159.png (1×2 px, 1 MB)

Test Case 2: Verify keyboard accessibility of gallery navigation

  1. Navigate the gallery using Tab, Shift+Tab, and arrow keys
  2. Observe focus and interaction
  3. AC4: Focus moves logically between interactive elements in DOM order
  4. AC5: Focus state is visible and has a high-contrast indicator
  5. AC6: Carousel items are implemented as focusable <button> elements with accessible labels

Screen video shows tab, then arrows, then shift-tab, AC3 images show that the carousel images are implemented as buttons.

Vector

screenshot 23.mov.gif (425×750 px, 3 MB)

Minerva

screenshot 24.mov.gif (674×692 px, 2 MB)

Test Case 3: Verify responsive layout at 320px

  1. Resize viewport to 320px width
  2. Observe gallery layout
  3. AC7: Gallery reflows without horizontal scroll for text or UI

I"m pretty sure this is a pass but just to bring it to your attention. At 320px on my machine I get a horizontal scroll bar for the viewport. At 323 the scrollbar is gone.

screenshot 157.png (1×328 px, 521 KB)

In Minerva I get the lowest width without a horizontal scroll bar at 335px

screenshot 25.mov.gif (530×352 px, 833 KB)

Test Case 4: Verify overlay text and icons contrast ratio

  1. Inspect any overlaid text/icons in gallery images
  2. Calculate contrast ratio against background
  3. AC8: Contrast ratio is ≥ 4.5:1

I couldn't get the color contract checker to work with the overlays for some reason. But for a sample of images in both light and dark mode, visually everything looked like it had sufficient contrast.

screenshot 166.png (248×1 px, 334 KB)

screenshot 164.png (355×1 px, 484 KB)

screenshot 165.png (391×1 px, 579 KB)

screenshot 163.png (305×1 px, 420 KB)

screenshot 161.png (305×1 px, 460 KB)

screenshot 162.png (307×1 px, 384 KB)

Test Case 5: Verify swipe gesture alternatives

  1. Attempt to navigate the gallery using swipe gestures
  2. Attempt the same navigation with keyboard
  3. AC9: Equivalent keyboard-accessible interaction exists for swipe gesture actions

See Test Case 2 for keyboard navigation.

screenshot 26.mov.gif (484×656 px, 2 MB)

@Edtadros Thanks for flagging these issues! I've addressed questions regarding alternative text, responsiveness, and contrast ratio below.

Alt Text:

  • We anticipated limited translations in the prototype since localization typically happens later in the development cycle. Please let me know if this understanding is incorrect. cc: @ovasileva @egardner
  • The poor alternative text quality stems from our current fallback to image filenames when proper descriptions aren't available.
  • I'm surprised to see translation differences between Vector and Minerva skins for the same content. Is this expected behavior?

Responsive layout at 320px:

  • This criterion conflicts with the current design, though I don't have the full context on when/why this design decision changed.
  • I believe it may be outdated and this criterion was based on an earlier design iteration. The current implementation intentionally maintains horizontal scrolling at all viewport widths, allowing users to browse the full image gallery.
    • Gallery does not reflow at 320px (as originally specified).
    • Users can horizontally scroll to view additional images regardless of viewport size.

Overlay contrast ratio:
Note: The overlay falls outside this audit’s scope

  • Your visual assessment suggests adequate color contrast.
  • Axe and Lighthouse tools scan elements present at page load. This excludes the dynamically rendered overlay content.
  • I verified manually that:
    • Icon-only buttons include proper aria-label attributes. This refers to the Overlay close button and DetailView controls ( share, download, link to Commons, and fullscreen).
    • All interactive elements are keyboard accessible via tabbing.
    • Image alt text is present.
  • Next steps: File a follow-up task to investigate alternative tools further or inspect computed colors manually for confirmation. Verification is challenging because exact colors are not used in the overlay text and background.

Let's file a follow-up task for general accessibility review of the entire feature.

I've filed a task over at T404743 for comprehensive accessibility review. We should pick it up next sprint.

Looks good, resolving!

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

https://patchdemo.wmcloud.org/wikis/2d9020e81e/w/

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

https://patchdemo.wmcloud.org/wikis/834cc4376b/w/

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

https://patchdemo.wmcloud.org/wikis/33e355bd3d/w/