Skip to content

Show WCAG conformance level in axe document report (#14604)#14606

Open
cwickham wants to merge 1 commit into
mainfrom
worktree-axe-wcag-tags
Open

Show WCAG conformance level in axe document report (#14604)#14606
cwickham wants to merge 1 commit into
mainfrom
worktree-axe-wcag-tags

Conversation

@cwickham

@cwickham cwickham commented Jun 18, 2026

Copy link
Copy Markdown
Member

Fixes #14604.

What

The axe: output: document report showed each violation's impact, description, and selectors, but never the WCAG conformance category. A best-practice finding (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 by output: json, just not surfaced in output: document) and shows it inline in the description:

Critical · WCAG 2.0 AA (1.4.3): Ensure the contrast between foreground and background colors meets WCAG 2 AA contrast ratio thresholds

E.g. in format: html:
Screenshot 2026-06-18 at 3 53 50 PM

The label covers:

  • WCAG version + level + criteriawcag2aa + wcag143WCAG 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 practicebest-practiceBest Practice.
  • Obsolete criteria — the -obsolete tag suffix (e.g. wcag2a-obsolete on the deprecated duplicate-id rule, 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.)
  • No conformance tags → falls back to the impact alone.

Verification

  • Ran the label function over all 104 rules in axe-core 4.10.3 (the pinned version): every rule produced a well-formed label — no malformed output, no mis-attribution, no bare level-less criteria, obsolete correctly flagged.
  • Added expectedConformance assertions 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

  • Per the issue author's preference, only the conformance level is surfaced (not the axe category, which is largely redundant with the description text).
  • Investigation was AI-assisted and grounded in a local clone of quarto-cli (per CONTRIBUTING.md, "Using AI tools to investigate").

Draft for now — opening for early review.

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.
@posit-snyk-bot

posit-snyk-bot commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@cwickham cwickham marked this pull request as ready for review June 19, 2026 15:30
@cwickham cwickham requested a review from cscheid June 19, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

axe: output: document report omits WCAG conformance level

2 participants