Repository navigation
Description
Describe the bug
The layout audit's text_not_painted check reports text as invisible when its glyphs are painted by a visible text-shadow. Text with -webkit-text-fill-color: transparent (or an effectively transparent color) is flagged even when a fully opaque shadow draws every glyph, so legitimate shadow-painted reveal effects produce large amounts of false positives. The text is fully legible, and the contrast audit passes.
invisibleTextIssue in dist/commands/layout-audit.browser.js checks webkitTextFillColor, text stroke, and background-clip: text, but not text-shadow.
Minimal reproduction
A self-contained composition. Only a bundled gsap copy (vendor/gsap.min.js) is needed next to it. The page splits the reveal text into per-character inline spans (like a natural-wrap arrival reveal), gives them a transparent fill, and tweens each span's textShadow from 0px 8px 0px rgb(255,255,255) to 0px 0px 0px rgb(255,255,255) so the shadow writes the glyphs in:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>shadow audit repro</title>
<style>
body { margin: 0; }
.stage {
position: relative;
width: 1920px;
height: 1080px;
background: #ffffff;
}
/* Transparent fill with no shadow: glyphs paint nothing. The audit must
flag this text as text_not_painted. */
.unpainted {
position: absolute;
left: 100px;
top: 100px;
color: #000000;
-webkit-text-fill-color: transparent;
font-family: sans-serif;
font-size: 64px;
}
/* Shadow-painted arrival: transparent fill, a white shadow animates its
vertical offset from 8px to 0px, so the shadow writes the glyphs in. */
.painted {
position: absolute;
left: 100px;
top: 300px;
width: 1700px;
height: 400px;
background: #202020;
color: #202020;
-webkit-text-fill-color: transparent;
font-family: sans-serif;
font-size: 96px;
line-height: 150px;
word-break: break-all;
}
.painted .ch { display: inline; }
</style>
</head>
<body>
<div class="stage" data-composition-id="shadow-repro" data-width="1920" data-height="1080">
<p class="unpainted" id="unpainted-line">UNPAINTED TEXT</p>
<p class="painted" id="painted-line">SHADOW PAINTED ARRIVAL TEXT LINES</p>
</div>
<script src="vendor/gsap.min.js"></script>
<script>
const tl = gsap.timeline({ paused: true });
tl.to(".stage", { opacity: 1, duration: 0.5 }, 0);
// Split the reveal text into per-character inline spans, like the arrival
// reveal in the real project.
const line = document.getElementById("painted-line");
const chars = [...line.textContent];
line.textContent = "";
for (const c of chars) {
const span = document.createElement("span");
span.className = "ch";
span.textContent = c;
line.appendChild(span);
}
// Animate the shadow's vertical offset so the shadow writes the glyphs in.
tl.fromTo(
"#painted-line .ch",
{ textShadow: "0px 8px 0px rgb(255,255,255)" },
{ textShadow: "0px 0px 0px rgb(255,255,255)", duration: 0.2, stagger: 0.05 },
0.5
);
window.__timelines = window.__timelines || {};
window.__timelines["shadow-repro"] = tl;
</script>
</body>
</html>Steps to reproduce
- Create a folder with the
index.htmlabove and avendor/gsap.min.jscopy next to it - Run
npx hyperframes check - Inspect the Layout section of the report
Expected behavior
#unpainted-line (transparent fill, no shadow — its glyphs paint nothing) is reported as text_not_painted. The per-character spans of #painted-line (transparent fill, opaque white shadow — the shadow paints the glyphs) are not reported, because their glyphs are visible.
Actual behavior
Both are reported identically. On 0.9.14 and 0.9.75 the audit lists every #painted-line > span as text_not_painted at every sample time:
✗ t=0.128, 0.383, 0.639, 0.894, 1.15, 1.406, 1.661, 1.917, 2.172s text_not_painted #unpainted-line "UNPAINTED TEXT" — Text paints with an effectively transparent fill (-webkit-text-fill-color / color), so its glyphs are invisible.
✗ t=0.128, 0.383, 0.639, 0.894, 1.15, 1.406, 1.661, 1.917, 2.172s text_not_painted #painted-line > span:nth-of-type(1) "S" — Text paints with an effectively transparent fill (-webkit-text-fill-color / color), so its glyphs are invisible.
✗ t=0.128, 0.383, 0.639, 0.894, 1.15, 1.406, 1.661, 1.917, 2.172s text_not_painted #painted-line > span:nth-of-type(2) "H" — Text paints with an effectively transparent fill (-webkit-text-fill-color / color), so its glyphs are invisible.
In a real project this produced 80 false text_not_painted findings for 156 character spans; the text was fully legible and the contrast audit passed.
Environment
✓ Version 0.9.14 (and reproduced on 0.9.75)
✓ Node.js v26.13.1 (linux x64)
✓ Environment WSL · non-TTY
✓ Chrome cache: ~/.cache/hyperframes/chrome/chrome-headless-shell/linux-152.0.7977.30/chrome-headless-shell-linux64/chrome-headless-shell
On 0.9.75 the reproduction was run with PUPPETEER_EXECUTABLE_PATH pointing at a local Chromium build and --no-browser-gpu, because snap Chromium cannot start in this environment; the audit findings were identical to 0.9.14.
Additional context
Suggested fix: check the text-shadow's color alpha after the stroke check, reusing the existing colorAlpha helper. A shadow with an opaque color paints the glyphs itself, so transparent-fill text with a visible shadow is legible:
// A text-shadow paints glyphs in its own color, so text with a transparent
// fill is still legible when a visible shadow draws the same glyphs. Split
// shadow layers on commas outside color functions so `rgb(...)` colors
// survive the split, then test each layer's color alpha.
function textShadowPaints(shadow) {
if (!shadow || shadow === "none") return false;
const layers = shadow.split(/,(?![^(]*\))/);
return layers.some((layer) => colorAlpha(layer) > 0.05);
}Inside invisibleTextIssue, after the stroke check:
if (textShadowPaints(cs.textShadow)) return null;Verified with this change on 0.9.14: the 80 false findings disappear from the real project and the audit passes, while transparent fill without a shadow is still reported as text_not_painted (regression-checked on a two-text composition: shadow-painted text not flagged, unpainted text still flagged).
Activity
fix(cli): text painted by a visible text-shadow is not reported as te…
fix(cli): text painted by a visible text-shadow is not reported as te…
fix(cli): text painted by a visible text-shadow is not reported as te…
utsxvrai commentedon Nov 21, 2026
Hi, I'd like to take this one. My plan is to count a visible
text-shadowas glyph paint ininvisibleTextIssue, right after the existing stroke check (same path as #6693): split the computed shadow into layers withsplitTopLevelCommasand check each layer's colour alpha. I'll add rows to the existing "by what it paints" Chromium test table covering visible, transparent and colourless shadows. I have this working locally and will open a PR shortly.