-
Notifications
You must be signed in to change notification settings - Fork 652
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] Nested transitions: what happens if there is a mismatch? #10631
Comments
Thanks for this! I am not sure how we can translate this into a solution though. |
This tracks the view-transition-group for the captured elements as "containing group". Those values are filtered to only include ancestors. * When a captured element has a valid containing group, the pseudo-element is reparented to the containing group when the view transition starts. * Note that when capturing the old element, we don't deal with nesting at all. The tree for the purpose of allowing the compositor to capture the old state is flat. This can be revisited iteratively, it's done for implementation simplicity. * When building styles, the (inverse) parent transform is adjusted so that it's not applied twice. * Changed all the recursive functions to retrieve pseudo-elements to adapt to nested containers. Currently, by default mismatches here are handled by "last capture wins", however this is to be resolved in the CSSWG so it's not tested yet: w3c/csswg-drafts#10631 Note also that with the current implementation, after capturing the old state and before starting might appear broken, as clipping/opacity/etc are not applied to the generated pseudo-element. Bug: 347947051 Change-Id: I49e4f7ea6c8d82b6ad34b50f8cda92eb3f074612
Agreed |
This tracks the view-transition-group for the captured elements as "containing group". Those values are filtered to only include ancestors. * When a captured element has a valid containing group, the pseudo-element is reparented to the containing group when the view transition starts. * Note that when capturing the old element, we don't deal with nesting at all. The tree for the purpose of allowing the compositor to capture the old state is flat. This can be revisited iteratively, it's done for implementation simplicity. * When building styles, the (inverse) parent transform is adjusted so that it's not applied twice. * Changed all the recursive functions to retrieve pseudo-elements to adapt to nested containers. Currently, by default mismatches here are handled by "last capture wins", however this is to be resolved in the CSSWG so it's not tested yet: w3c/csswg-drafts#10631 Note also that with the current implementation, after capturing the old state and before starting might appear broken, as clipping/opacity/etc are not applied to the generated pseudo-element. Bug: 347947051 Change-Id: I49e4f7ea6c8d82b6ad34b50f8cda92eb3f074612 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5749090 Commit-Queue: Noam Rosenthal <nrosenthal@chromium.org> Reviewed-by: Chris Harrelson <chrishtr@chromium.org> Reviewed-by: David Bokan <bokan@chromium.org> Cr-Commit-Position: refs/heads/main@{#1338296}
This tracks the view-transition-group for the captured elements as "containing group". Those values are filtered to only include ancestors. * When a captured element has a valid containing group, the pseudo-element is reparented to the containing group when the view transition starts. * Note that when capturing the old element, we don't deal with nesting at all. The tree for the purpose of allowing the compositor to capture the old state is flat. This can be revisited iteratively, it's done for implementation simplicity. * When building styles, the (inverse) parent transform is adjusted so that it's not applied twice. * Changed all the recursive functions to retrieve pseudo-elements to adapt to nested containers. Currently, by default mismatches here are handled by "last capture wins", however this is to be resolved in the CSSWG so it's not tested yet: w3c/csswg-drafts#10631 Note also that with the current implementation, after capturing the old state and before starting might appear broken, as clipping/opacity/etc are not applied to the generated pseudo-element. Bug: 347947051 Change-Id: I49e4f7ea6c8d82b6ad34b50f8cda92eb3f074612 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5749090 Commit-Queue: Noam Rosenthal <nrosenthal@chromium.org> Reviewed-by: Chris Harrelson <chrishtr@chromium.org> Reviewed-by: David Bokan <bokan@chromium.org> Cr-Commit-Position: refs/heads/main@{#1338296}
This tracks the view-transition-group for the captured elements as "containing group". Those values are filtered to only include ancestors. * When a captured element has a valid containing group, the pseudo-element is reparented to the containing group when the view transition starts. * Note that when capturing the old element, we don't deal with nesting at all. The tree for the purpose of allowing the compositor to capture the old state is flat. This can be revisited iteratively, it's done for implementation simplicity. * When building styles, the (inverse) parent transform is adjusted so that it's not applied twice. * Changed all the recursive functions to retrieve pseudo-elements to adapt to nested containers. Currently, by default mismatches here are handled by "last capture wins", however this is to be resolved in the CSSWG so it's not tested yet: w3c/csswg-drafts#10631 Note also that with the current implementation, after capturing the old state and before starting might appear broken, as clipping/opacity/etc are not applied to the generated pseudo-element. Bug: 347947051 Change-Id: I49e4f7ea6c8d82b6ad34b50f8cda92eb3f074612 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5749090 Commit-Queue: Noam Rosenthal <nrosenthal@chromium.org> Reviewed-by: Chris Harrelson <chrishtr@chromium.org> Reviewed-by: David Bokan <bokan@chromium.org> Cr-Commit-Position: refs/heads/main@{#1338296}
By "last capture wins" I think you mean we use the ancestor based on the new DOM? How do we deal with a case where the new element uses an ancestor which is not in the old element's ancestor chain? We have to figure out what the old transform should be in this case. I'm not opposed to this idea but stuff like the above seems easier to reason about with "least common ancestor". Since you can always map the cached old transform to any ancestor. The fallback is more like the default flat mode. |
The old element will save the final transform, and we'll project to be relative to the final parent.
Is there more stuff like the above? |
Ah, so figure out its transform relative to the root and map it into the chosen ancestor's space. Makes sense.
Everything else which is hierarchical (opacity, clip). If these effects are on the LCA then using that will look more correct. Though if they are on any node between the LCA and the new named element and we choose LCA then new would look wrong. So I'm fine with both. As you said, if this doesn't work authors can always fix it by using the LCA as the parent explicitly. |
Opacity & clip are different from transform in that sense. They would be applied on the parent element, which would clip/mask the whole layer underneath. In some cases it would look different from the original state, but there is no way around it (except for putting
Cool |
…r, a=testonly Automatic update from web-platform-tests Nested view transition: reparent & render This tracks the view-transition-group for the captured elements as "containing group". Those values are filtered to only include ancestors. * When a captured element has a valid containing group, the pseudo-element is reparented to the containing group when the view transition starts. * Note that when capturing the old element, we don't deal with nesting at all. The tree for the purpose of allowing the compositor to capture the old state is flat. This can be revisited iteratively, it's done for implementation simplicity. * When building styles, the (inverse) parent transform is adjusted so that it's not applied twice. * Changed all the recursive functions to retrieve pseudo-elements to adapt to nested containers. Currently, by default mismatches here are handled by "last capture wins", however this is to be resolved in the CSSWG so it's not tested yet: w3c/csswg-drafts#10631 Note also that with the current implementation, after capturing the old state and before starting might appear broken, as clipping/opacity/etc are not applied to the generated pseudo-element. Bug: 347947051 Change-Id: I49e4f7ea6c8d82b6ad34b50f8cda92eb3f074612 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5749090 Commit-Queue: Noam Rosenthal <nrosenthal@chromium.org> Reviewed-by: Chris Harrelson <chrishtr@chromium.org> Reviewed-by: David Bokan <bokan@chromium.org> Cr-Commit-Position: refs/heads/main@{#1338296} -- wpt-commits: c0b10b3c6286687496b07265dfca91eb5923cc79 wpt-pr: 47494
…r, a=testonly Automatic update from web-platform-tests Nested view transition: reparent & render This tracks the view-transition-group for the captured elements as "containing group". Those values are filtered to only include ancestors. * When a captured element has a valid containing group, the pseudo-element is reparented to the containing group when the view transition starts. * Note that when capturing the old element, we don't deal with nesting at all. The tree for the purpose of allowing the compositor to capture the old state is flat. This can be revisited iteratively, it's done for implementation simplicity. * When building styles, the (inverse) parent transform is adjusted so that it's not applied twice. * Changed all the recursive functions to retrieve pseudo-elements to adapt to nested containers. Currently, by default mismatches here are handled by "last capture wins", however this is to be resolved in the CSSWG so it's not tested yet: w3c/csswg-drafts#10631 Note also that with the current implementation, after capturing the old state and before starting might appear broken, as clipping/opacity/etc are not applied to the generated pseudo-element. Bug: 347947051 Change-Id: I49e4f7ea6c8d82b6ad34b50f8cda92eb3f074612 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5749090 Commit-Queue: Noam Rosenthal <nrosenthal@chromium.org> Reviewed-by: Chris Harrelson <chrishtr@chromium.org> Reviewed-by: David Bokan <bokan@chromium.org> Cr-Commit-Position: refs/heads/main@{#1338296} -- wpt-commits: c0b10b3c6286687496b07265dfca91eb5923cc79 wpt-pr: 47494
…r, a=testonly Automatic update from web-platform-tests Nested view transition: reparent & render This tracks the view-transition-group for the captured elements as "containing group". Those values are filtered to only include ancestors. * When a captured element has a valid containing group, the pseudo-element is reparented to the containing group when the view transition starts. * Note that when capturing the old element, we don't deal with nesting at all. The tree for the purpose of allowing the compositor to capture the old state is flat. This can be revisited iteratively, it's done for implementation simplicity. * When building styles, the (inverse) parent transform is adjusted so that it's not applied twice. * Changed all the recursive functions to retrieve pseudo-elements to adapt to nested containers. Currently, by default mismatches here are handled by "last capture wins", however this is to be resolved in the CSSWG so it's not tested yet: w3c/csswg-drafts#10631 Note also that with the current implementation, after capturing the old state and before starting might appear broken, as clipping/opacity/etc are not applied to the generated pseudo-element. Bug: 347947051 Change-Id: I49e4f7ea6c8d82b6ad34b50f8cda92eb3f074612 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5749090 Commit-Queue: Noam Rosenthal <nrosenthal@chromium.org> Reviewed-by: Chris Harrelson <chrishtr@chromium.org> Reviewed-by: David Bokan <bokan@chromium.org> Cr-Commit-Position: refs/heads/main@{#1338296} -- wpt-commits: c0b10b3c6286687496b07265dfca91eb5923cc79 wpt-pr: 47494
Follow up on #10334 (nested transitions)
It's clear what happens when both the old and new state have the same
view-transition-group
.We need to specify, however what happens when there is a mismatch.
Note that this mismatch can happen by use of keywords like
nearest
.Example:
A box sliding between two clipping containers
Several solutions to a mismatch:
view-transition-class
)Trade-offs:
view-transition-class
, however can create an abrupt experience: in the attached example, the element would disappear at the beginning of the transition and would animate in later.I tend to support option (4) because of the following:
view-transition-group
.The text was updated successfully, but these errors were encountered: