Show WCAG conformance level in axe document report (#14604)#14606
Merged
Conversation
The `axe: output: document` report showed each violation's impact, description, and selectors but never the WCAG conformance category, so a `best-practice` finding was indistinguishable from a genuine WCAG failure. Derive a human-readable label from the violation's axe-core `tags`: the WCAG version+level and success criteria (e.g. `WCAG 2.0 AA (1.4.3)`), `Best Practice` for axe's own recommendations, or `Obsolete WCAG 2.0 A (4.1.1)` for withdrawn criteria (the `-obsolete` tag suffix). Falls back to the impact alone when no conformance tags are present. Verified against all 104 rules in axe-core 4.10.3. Add expectedConformance assertions to the Playwright axe matrix.
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
cderv
approved these changes
Jun 22, 2026
cderv
left a comment
Member
There was a problem hiding this comment.
Thanks !
This looks good. I'll add more unit test for regression and merge
The Playwright matrix only exercises the two ordinary WCAG paths through the document reporter, leaving the best-practice, obsolete, empty-fallback, and numeric-sort branches of the label derivation untested. The numeric sort in particular can only be reached deterministically with a crafted multi-criteria input, not via whichever rules axe-core happens to flag. Export axeConformanceLevel so it can be tested in isolation and guard the module's self-init on typeof document so importing it outside a browser is side-effect-free. The tests feed synthetic tags arrays (the contract axe hands us) and assert only our formatting, so an axe-core upgrade that re-tags a rule cannot break them.
cderv
added a commit
to quarto-dev/quarto-web
that referenced
this pull request
Jun 22, 2026
…2081) * docs: document WCAG conformance level in axe output: document report Companion to quarto-dev/quarto-cli#14606, which adds a WCAG conformance level prefix to each violation in the output:document axe report (e.g., "Serious · WCAG 2.0 AA (1.4.3)"), distinguishing genuine WCAG failures from best-practice findings. The document output bullet now mentions this. The axe-violation.png screenshot, which predated the feature, is regenerated to show the new prefix. * fix screenshot: use cropBottom instead of trim to preserve full width * fix screenshot: 1000x360 viewport so content fills width and text wraps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #14604.
What
The
axe: output: documentreport showed each violation's impact, description, and selectors, but never the WCAG conformance category. Abest-practicefinding (axe's own recommendation, not tied to any WCAG success criterion) was rendered identically to a genuine WCAG Level A failure, which matters for triage.This derives a human-readable conformance label from the violation's axe-core
tags(already present in the result and exposed byoutput: json, just not surfaced inoutput: document) and shows it inline in the description:E.g. in

format: html:The label covers:
wcag2aa+wcag143→WCAG 2.0 AA (1.4.3); multiple criteria are numerically sorted and comma-joined (WCAG 2.0 A (2.4.4, 4.1.2)).best-practice→Best Practice.-obsoletetag suffix (e.g.wcag2a-obsoleteon the deprecatedduplicate-idrule, for WCAG SC 4.1.1 withdrawn in 2.2) →Obsolete WCAG 2.0 A (4.1.1), so a withdrawn criterion isn't mistaken for a current failure. (These rules are disabled by default in axe-core, so this path is defensive.)Verification
expectedConformanceassertions to the Playwright axe matrix across all document-mode formats (HTML, dashboard, dashboard-dark, dashboard-pages, revealjs, revealjs-dark), checked against the real axe-core tags.Notes
category, which is largely redundant with the description text).quarto-cli(per CONTRIBUTING.md, "Using AI tools to investigate").Draft for now — opening for early review.