Show WCAG conformance level in axe document report (#14604)#14606
Open
cwickham wants to merge 1 commit into
Open
Show WCAG conformance level in axe document report (#14604)#14606cwickham wants to merge 1 commit into
cwickham wants to merge 1 commit into
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. |
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.