Skip to content

fix(lint): flag hidden-style opacity guards - #3694

Merged
miga-heygen merged 1 commit into
mainfrom
magi/fix-hidden-style-opacity-lint
Sep 8, 2026
Merged

fix(lint): flag hidden-style opacity guards#3694
miga-heygen merged 1 commit into
mainfrom
magi/fix-hidden-style-opacity-lint

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

lint and check now reject broad CSS guards that turn renderer-owned visibility: hidden into opacity: 0. This prevents successfully extracted video frames from becoming transparent while keeping guards explicitly scoped to sub-composition hosts valid.

Why

The renderer hides each native video before it copies the video's computed opacity to the visible replacement image. A broad [style*="visibility: hidden"] opacity rule observes that runtime mutation, sets the native opacity to zero, and causes the copied frame to remain transparent for every rendered frame.

How

  • Reuse the existing parsed CSS selector pass and resolve nested selectors before evaluating them.
  • Inspect the selected compound, so an ancestor scope does not make an arbitrary media target safe.
  • Allow the guard only when that selected compound is explicitly constrained to data-composition-src or data-composition-file.
  • Preserve engine host filtering and authored media-opacity semantics.

Test plan

  • RED/GREEN coverage for broad, media-targeted, and root-stylesheet/nested-video cases.
  • Safe host-scoped and non-opacity controls remain accepted.
  • Full lint package: 553 tests passed.
  • Lint package typecheck, oxlint, formatting, and diff checks passed.
  • Documentation updated (not applicable).

@miga-heygen miga-heygen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hidden-style opacity guard lint rule with proper CSS selector parsing. Correctly exempts sub-composition host scoping and non-opacity declarations. — Miga

@miga-heygen
miga-heygen enabled auto-merge (squash) September 8, 2026 18:09
@miga-heygen
miga-heygen merged commit 2c14438 into main Sep 8, 2026
47 checks passed
@miga-heygen
miga-heygen deleted the magi/fix-hidden-style-opacity-lint branch September 8, 2026 18:09
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