Page MenuHomePhabricator

Heading structure & ordering in (new) DOM structure
Closed, ResolvedPublic5 Estimated Story Points

Description

With new DOM structure enabled in T261802: Switch to header-first DOM and with feedback provided by AFB T263834: Test new header-first DOM with screenreader users it's time to revisit
heading order.

Citing from AFB's report:

New DOM structure:
https://en.wikipedia.org/w/index.php?useskinversion=2

  • The new DOM structure for the main page has a strange heading layout which may confuse a screen reader user.
    • Page starts with level 3 heading which contains a search field. followed by level 2 heading with the 'Navigation Menu' and then the 'main landmark From today's featured article' as a level 2 heading.

Heading document outline (Vector modern)

Current outline after moved personal toolsPS 13
image.png (1×1 px, 95 KB)
image.png (1×1 px, 85 KB)

In comparison Vector legacy:

image.png (1×1 px, 77 KB)

AFB's suggestions:

  1. The Search field doesn't have to be wrapped within heading because the screen reader user can easily get to it using the landmark keyboard shortcut by pressing letter 'd' on the keyboard.
  2. Similarly, the items within the 'Navigation menu' heading are also part of the landmark region which can easily be navigated by screen reader user.
  3. Either bring the 'Navigation menu' heading further down in the page after the level 1 heading or remove the level 2 heading 'Navigation menu' completely and leave the 'Namespaces and Views' navigation landmark region items at the top without the heading.

Further explanation of why semantic heading structure is important to screenreaders.

AC

Check following conditions in a screenreaders like VoiceOver or Jaws/NVDA for Windows.

  • All changes above will be scoped to modern Vector only
    • The "Navigation menu" h2 element is not read out when reading through this section removed in Vector modern
    • The h3 in all navigation menus (i.e. user links menu, menus in the side bar, language variant, the "more" menu, etc) will not be read out are output as strong element in Vector modern
    • The "Search" h3 is not read out when reading through the search box
    • Menu h3s are not read out to screen readers, and the heading structure is simplified.

A simple way to confirm the changes above is to check the heading structure in your screen reader, it should only show the headings of a particular article.
Before: https://jmp.sh/XDb6iG8
After: https://jmp.sh/q1MaRwi
Also ensure that the other landmarks didn't change because of this change: https://jmp.sh/M40HRCR

QA Results - Beta

QA Results - Prod

Related Objects

StatusSubtypeAssignedTask
ResolvedGoalovasileva
ResolvedJdlrobson
Resolvedovasileva
ResolvedSpikeovasileva
ResolvedSpikephuedx
Resolvedovasileva
ResolvedSpikeVolker_E
ResolvedSpikeovasileva
Resolvedovasileva
ResolvedBUG REPORT matmarex
Resolvedovasileva
ResolvedJdlrobson
Resolvedphuedx
Resolved nray
ResolvedMayakp.wiki
ResolvedMayakp.wiki
Stalledovasileva
DeclinedNone
ResolvedEdtadros
InvalidNone
DeclinedNone
Resolvedovasileva
Resolved nray
ResolvedJdlrobson
Resolvedovasileva

Event Timeline

bwang set the point value for this task to 5.

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

[mediawiki/skins/Vector@master] Remove extraneous headings in search and menus

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

Jdlrobson subscribed.

There is a patch and discussion on the patch so this should be in the board

Jdlrobson assigned this task to bwang.
Jdlrobson added a subscriber: bwang.

Talked to Bernard and this needs some analysis/conversation before it can continue. Marked patch as WIP

ovasileva triaged this task as Medium priority.Jun 7 2021, 2:14 PM

Change 692705 abandoned by Bernard Wang:

[mediawiki/skins/Vector@master] Remove extraneous headings in search and menus

Reason:

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

Change 692705 restored by Bernard Wang:

[mediawiki/skins/Vector@master] Remove extraneous headings in search and menus

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

Jdlrobson moved this task from Triaged but Future to unsed on the Web-Team-Backlog board.

Reviewing PS 13: With our move of the personal tools/search box (before this task) the heading outline got messed up from legacy Vector as AFB has pointed out. Added comparison outline screenshots.
I'd recommend to output h3s only for legacy Vector and change the HTML element to a strong with id and aria-labelledby in place. We don't need to retain those h3s for modern Vector, the only time where that would maybe make a slight difference is no CSS rendering, or certain text browsers. But the landmark nav regions should be helpful there on their own.

With this proposed change we would only put headlines around content and not chrome. Seems appropriate to me with modern browsers.

Change 692705 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Improve heading structure and heading semantics by removing redundant headings and labels for modern Vector

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

bwang moved this task from Code Review to QA on the Web-Team-Backlog (Kanbanana-FY-2021-22) board.
bwang updated the task description. (Show Details)

Test Result - Beta

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

Test Artifact(s):

QA Steps

✅ AC1: The "Navigation menu" h2 element is not read out when reading through this section removed in Vector modern
✅ AC2: The h3 in all navigation menus (i.e. user links menu, menus in the side bar, language variant, the "more" menu, etc) will not be read out are output as strong element in Vector modern
✅ AC3: The "Search" h3 is not read out when reading through the search box
✅ AC4: Menu h3s are not read out to screen readers, and the heading structure is simplified.
✅ AC5: Check the heading structure in your screen reader, it should only show the headings of a particular article.

Screen Shot 2021-09-25 at 11.35.35 AM.png (1×1 px, 2 MB)

Edtadros updated the task description. (Show Details)
Edtadros subscribed.

Test Result - Prod

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

Test Artifact(s):

QA Steps

✅ AC1: The "Navigation menu" h2 element is not read out when reading through this section removed in Vector modern
✅ AC2: The h3 in all navigation menus (i.e. user links menu, menus in the side bar, language variant, the "more" menu, etc) will not be read out are output as strong element in Vector modern
✅ AC3: The "Search" h3 is not read out when reading through the search box
✅ AC4: Menu h3s are not read out to screen readers, and the heading structure is simplified.
✅ AC5: Check the heading structure in your screen reader, it should only show the headings of a particular article.

Screen Shot 2021-09-25 at 11.40.18 AM.png (866×820 px, 1 MB)