You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c61b5dc
Browse filesBrowse the repository at this point in the historyBrowse files
Add two checks: viewport zoom and generic link text
Asked to find new categories of bugs, not pad the codebase with an
arbitrary property count - so this is scoped to what's genuinely
detectable with the project's existing verification bar (a fixture
proving both the true and false positive, plus a mutation test
proving the check isn't just guessing).
Considered and dropped a third candidate: detecting JS that blocks
pasting into a field (common, and actively harmful, on "confirm
email"/"confirm password" fields - it defeats password managers and
forces error-prone re-typing). Reliably simulating a real paste in
headless Chrome needs either the deprecated execCommand('paste') or
CDP-level clipboard operations; a synthetic ClipboardEvent dispatched
from page.evaluate() won't trigger a browser's native paste-insert
behavior the way a trusted event does. Shipping a check with a real
false-negative risk would break this project's actual track record -
every check so far is deterministic, not a guess dressed up as one.
check_viewport_zoom (Fail): a <meta name="viewport"> with
user-scalable=no or maximum-scale under 2 blocks pinch-zoom outright -
a WCAG 1.4.4 (Resize Text) failure that hits every low-vision user on
the page, not just screen-reader users, and axe-core has no rule for
it at all. Objectively verifiable (the tag either restricts zoom or it
doesn't), so a hit is a Fail like Duplicate field names/Required-
indicator mismatch, not a heuristic Warn.
check_generic_link_text (Warn): <a> links whose entire accessible text
is a well-known ambiguous phrase ("click here", "read more", ...) are
meaningless in a screen reader's links-list view (WCAG 2.4.4).
Deliberately scoped to links only, not buttons - a lone "Submit"
button is normal and flagging it would just be noise on ordinary
forms. A phrase match is a heuristic (surrounding text might
disambiguate it), so a hit is a Warn, matching Autofill hints/Input
type mismatch's precedent.
Caught a real bug during testing, not just in review: the zoom check's
first draft returned `noScale || (maxScale && ...)`, which evaluates
to `null` (not `false`) in JS when noScale is false and maxScale is
null - `false || null` is `null` in JS, and chromiumoxide can't
deserialize `null` into a Rust bool ("No value found"). Fixed with an
explicit Boolean(...) wrap; the fixture-less negative-case test (no
viewport meta tag at all) is exactly what caught it.
Verified both with mutation tests: inverted the zoom regex (checked
for "yes" instead of "no") and confirmed the Fail-detection test
failed as predicted; changed the link-text match to key off
"eligibility" instead of the generic-phrase set and confirmed it
flagged the wrong link, breaking the false-positive assertion. Both
restored after confirming.
Refreshed BENCHMARKS.md's numbers for 13 checks (was 11) since these
two are cheap static markup checks, not full sweeps - re-ran all four
existing rows rather than leave three of them showing a stale
checks/run count next to one refreshed one.
cargo fmt/clippy -D warnings clean, full suite green (163 tests).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
0 commit comments