Re: [csswg-drafts] [css-view-transitions-1] Should contain layout/paint be required (#8139)

Summarizing an offline discussion. TLDR, no opposition to the following requirements on a shared element:

- Must force a stacking context.
- Must flatten all descendants into the coordinate space of the shared element. Or make `view-transition-name` a [grouping property](https://w3c.github.io/csswg-drafts/css-transforms-2/#grouping-property-values).

Both can be done with the proposal above to use `isolation: isolate` for these elements.

But with respect to whether the shared element needs to be a containing block, there's good points for both options:

- Force it to be a containing block for all positioned descendants.
   - This means all descendants transform with the shared element, which is what will happen when the descendants move as a part of the snapshot anyway (unless they are also shared elements).
   - Also avoids surprised where an element's snapshot is expanded significantly because a pos: fixed descendant is far off in the shared element's layout overflow.
   - Follows the pattern of `transform` which [forces a containing block](https://w3c.github.io/csswg-drafts/css-transforms-2/#transform-functions:~:text=while%20all%20other%20values%20(including%20%E2%80%9Cidentity%E2%80%9D%20transforms%20like%20translate%3A%200px)%20create%20a%20stacking%20context%20and%20containing%20block%20for%20all%20descendants%2C%20per%20usual%20for%20transforms.).

- Don't force it to be a containing block. You get the weird animation in the comment [above](https://github.com/w3c/csswg-drafts/issues/8139#issuecomment-1384771727), but:
   - Developers can fix it trivially by making the descendant a shared element.
   - They can also explicitly force the shared element to be a containing block (with `contain: layout` or `transform: translate: 0px`) if that's the desired behaviour. Instead of the browser forcing this behaviour that the developer can not change.

This needs more input from developers.


-- 
GitHub Notification of comment by khushalsagar
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8139#issuecomment-1385922128 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 17 January 2023 19:12:44 UTC