Skip to content

v0.4.2

Choose a tag to compare

@github-actions github-actions released this 12 May 11:09
· 5 commits to main since this release

Probe correctness patch — fixes a pseudo-class misuse in
tools/dialog_probe.py and tools/tab_walk.py that caused
CS2240700E (and indirectly any Tab-walk-derived focus-visibility
check) to false-positive on every site that correctly set a
:focus-visible outline.

Found via dogfood after fixing light-design.com.tw's actual focus
issues — site author's <main tabIndex={-1}> + global outline rules
verified working in DevTools (outlineStyle=solid width=3px under
focus), but a11y-moda v0.4.1 still reported the rule as fail.

Fixed

  • tools/dialog_probe.py _SKIP_TARGET_FOCUS_JS — removed
    getComputedStyle(target, ':focus-visible'). The second argument
    to getComputedStyle accepts only pseudo-elements (::before,
    ::after, ::marker); passing a pseudo-class like
    :focus-visible is invalid and Chromium silently falls back to
    the non-focus computed style (Firefox returns null). When the
    target is currently focused (skip link Enter has moved focus to it
    via tabindex="-1"), reading the regular computed style already
    includes the :focus/:focus-visible cascade — that's the
    correct read.
  • tools/tab_walk.py COLLECT_FOCUS_JS — same fix. Each Tab
    press makes the new element document.activeElement; reading
    regular computed style already reflects the focused-state cascade.
  • CS2240700E correctness restored — sites with valid
    :focus-visible outline + tabindex="-1" skip targets now
    correctly pass instead of false-firing.

Notes

  • Why this slipped past v0.4.0/0.4.1 dogfood — light-design.com.tw
    had no skip-link target focus indicator in those versions, so the
    rule was firing on a real underlying issue and passing the eye
    test. Bug surfaced only after the site author shipped the actual
    fix. Lesson: probes need fixture-style positive controls in
    addition to dogfood, not just sites that currently violate.
  • Per-page nuance on light-design (post-0.4.2) — homepage and
    pricing now PASS CS2240700E (probe correctly reads the new
    outline cascade); about-us / contact / works still report fail.
    This is a probe heuristic limitation, not a recurrence of the
    pseudo-class bug — dialog_probe runs after carousel_probe's
    4.5s observation, and the page state (scroll position, focus
    location) sometimes prevents the Tab-from-body walk from reaching
    the skip link in 5 presses. Investigating in 0.4.3 (likely:
    scroll-to-top + focus-body before each probe).
  • Acknowledgement — bug diagnosis comes from the
    light-design.com.tw author who verified outline was applied via
    Playwright at the same time a11y-moda was still reporting fail.
    Real-world dogfood found a class of bug that synthetic fixtures
    would have missed.