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] Define behavior of root element in layered capture #11150

Open
noamr opened this issue Nov 4, 2024 · 3 comments
Open

Comments

@noamr
Copy link
Collaborator

noamr commented Nov 4, 2024

With layered capture mode, it rarely makes sense to capture the root (document element) as style, and it's also not feasible to add a container to achieve the flat capture mode.
Suggesting that the root element is always captured as content (in flat mode).
See also #11078

@khushalsagar
Copy link
Member

Not using layered capture for the root makes sense. One interesting case here is what to do if there's a mismatch between capture mode for old and new element.

I thought it would be unnecessary to support that pattern and we can require having the same for both. But root->element or element->root would be a common case where that won't be true. For example, see (3) in container transform here.

@noamr
Copy link
Collaborator Author

noamr commented Nov 5, 2024

Not using layered capture for the root makes sense.

I'm actually not sure whether we need to special-case the document element, what does it buy us? In most cases the HTML element anyway doesn't have box decorations.

One thing we do need to address is the background color as it has special handling (default background? body background?).

One interesting case here is what to do if there's a mismatch between capture mode for old and new element.

I wonder if we need to handle mismatches at all, or just let them be - treat it as if the side of the mismatch that was flat had no box-decorations and tree effects and everything was content, similar to splitting it to two elements (container/content).

@khushalsagar
Copy link
Member

I wonder if we need to handle mismatches at all, or just let them be

Theoretically a mismatch shouldn't be an issue with interpolatable properties. If there's a mismatch you get an animation from border: 10px -> border: 0px. But I wasn't sure if the UA CSS set up for layered capture could make things look visually wrong. The fact that we use relative positioning instead of absolute positioning for image-pair example.

But likely no. The difference with positioning shows up as which reference box the image-pair is aligned with, which is irrelevant if all the styles are unset in flat mode. So we'll need to be explicit about the way we set up the CSS if only one side has opted-in. Otherwise sounds like it should work.

And actually root -> root or root <-> element type of transitions do want root to be layered to animate the background. So makes sense to support it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants