Skip to content

Masks: re-read boxes before each shot, clip to overflow, cover overflowing descendants #72

Closed

Description

@tmashara

What
Mask geometry that holds up on real layouts:

  1. Read the boxes again. Re-read mask boxes on each shot attempt, or after settle, and treat a box that moved between reads as unstable instead of painting a stale rect.
  2. Clip each mask to its overflow clipping ancestors.
  3. Cover overflowing descendants. Paint the union of the element's box and its rendered descendants' boxes, or add includeOverflow: true to a mask.

Why

  • A pinned section moved after the boxes were read. On a ScrollTrigger-pinned section, base vs base differed only when the player inside was masked, by a ±14–22 px band. In one shot the magenta box started 39 px above its overflow:hidden container. Unmasked, the route was clean in 3 runs × 5 widths, so the mask itself was the noise. The likely cause is the pinned section re-laying out after scrollTo(0,0), after the boxes were read.
  • Descendants painted outside the masked box. video.js draws .vjs-poster outside the player div: at 375 px it starts 44 px above it. Masking #player left an animated GIF strip showing, so every video.js mask needed #player .vjs-poster too. The second page with this only surfaced a full cycle later.

Activity

  1. added
    bug
    on Oct 29, 2026
  2. added a commit that references this issue on Oct 29, 2026
    f8cf094
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions