Repository navigation
fix(cli): check no longer reports text painted by a visible text-shadow as not painted - #8364
Merged
jrusso1020 merged 2 commits intoNov 28, 2026
Conversation
…ow as not painted
jrusso1020
approved these changes
Nov 21, 2026
jrusso1020
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed at c126353fa288f2fd73beba83b9c48ea2a16542a7. Approve. Thanks for the fix and the clear test rows!
Need: yes, a shadow-only reveal produced 80 false text_not_painted findings in the reporter's project (#8361) · Size: ok (2 files, +28/-0) · Reuse: reuses splitTopLevelCommas and colorAlpha, and follows the -webkit-text-stroke path from #6693 · Simpler: already minimal · Structure: fine
Risk: low — only narrows when text_not_painted fires, and only when a shadow layer has visible colour
What I checked
- Computed shape. Chromium serialises
text-shadowasrgb(...) Xpx Ypx Bpxlayers, socolorAlpha(layer)finds the colour inside each layer string. A shadow with no colour resolves tocurrentcolor, so withcolor: transparentit serialises asrgba(0, 0, 0, 0) …and is still flagged. The fourth row covers that. - Tests (real Chromium, chrome-headless-shell 155):
- At the head:
layout-audit.chromium.test.tsgives 87 passed. - Mutation: with
layout-audit.browser.jsfrom the merge-base and the new rows kept, exactly the two "not flagged" rows fail (85 passed, 2 failed), as the test plan says.
- At the head:
Nits (non-blocking)
- Non-rgb colours.
colorAlphareturns 1 for a colour it can't parse. A shadow written in a colour space Chromium keeps as-is (for exampleoklch(… / 0)) would count as visible. The stroke check has the same limit today, so this is not new.
— Rames (hf-review)
jrusso1020
enabled auto-merge
November 21, 2026 16:15
This was referenced Nov 24, 2026
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.
What
checkreportedtext_not_paintedon text with a transparent fill whose glyphs are drawn by a visibletext-shadow(e.g. a shadow-offset reveal). A shadow layer with colour alpha above 0.05 now counts as paint, the same way a visible stroke does.Why
The shadow draws the glyph shapes, so the text is legible, but the rule only looked at fill, stroke and
background-clip: text. In the reporter's project this produced 80 false findings for 156 character spans.Related work
Fixes #8361 (follows the same path as #6693 for
-webkit-text-stroke).How
textShadowPaints()splits the computedtext-shadowinto layers with the existingsplitTopLevelCommasand checks each layer's colour withcolorAlpha.invisibleTextIssuecalls it right after the stroke check. Transparent text with no shadow, a fully transparent shadow, or a shadow that takes the transparentcoloris still reported.Test plan
layout-audit.chromium.test.ts. The two "not flagged" rows fail on main and pass here; the full Chromium file passes, 87 tests.