Skip to content

fix(cli): audit text beneath transparent composition boxes - #5202

Merged
jrusso1020 merged 1 commit into
heygen-com:mainfrom
user-github-me:fix/contrast-transparent-composition-hosts
Oct 8, 2026
Merged

jrusso1020 merged 1 commit into
heygen-com:mainfrom
user-github-me:fix/contrast-transparent-composition-hosts

Conversation

@user-github-me

Copy link
Copy Markdown
Contributor

Visible text marked data-layout-allow-occlusion is skipped by the contrast audit when a later transparent composition box wins elementFromPoint. On current main, both a direct host and a mounted sub-composition reproduce check exiting successfully with zero contrast checks for text whose measured ratio is 1.57:1.

Walk the ordered hit stack through unpainted composition hosts and compiler-produced inner roots, then audit the text when a probe reaches it. Keep the existing behavior for covering paint, generated content, raster/replaced elements, and browsers without elementsFromPoint. Paint checks are cached only for the current prepare call.

Refs #5112 (contrast-audit follow-up). This addresses the audit problem; #5118 changes one registry block, and the font-readiness report remains separate.

Validation:

  • Four regressions fail on main; the new 31-case suite and existing layout/contrast suites pass 221 tests.
  • Real Chrome prepare/screenshot/finish checks: transparent and nested hosts report the 1.57:1 failure; opaque backgrounds, gradients, shadows, generated content and a deeper opaque cover remain excluded.
  • Built CLI check: the direct and mounted cases now report three contrast failures across three timestamps. Readable-text controls pass all three checks; a fully opaque cover still passes with no covered-text contrast checks.
  • CLI typecheck/build, repository lint, formatting, all applicable pre-commit gates, comment checks and test reachability passed.
  • The exemption is deliberately limited to unpainted HTML div/section composition boxes. This is an audit correction, with no render changes. No claim that all transparent HTML/SVG paint or partial-cover contrast cases are solved.

@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 fixes a real gap. A transparent sub-composition host stacked above allow-occlusion text was answering elementFromPoint for the whole block, so contrast was never checked there. Walking the hit stack only through unpainted composition boxes, and stopping at the first painted layer, keeps every real cover intact. The tests cover host, nested-root and inner-root cases, plus each kind of paint that should still count as cover. Possible follow-up: isClippedAway uses the same single-hit probe, so clip-path text under a transparent host may still be skipped.

— Rames

@jrusso1020
jrusso1020 enabled auto-merge October 8, 2026 20:11
@jrusso1020
jrusso1020 added this pull request to the merge queue Oct 8, 2026
Merged via the queue into heygen-com:main with commit b32ce10 Oct 8, 2026
80 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