Close two blind spots in the contrast check #82

Closed
jheaps wants to merge 1 commits from fix/casino-holdem-close-audit-blind-spots into fix/casino-holdem-readable-dim-states
Owner

#81 found a folded player's stack sitting at 2.22:1, hidden for twenty rounds behind an exemption. So I went looking for the other exemptions rather than waiting for the next one to surface.

There were two, and neither is hiding a live fault today — worth saying plainly, because it means this is a fix to the instrument and not to the tool.

Leaf elements only

if (el.children.length > 0) return;   // leaf text only

An element's own text stopped being measured the moment a child was added to it. The undo control went that way two changes ago, the day a <kbd> was appended to it: its label became invisible to this check with no sign that anything had changed. It now measures an element's own text nodes and leaves descendants to their own turn, against their own colours.

aria-hidden as a contrast exemption

The bets layer is aria-hidden because the amounts on the chips are already announced by the seat and the action bar, and repeating them would be noise. That's a good reason to hide them from a screen reader and no reason at all to stop checking whether a sighted dealer can read them — and the chips are exactly what the felt is read for. Two different questions were being answered by one attribute.

Nothing is exempt now. If something genuinely decorative turns up it should say so in its own words rather than borrowing an attribute that means something else. The watermark the exemption was written for went in #80.

What the widened check finds

Nothing. Zero offenders at six viewports across touch and pointer contexts, and with the sidebar panels and the rulings sheet open. Measured from rendered pixels, the two things that had been invisible are comfortable: bet chip amounts read 12.65–13.74:1 and the undo label 8.06:1.

So the fix is proved by injection instead. Colouring the bet chip amounts #3a3a3a now reports three offenders at 1.80:1; colouring the undo control #2f2f2f reports it at 1.13:1. Neither was reported before.

269 tests still passing, no console errors.

#81 found a folded player's stack sitting at 2.22:1, hidden for twenty rounds behind an exemption. So I went looking for the other exemptions rather than waiting for the next one to surface. There were two, and **neither is hiding a live fault today** — worth saying plainly, because it means this is a fix to the instrument and not to the tool. ## Leaf elements only ```js if (el.children.length > 0) return; // leaf text only ``` An element's own text stopped being measured the moment a child was added to it. **The undo control went that way two changes ago**, the day a `<kbd>` was appended to it: its label became invisible to this check with no sign that anything had changed. It now measures an element's own text nodes and leaves descendants to their own turn, against their own colours. ## aria-hidden as a contrast exemption The bets layer is `aria-hidden` because the amounts on the chips are already announced by the seat and the action bar, and repeating them would be noise. That's a good reason to hide them from a screen reader and **no reason at all** to stop checking whether a sighted dealer can read them — and the chips are exactly what the felt is read for. Two different questions were being answered by one attribute. Nothing is exempt now. If something genuinely decorative turns up it should say so in its own words rather than borrowing an attribute that means something else. The watermark the exemption was written for went in #80. ## What the widened check finds Nothing. **Zero offenders** at six viewports across touch and pointer contexts, and with the sidebar panels and the rulings sheet open. Measured from rendered pixels, the two things that had been invisible are comfortable: bet chip amounts read **12.65–13.74:1** and the undo label **8.06:1**. So the fix is proved by injection instead. Colouring the bet chip amounts `#3a3a3a` now reports three offenders at 1.80:1; colouring the undo control `#2f2f2f` reports it at 1.13:1. **Neither was reported before.** 269 tests still passing, no console errors.
jheaps added 1 commit 2026-09-01 19:21:30 -06:00
Last change found a folded player's stack sitting at 2.22:1, hidden for twenty rounds
behind an exemption. So I went looking for the other exemptions rather than waiting for
the next one to surface. There were two, and neither is hiding a live fault today --
which is worth saying plainly, because it means this is a fix to the instrument and not
to the tool.

Leaf elements only

    if (el.children.length > 0) return;   // leaf text only

An element's own text stopped being measured the moment a child was added to it. The
undo control went that way two changes ago, the day a <kbd> was appended to it: its
label became invisible to this check with no sign that anything had changed. Now it
measures an element's own text nodes and leaves the descendants to their own turn,
against their own colours.

aria-hidden as a contrast exemption

The bets layer is aria-hidden because the amounts on the chips are already announced by
the seat and the action bar, and repeating them would be noise. That is a good reason
to hide them from a screen reader and no reason at all to stop checking whether a
sighted dealer can read them -- and the chips are exactly what the felt is read for.
Two different questions were being answered by one attribute.

Nothing is exempt now. If something genuinely decorative turns up, it should say so in
its own words rather than borrowing an attribute that means something else. The
watermark that the exemption was written for is gone as of the change before last.

What the widened check finds

Nothing. Zero offenders at six viewports across touch and pointer contexts, and with
the sidebar panels and the rulings sheet open. Measured from rendered pixels, the two
things that had been invisible are comfortable: the bet chip amounts read 12.65 to
13.74:1 and the undo label 8.06:1.

So the fix is proved by injection instead. Colouring the bet chip amounts #3a3a3a now
reports three offenders at 1.80:1, and colouring the undo control #2f2f2f reports it at
1.13:1. Neither was reported before.

269 tests still passing, no console errors.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015bnp7xKUPFFSpwkYNFaPgb
jheaps closed this pull request 2026-09-02 09:57:56 -06:00

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jheaps/JoshHeaps.Net#82