Skip to content

fix(cli): recognize ancestor gradient text masks - #5207

Merged
jrusso1020 merged 1 commit into
heygen-com:mainfrom
user-github-me:fix/gradient-ancestor-text-audit
Oct 8, 2026
Merged

jrusso1020 merged 1 commit into
heygen-com:mainfrom
user-github-me:fix/gradient-ancestor-text-audit

Conversation

@user-github-me

Copy link
Copy Markdown
Contributor

When a heading uses background-clip: text and its words or lines are wrapped in child elements, check reports text_not_painted even though Chrome 150+ paints their glyphs. Recognize an ancestor's clipped gradient or solid background, match the painted background layer, and compare individual text fragments in layout coordinates because Chromium's mask ignores descendant transforms.

Keep the finding for Chrome builds below 150 and unknown browsers, transparent or missing gradients, unmatched background layers, SVG text, and glyphs outside the mask. Ancestor images with unknown transparency remain conservative. Refs #5117 for the CLI audit follow-up; the Cloud Run browser pin remains a separate issue.

Validation:

  • 249 related tests passed on Node 22, including Chromium 152 screenshot comparisons; all 32 Chromium tests also passed on Chrome 148 and 150.
  • Regression tests fail on main. The same valid CLI fixture changes from text_not_painted on main to a passing strict lint/check with three passing contrast samples; Chrome 148 still reports the genuinely missing child glyphs.
  • CLI build/typecheck, repository lint, formatting, pre-commit hooks, comment checks, deletion guard, and test reachability passed.

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. This removes a real false positive: split-text gradient headings were reported as text_not_painted even though their glyphs paint. Matching each clip to its background layer, while keeping glyphs outside the mask reportable, keeps the check honest, and the Chromium screenshot tests back up the version gate. Two small follow-ups you could consider: on Chrome below 150 the check still flags plain inline children that are painted, and an ancestor url() background is still flagged even though the direct-text path accepts it.

— Rames

@jrusso1020
jrusso1020 enabled auto-merge October 8, 2026 20:08
@jrusso1020
jrusso1020 added this pull request to the merge queue Oct 8, 2026
Merged via the queue into heygen-com:main with commit f802aed Oct 8, 2026
81 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants