From c0ca5df024a9097c9ae459964d527f3c151b3b3e Mon Sep 17 00:00:00 2001 From: Charlotte Wickham Date: Mon, 24 Aug 2026 14:46:57 -0700 Subject: [PATCH 1/2] Remove invalid role="menu" from the navbar collapse toggler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit role="menu" was added to navtoggle.ejs in #9553 because Lighthouse (running an older axe-core built on ARIA 1.1) reported that the button role did not support aria-expanded. ARIA 1.2 allows aria-expanded on button, so the override is no longer needed — and it was never a valid role for the element: axe-core flags it as aria-allowed-role, and WAVE treats a menu with no menuitem children as an Error (aria_menu_broken) mapped to WCAG 2.2 SC 2.1.1 and 4.1.2. A follow-up commit in #9553 already replaced role="menu" on the dropdown toggles; the hamburger toggler was the remaining instance. The toggler now matches Bootstrap's own navbar-toggler markup: native button semantics with aria-controls, aria-expanded, and aria-label. Adds a website smoke-all regression test that asserts the rendered toggler carries aria-expanded, aria-controls, and aria-label but no role attribute. Fixes #14615 --- news/changelog-1.11.md | 6 ++++++ .../projects/website/templates/navtoggle.ejs | 2 +- .../website/navbar-toggler-role/.gitignore | 2 ++ .../website/navbar-toggler-role/_quarto.yml | 11 +++++++++++ .../website/navbar-toggler-role/index.qmd | 15 +++++++++++++++ 5 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 tests/docs/smoke-all/website/navbar-toggler-role/.gitignore create mode 100644 tests/docs/smoke-all/website/navbar-toggler-role/_quarto.yml create mode 100644 tests/docs/smoke-all/website/navbar-toggler-role/index.qmd diff --git a/news/changelog-1.11.md b/news/changelog-1.11.md index 35f6ee3a280..2588f7990f4 100644 --- a/news/changelog-1.11.md +++ b/news/changelog-1.11.md @@ -1,5 +1,11 @@ All changes included in 1.11: +## Projects + +### `website` + +- ([#14615](https://github.com/quarto-dev/quarto-cli/issues/14615)): Fix invalid `role="menu"` on the navbar's collapse toggle button, flagged by axe-core (`aria-allowed-role`) and WAVE (`aria_menu_broken`) when the navbar collapses to the hamburger at narrow viewports. + ## Engines ### `knitr` diff --git a/src/resources/projects/website/templates/navtoggle.ejs b/src/resources/projects/website/templates/navtoggle.ejs index 2692783929a..0b4393abf87 100644 --- a/src/resources/projects/website/templates/navtoggle.ejs +++ b/src/resources/projects/website/templates/navtoggle.ejs @@ -1,5 +1,5 @@ \ No newline at end of file diff --git a/tests/docs/smoke-all/website/navbar-toggler-role/.gitignore b/tests/docs/smoke-all/website/navbar-toggler-role/.gitignore new file mode 100644 index 00000000000..ad293093b07 --- /dev/null +++ b/tests/docs/smoke-all/website/navbar-toggler-role/.gitignore @@ -0,0 +1,2 @@ +/.quarto/ +**/*.quarto_ipynb diff --git a/tests/docs/smoke-all/website/navbar-toggler-role/_quarto.yml b/tests/docs/smoke-all/website/navbar-toggler-role/_quarto.yml new file mode 100644 index 00000000000..ac126604ab7 --- /dev/null +++ b/tests/docs/smoke-all/website/navbar-toggler-role/_quarto.yml @@ -0,0 +1,11 @@ +project: + type: website + +website: + title: "navbar-toggler-role" + navbar: + right: + - text: Home + href: index.qmd + - text: About + href: index.qmd diff --git a/tests/docs/smoke-all/website/navbar-toggler-role/index.qmd b/tests/docs/smoke-all/website/navbar-toggler-role/index.qmd new file mode 100644 index 00000000000..333663b36aa --- /dev/null +++ b/tests/docs/smoke-all/website/navbar-toggler-role/index.qmd @@ -0,0 +1,15 @@ +--- +title: "Home" +_quarto: + tests: + html: + ensureHtmlElements: + - + - 'button.navbar-toggler[aria-expanded][aria-controls][aria-label]' + - + - 'button.navbar-toggler[role]' +--- + +The navbar's collapse toggle button must keep its native button semantics: +no `role` override (`role="menu"` is invalid on a button — #14615), with +`aria-expanded`, `aria-controls`, and `aria-label` intact. From 3982c3a289fd45e26642820acdbae2d5dc877933 Mon Sep 17 00:00:00 2001 From: Charlotte Wickham Date: Tue, 25 Aug 2026 08:19:08 -0700 Subject: [PATCH 2/2] Move changelog entry under Accessibility; ignore _site in test fixture The 1.10 changelog established a dedicated Accessibility section for this kind of entry. Also add /_site/ to the smoke-all fixture's .gitignore: the harness cleans output after a run, but an interrupted run would otherwise leave an untracked _site behind. --- news/changelog-1.11.md | 6 ++---- tests/docs/smoke-all/website/navbar-toggler-role/.gitignore | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/news/changelog-1.11.md b/news/changelog-1.11.md index 2588f7990f4..5de1163d56c 100644 --- a/news/changelog-1.11.md +++ b/news/changelog-1.11.md @@ -1,10 +1,8 @@ All changes included in 1.11: -## Projects +## Accessibility -### `website` - -- ([#14615](https://github.com/quarto-dev/quarto-cli/issues/14615)): Fix invalid `role="menu"` on the navbar's collapse toggle button, flagged by axe-core (`aria-allowed-role`) and WAVE (`aria_menu_broken`) when the navbar collapses to the hamburger at narrow viewports. +- ([#14615](https://github.com/quarto-dev/quarto-cli/issues/14615)): Fix invalid `role="menu"` on the website navbar's collapse toggle button, flagged by axe-core (`aria-allowed-role`) and WAVE (`aria_menu_broken`) when the navbar collapses to the hamburger at narrow viewports. ## Engines diff --git a/tests/docs/smoke-all/website/navbar-toggler-role/.gitignore b/tests/docs/smoke-all/website/navbar-toggler-role/.gitignore index ad293093b07..91e4dc52c80 100644 --- a/tests/docs/smoke-all/website/navbar-toggler-role/.gitignore +++ b/tests/docs/smoke-all/website/navbar-toggler-role/.gitignore @@ -1,2 +1,3 @@ /.quarto/ +/_site/ **/*.quarto_ipynb