fix: no invented colours for elements too small to sample - #19
Merged
Merged
Conversation
A 1x1pt element — the screen-reader anchors real pages are full of, "Skip to content" and the like — has no interior left once the edge inset is applied, so its fill was sampled from outside it and came back solid black. Seven such nodes in a 439-node Safari window all reported bg: #000000, which reads as a black element that is not there. Sampling now requires a box with a real interior, and the inset can no longer exceed the box. Elements thin in one dimension only, like a 5pt split handle, keep their colours: 431 of 439 nodes still carry style. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found while verifying
uiSnapshoton an unlocked screen.A 1×1 pt element has no interior left once the edge inset is applied, so its "fill" was sampled from outside it. Every screen-reader anchor in a real page — "Skip to content", hidden headings — came back solid black:
Seven such nodes in a 439-node Safari window. To a consumer that reads as a black element that is not there.
Sampling now needs a box with a real interior, and the inset can no longer exceed the box. Elements thin in one dimension only — a 5 pt split handle, a scrollbar — keep their colours, and 431 of 439 nodes still carry
style, so nothing was over-suppressed.106 tests, including a guard that no sub-3pt element carries a style and that the majority of nodes still do.
🤖 Generated with Claude Code