Skip to content

fix(check): clip overlap geometry to visible fragments - #3698

Open
miguel-heygen wants to merge 1 commit into
mainfrom
magi/fix-overflow-clipped-overlap
Open

fix(check): clip overlap geometry to visible fragments#3698
miguel-heygen wants to merge 1 commit into
mainfrom
magi/fix-overflow-clipped-overlap

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

content_overlap no longer reports text that an overflow ancestor fully hides. Partially clipped text is measured by its painted area, so genuine visible collisions still cross the overlap threshold.

Why

DOM Range rectangles remain geometrically present outside an overflow clip. Comparing those raw rectangles produced false-positive overlap warnings for translated or otherwise clipped text.

How

Text fragments are intersected with each overflow ancestor in viewport coordinates before overlap analysis. Clipping is axis-aware for hidden, clip, auto, and scroll, while data-layout-allow-overlap remains a local opt-out.

Test plan

  • Unit tests added/updated

  • Manual testing performed

  • Documentation updated (not applicable)

  • bunx vitest run src/commands/layout-audit.browser.test.ts --reporter=dot (89 tests passed)

  • node --check packages/cli/src/commands/layout-audit.browser.js

  • bunx oxlint packages/cli/src/commands/layout-audit.browser.js packages/cli/src/commands/layout-audit.browser.test.ts

  • bunx oxfmt --check packages/cli/src/commands/layout-audit.browser.js packages/cli/src/commands/layout-audit.browser.test.ts

  • git diff --check

The package-wide typecheck is unavailable in this reused checkout because optional AWS, GCP, and producer dependencies are absent and existing cross-package type drift is present. It did not report errors in the changed browser audit or regression test.

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.

1 participant