Page MenuHomePhabricator

Make generated table of contents a navigation region
Open, Needs TriagePublic

Description

Current:

<div id="toc" class="toc">
  <div id="toctitle">
    <h2>Contents</h2>
    <span class="toctoggle">...</span>
  </div>
  <ul>...</ul>
</div>

A heading and list is pretty good, but I usually see this inside a semantic <nav> or <div role="navigation"> these days, so it can be jumped to as a landmark/region as well. For example, the ToC of the WAI-ARIA recommendation itself. This will be even more useful after T114072 makes sections into regions. Something like this might do the trick:

<div role="navigation" aria-labelledby="tocheading" id="toc" class="toc">
  <div id="toctitle">
    <h2 id="tocheading">Contents</h2>
    <span class="toctoggle">...</span>
  </div>
  <ul>...</ul>
</div>

Details

Related Gerrit Patches:

Event Timeline

Restricted Application added subscribers: Zppix, Aklapper. · View Herald TranscriptJul 2 2016, 12:40 AM

Change 268363 had a related patch set uploaded (by Matt Fitzpatrick):
Add ARIA "navigation" role and label to table of contents div

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

Danny_B moved this task from Unsorted to ARIA on the Accessibility board.Jul 2 2016, 10:32 PM
stjn added a subscriber: stjn.Apr 23 2019, 5:21 PM

Heydon Pickering specifically suggests it to us in his book Inclusive Design Patterns: