Page MenuHomePhabricator

Add ARIA attributes to collapsible TOC sections
Closed, ResolvedPublic3 Estimated Story Points

Description

The TOC should surface expanded status to screenreaders, similar to the checkbox hack implementation.

Developer notes

  • Add aria-expanded to the button element, this should be updated automatically when the section is closed or opened
  • Add aria-controls to the button element, which points to the ul element
  • Add an id to the ul element to be used by aria-controls
  • Add descriptive text to the button element, i.e. "Toggle {section name} subsection"

Currently SkinVector::getTemplateData() calls SkinVector::getTocData() (populated by inheritance in Skin::getTemplateData() which uses the new componentRegistry system i.e. SkinComponentTableOfContents).

Historically it seems we use SkinVector::decoratePortletsData() (which calls SkinVector::decoratePortletData() for each portlet) to add accessibility labels for data portlets. Presumably we do the same thing to add them to the new sticky TOC?

AC

When navigating the TOC with assistive technology:

  • The arrow button should have a descriptive label
  • The arrow button should read out the expanded/collapsed status of it's corresponding section
  • The expanded/collapsed status should always be updated (i.e. after the button is clicked, or after a section is closed automatically)

QA Results - Beta|Prod

ACStatusDetails
1T303766#7849938
2T303766#7849938

QA Results - Beta|Prod

ACStatusDetails
1T303766#7859434
2T303766#7859434

Event Timeline

cjming updated the task description. (Show Details)
cjming subscribed.
Volker_E renamed this task from Add aria attributes to collapsible TOC sections to Add ARIA attributes to collapsible TOC sections.Mar 28 2022, 4:49 PM
Volker_E updated the task description. (Show Details)
bwang removed bwang as the assignee of this task.Mar 29 2022, 8:52 PM
bwang moved this task from Doing to Code Review on the Web-Team-Backlog (Kanbanana-FY-2021-22) board.

Change 774979 had a related patch set uploaded (by Bernard Wang; author: Bernard Wang):

[mediawiki/skins/Vector@master] Update sticky header to use aria attributes for section collapsing and add accessible label to toggle buttons

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

Change 777817 had a related patch set uploaded (by Bernard Wang; author: Bernard Wang):

[mediawiki/skins/Vector@master] Scope ULS styles to when language button is in header

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

Change 774979 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Update sticky header to use ARIA attributes for section collapsing and add accessible label to toggle buttons

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

Test Result - Beta

Status: ✅ PASS
Environment: beta
OS: macOS Monterey
Browser: Chrome
Device: MBP
Emulated Device:NA

Test Artifact(s):

QA Steps

When navigating the TOC with assistive technology:

✅ AC1: The arrow button should have a descriptive label
✅ AC2: The arrow button should read out the expanded/collapsed status of it's corresponding section
✅ AC3: The expanded/collapsed status should always be updated (i.e. after the button is clicked, or after a section is closed automatically)

Screen Recording 2022-04-12 at 3.51.36 PM.mov.gif (824×1 px, 442 KB)

Test Result - Prod

Status: ✅ PASS
Environment: enwiki
OS: macOS Monterey
Browser: Chrome
Device: MBP
Emulated Device:NA

Test Artifact(s):

QA Steps

When navigating the TOC with assistive technology:

✅ AC1: The arrow button should have a descriptive label
✅ AC2: The arrow button should read out the expanded/collapsed status of it's corresponding section
✅ AC3: The expanded/collapsed status should always be updated (i.e. after the button is clicked, or after a section is closed automatically)

Screen Recording 2022-04-16 at 2.03.49 PM.mov.gif (1×1 px, 833 KB)

ovasileva subscribed.

Looks good, resolving.