Skip to content

Commit 7f06c27

Browse files
committed
tools: add navigation ARIA landmark to generated API ToC
As an accessibility improvement, specify the navigation landmark for the element of our docs that contains the table of contents generated for the specific API page. Ref: https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/ Ref: https://www.w3.org/WAI/WCAG21/Techniques/aria/ARIA20.html PR-URL: #49882 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Claudio Wunder <[email protected]> Reviewed-By: LiviaMedeiros <[email protected]>
1 parent bc056c2 commit 7f06c27

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/doc/html.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ export function buildToc({ filename, apilinks }) {
467467
.use(htmlStringify)
468468
.processSync(toc).toString();
469469

470-
file.toc = `<details id="toc" open><summary>Table of contents</summary>${inner}</details>`;
470+
file.toc = `<details role="navigation" id="toc" open><summary>Table of contents</summary>${inner}</details>`;
471471
file.tocPicker = `<div class="toc">${inner}</div>`;
472472
} else {
473473
file.toc = file.tocPicker = '<!-- TOC -->';

0 commit comments

Comments
 (0)