Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-view-transitions-2] Clip captured snapshots to viewport for elements #9481

Open
khushalsagar opened this issue Oct 17, 2023 · 0 comments
Labels
css-view-transitions-2 View Transitions; New feature requests

Comments

@khushalsagar
Copy link
Member

Currently when an element is snapshotted for a ViewTransition its captured in its entirety (modulo implementation constraints), see here.

But for the root the snapshot is clipped to viewport, see here.

The reason for this divergence is:

  • The root is likely to be large in a lot of cases and rendering it completely is wasteful of memory/compute.
  • A partially onscreen element may be brought more onscreen during the transition animations so all its content is conservatively painted.

Its unclear if the tradeoff above makes sense in all cases, maybe the author should decide this based on the transition animations they will be creating? @jakearchibald has brought up cases where the root is slightly scrolled during the transition (from a header which animates away) and needs a small margin of offscreen content to be painted.

This intersects with #8282 but I'm filing it separately so the use-case is not lost. Since #8282 could be limited to which elements participate in a transition while this is about how much content of an element is painted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-view-transitions-2 View Transitions; New feature requests
Projects
None yet
Development

No branches or pull requests

1 participant