Repository navigation
Description
Problem
Since #921, the a11y hidden-control rules report a control that a <style> rule may hide as a <check>-unconfirmed warn row. For example, aria-command-name-unconfirmed replaces the aria-command-name fail on that page.
When a page's only finding moves from <check> to <check>-unconfirmed between two audits, the previous audit's <check> fail on that page is never resolved. The merge keeps it open as carried, with no TTL. That page then shows both rows: the fresh unconfirmed warn and the stale fail.
Why, as far as I can trace it:
collectResolutionEvidence(packages/rules/src/resolution.ts) counts a page as evaluated forruleId|checkNameonly when the page emits a row with that exact check name.- The page emits only the
-unconfirmedrow, so it lands innotEvaluatedfora11y/aria-command-name|aria-command-name. computeMergenever resolves a prior finding on a page listed there, so it carries. Without the resolution signal, the same prior is resolved.
Seen on a cloud site after the engine moved to 03cc6ef (counts only):
- every fail row on aria-command-name (24), form-labels (3), button-name (2), aria-input-field-name (3), aria-buttons (2) and aria-hidden-focus (1) was
carriedfrom earlier audits; - the fresh run emitted only the
-unconfirmedwarn rows for those rules.
Replaying that run's stored pages through both engines gave these results:
- the old rules (35b9aa2) fail the same controls;
- the new rules (03cc6ef) report them as unconfirmed, with the same element counts;
- the rules themselves add no fails.
Minimal fixture
Two pages, both loading an external stylesheet:
- A:
<link rel="stylesheet" href="/site.css"><style>.drawer{display:none}</style>…<div class="drawer"><span role="button" tabindex="0"></span></div> - B:
<link rel="stylesheet" href="/site.css">…<span role="button" tabindex="0" aria-label="Open"></span>
With a11y/aria-command-name:
- old rules: A
aria-command-namefail, B pass; - new rules: A
aria-command-name-unconfirmedwarn, Baria-command-namepass.
buildResolutionSignal on the new rows lists A in notEvaluated for a11y/aria-command-name|aria-command-name.
computeMerge, with A's old fail as a prior open finding and the new run's fresh findings:
- with that signal, the prior stays
open/carried; - without it, the prior is
resolved.
Outcome
When a rule moves a page's finding from <check> to <check>-unconfirmed, the previous <check> fail on that page stops showing as an open carried finding. A page that a rule really did not evaluate still carries.
Acceptance Criteria
- With the fixture above, a prior open
a11y/aria-command-name/aria-command-namefail on page A, merged with a run that emits onlyaria-command-name-unconfirmedon A, is no longer an open carried finding. - The same holds for every rule that emits a
<check>-unconfirmedrow (aria-hidden-focus, button-name, aria-command-name, aria-input-field-name, aria-labels / aria-buttons, form-labels). - A page that a rule did not evaluate at all still lands in
notEvaluatedand keeps its prior findings carried (no regression of the not-evaluated carry). - A test runs the fixture through
buildResolutionSignalandcomputeMergeand covers both cases.
Activity
test(audit-engine): run the site pages contract on the #935 test's store
fix(rules): an unconfirmed control resolves the prior fail it replaced (