-
Notifications
You must be signed in to change notification settings - Fork 693
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] Conditionally choose participating elements when onscreen in both DOM states #9354
Comments
Some of these problems may be solved by hierarchical structure for the pseudo elements. That structure might still need to be conditionally constructed, so we might need another property here, but at least it would be less magical |
Fair. The use-case I saw would require the header's group pseudo to be a child of the |
+1 to optimizing performance by skipping transitions on elements that are not visible within the viewport in either the old or new DOM. As a developer writing Javascript and CSS, one way I might try to approach this optimization on the Javascript side could be to use Intersection Observer to keep track of when elements are visible in the viewport. Then, if they are visible, conditionally add a But I realize a shortcoming of that approach is that it only captures element visibility in the old DOM, and misses elements that are not presently visible but may become visible after a transition (such as for a long list of items on a page where items below the fold may need to transition to appear higher up on the page when the list is re-ordered). Those would not receive a |
Duplicate of #8282? |
I'm not sure, would love your feedback on that. :)
I think these are 2 distinct use-cases? |
Given #8282 (comment), can this be closed @khushalsagar ? |
Sure. The separate use-case in my mind, "we'll conceptually put the captured element's snapshot back into its parent if we don't find a matching view-transition-name onscreen in the new DOM" can be achieved with nesting. |
Consider the following case:
The above is very difficult to achieve. Once you've tagged something in the old DOM, it will generate its own
::view-transition-group
and will be in a separate snapshot. Authors could try to set a custom animation so the group for the header, making it as-if it's still embedded in its parent's snapshot. But that's very hard, you need to replicate a bunch of animations (transform, opacity, filter) being applied to the VT pseudo displaying the parent's snapshot.We can add a new CSS property to have the browser do this. Even if it captured a child as a separate snapshot, don't generate pseudos for it unless the name is on both sides. And render it as-if its still embedded within its parent's snapshot.
The text was updated successfully, but these errors were encountered: