-
Notifications
You must be signed in to change notification settings - Fork 709
[css-view-transitions-1] Positioning of ::view-transition (the root pseudo) #8070
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
Comments
Assuming we go with option 2, a related issue is what happens if author style does something else, e.g. |
That's my preference. |
+1 to author style can not change the computed |
Isn't it better to just say the snapshot viewport is |
Fair. So ::view-transition's containing block is the snapshot viewport which has no ancestor containing block. No matter what its position value is, the containing block remains the same. |
Since this change has consensus here and will get wider review once we commit the change, we likely do not need to spend meeting time on it. The CSSWG will automatically accept this resolution one week from now if no objections are raised here. Anyone can add an emoji to this comment to express support. If you do not support this resolution, please add a new comment. Proposed Resolution: ::view-transition's containing block is the snapshot viewport |
RESOLVED: ::view-transition's containing block is the snapshot viewport |
Edits landed in #8126. |
The ::view-transition is positioned behind viewport-insetting UI such as the mobile URL bar, RTL/left-side vertical scrollbars, and virtual keyboards. The ::view-transition needs to have its size and position set to match the "snapshot root rect"[0]. Currently this is achieved by directly setting the size and location on the ::view-transition's style in the UA stylesheet. However, this comes with several drawbacks: * Requires the main thread to perform an update to change the position. The mobile URL bar can animate in on the compositor thread without a Blink update. * Makes it difficult for authors to style ::view-transition themselves. E.g. to shift the transition they'd have to use getComputedStyle and add their own value, which could be overwritten by the UA. * Is visible to authors via getComputedStyle which could complicate making changes in this area in the future. w3c/csswg-drafts#8070 resolved and specified that the containing block of `::view-transition` should be the snapshot root rect. This CL removes replaces the styles on ::view-transition with `position:fixed; inset: 0` and special cases the containing block for the ::view-transition pseudo element to match the geometry of the snapshot root rect. [0] https://chromium.googlesource.com/chromium/src/+/main/third_party/blink/renderer/core/view_transition/README.md#viewport-sizes Bug: 1383980 Change-Id: Ie05de201dd3775717d4e231d08299471d68a2de4
The ::view-transition is positioned behind viewport-insetting UI such as the mobile URL bar, RTL/left-side vertical scrollbars, and virtual keyboards. The ::view-transition needs to have its size and position set to match the "snapshot root rect"[0]. Currently this is achieved by directly setting the size and location on the ::view-transition's style in the UA stylesheet. However, this comes with several drawbacks: * Requires the main thread to perform an update to change the position. The mobile URL bar can animate in on the compositor thread without a Blink update. * Makes it difficult for authors to style ::view-transition themselves. E.g. to shift the transition they'd have to use getComputedStyle and add their own value, which could be overwritten by the UA. * Is visible to authors via getComputedStyle which could complicate making changes in this area in the future. w3c/csswg-drafts#8070 resolved and specified that the containing block of `::view-transition` should be the snapshot root rect. This CL removes replaces the styles on ::view-transition with `position:fixed; inset: 0` and special cases the containing block for the ::view-transition pseudo element to match the geometry of the snapshot root rect. [0] https://chromium.googlesource.com/chromium/src/+/main/third_party/blink/renderer/core/view_transition/README.md#viewport-sizes Bug: 1383980 Change-Id: Ie05de201dd3775717d4e231d08299471d68a2de4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4166263 Reviewed-by: Vladimir Levin <vmpstr@chromium.org> Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org> Commit-Queue: David Bokan <bokan@chromium.org> Reviewed-by: Khushal Sagar <khushalsagar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1096264}
The ::view-transition is positioned behind viewport-insetting UI such as the mobile URL bar, RTL/left-side vertical scrollbars, and virtual keyboards. The ::view-transition needs to have its size and position set to match the "snapshot root rect"[0]. Currently this is achieved by directly setting the size and location on the ::view-transition's style in the UA stylesheet. However, this comes with several drawbacks: * Requires the main thread to perform an update to change the position. The mobile URL bar can animate in on the compositor thread without a Blink update. * Makes it difficult for authors to style ::view-transition themselves. E.g. to shift the transition they'd have to use getComputedStyle and add their own value, which could be overwritten by the UA. * Is visible to authors via getComputedStyle which could complicate making changes in this area in the future. w3c/csswg-drafts#8070 resolved and specified that the containing block of `::view-transition` should be the snapshot root rect. This CL removes replaces the styles on ::view-transition with `position:fixed; inset: 0` and special cases the containing block for the ::view-transition pseudo element to match the geometry of the snapshot root rect. [0] https://chromium.googlesource.com/chromium/src/+/main/third_party/blink/renderer/core/view_transition/README.md#viewport-sizes Bug: 1383980 Change-Id: Ie05de201dd3775717d4e231d08299471d68a2de4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4166263 Reviewed-by: Vladimir Levin <vmpstr@chromium.org> Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org> Commit-Queue: David Bokan <bokan@chromium.org> Reviewed-by: Khushal Sagar <khushalsagar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1096264}
The ::view-transition is positioned behind viewport-insetting UI such as the mobile URL bar, RTL/left-side vertical scrollbars, and virtual keyboards. The ::view-transition needs to have its size and position set to match the "snapshot root rect"[0]. Currently this is achieved by directly setting the size and location on the ::view-transition's style in the UA stylesheet. However, this comes with several drawbacks: * Requires the main thread to perform an update to change the position. The mobile URL bar can animate in on the compositor thread without a Blink update. * Makes it difficult for authors to style ::view-transition themselves. E.g. to shift the transition they'd have to use getComputedStyle and add their own value, which could be overwritten by the UA. * Is visible to authors via getComputedStyle which could complicate making changes in this area in the future. w3c/csswg-drafts#8070 resolved and specified that the containing block of `::view-transition` should be the snapshot root rect. This CL removes replaces the styles on ::view-transition with `position:fixed; inset: 0` and special cases the containing block for the ::view-transition pseudo element to match the geometry of the snapshot root rect. [0] https://chromium.googlesource.com/chromium/src/+/main/third_party/blink/renderer/core/view_transition/README.md#viewport-sizes Bug: 1383980 Change-Id: Ie05de201dd3775717d4e231d08299471d68a2de4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4166263 Reviewed-by: Vladimir Levin <vmpstr@chromium.org> Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org> Commit-Queue: David Bokan <bokan@chromium.org> Reviewed-by: Khushal Sagar <khushalsagar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1096264}
…r ::view-transition, a=testonly Automatic update from web-platform-tests vt: Snapshot rect is containing block for ::view-transition The ::view-transition is positioned behind viewport-insetting UI such as the mobile URL bar, RTL/left-side vertical scrollbars, and virtual keyboards. The ::view-transition needs to have its size and position set to match the "snapshot root rect"[0]. Currently this is achieved by directly setting the size and location on the ::view-transition's style in the UA stylesheet. However, this comes with several drawbacks: * Requires the main thread to perform an update to change the position. The mobile URL bar can animate in on the compositor thread without a Blink update. * Makes it difficult for authors to style ::view-transition themselves. E.g. to shift the transition they'd have to use getComputedStyle and add their own value, which could be overwritten by the UA. * Is visible to authors via getComputedStyle which could complicate making changes in this area in the future. w3c/csswg-drafts#8070 resolved and specified that the containing block of `::view-transition` should be the snapshot root rect. This CL removes replaces the styles on ::view-transition with `position:fixed; inset: 0` and special cases the containing block for the ::view-transition pseudo element to match the geometry of the snapshot root rect. [0] https://chromium.googlesource.com/chromium/src/+/main/third_party/blink/renderer/core/view_transition/README.md#viewport-sizes Bug: 1383980 Change-Id: Ie05de201dd3775717d4e231d08299471d68a2de4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4166263 Reviewed-by: Vladimir Levin <vmpstr@chromium.org> Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org> Commit-Queue: David Bokan <bokan@chromium.org> Reviewed-by: Khushal Sagar <khushalsagar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1096264} -- wpt-commits: aed10a113c9fc16605ea2ba2df218e6f3dec3f54 wpt-pr: 38131
…r ::view-transition, a=testonly Automatic update from web-platform-tests vt: Snapshot rect is containing block for ::view-transition The ::view-transition is positioned behind viewport-insetting UI such as the mobile URL bar, RTL/left-side vertical scrollbars, and virtual keyboards. The ::view-transition needs to have its size and position set to match the "snapshot root rect"[0]. Currently this is achieved by directly setting the size and location on the ::view-transition's style in the UA stylesheet. However, this comes with several drawbacks: * Requires the main thread to perform an update to change the position. The mobile URL bar can animate in on the compositor thread without a Blink update. * Makes it difficult for authors to style ::view-transition themselves. E.g. to shift the transition they'd have to use getComputedStyle and add their own value, which could be overwritten by the UA. * Is visible to authors via getComputedStyle which could complicate making changes in this area in the future. w3c/csswg-drafts#8070 resolved and specified that the containing block of `::view-transition` should be the snapshot root rect. This CL removes replaces the styles on ::view-transition with `position:fixed; inset: 0` and special cases the containing block for the ::view-transition pseudo element to match the geometry of the snapshot root rect. [0] https://chromium.googlesource.com/chromium/src/+/main/third_party/blink/renderer/core/view_transition/README.md#viewport-sizes Bug: 1383980 Change-Id: Ie05de201dd3775717d4e231d08299471d68a2de4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4166263 Reviewed-by: Vladimir Levin <vmpstr@chromium.org> Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org> Commit-Queue: David Bokan <bokan@chromium.org> Reviewed-by: Khushal Sagar <khushalsagar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1096264} -- wpt-commits: aed10a113c9fc16605ea2ba2df218e6f3dec3f54 wpt-pr: 38131
The ::view-transition is positioned behind viewport-insetting UI such as the mobile URL bar, RTL/left-side vertical scrollbars, and virtual keyboards. The ::view-transition needs to have its size and position set to match the "snapshot root rect"[0]. Currently this is achieved by directly setting the size and location on the ::view-transition's style in the UA stylesheet. However, this comes with several drawbacks: * Requires the main thread to perform an update to change the position. The mobile URL bar can animate in on the compositor thread without a Blink update. * Makes it difficult for authors to style ::view-transition themselves. E.g. to shift the transition they'd have to use getComputedStyle and add their own value, which could be overwritten by the UA. * Is visible to authors via getComputedStyle which could complicate making changes in this area in the future. w3c/csswg-drafts#8070 resolved and specified that the containing block of `::view-transition` should be the snapshot root rect. This CL removes replaces the styles on ::view-transition with `position:fixed; inset: 0` and special cases the containing block for the ::view-transition pseudo element to match the geometry of the snapshot root rect. [0] https://chromium.googlesource.com/chromium/src/+/main/third_party/blink/renderer/core/view_transition/README.md#viewport-sizes Bug: 1383980 Change-Id: Ie05de201dd3775717d4e231d08299471d68a2de4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4166263 Reviewed-by: Vladimir Levin <vmpstr@chromium.org> Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org> Commit-Queue: David Bokan <bokan@chromium.org> Reviewed-by: Khushal Sagar <khushalsagar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1096264}
…r ::view-transition, a=testonly Automatic update from web-platform-tests vt: Snapshot rect is containing block for ::view-transition The ::view-transition is positioned behind viewport-insetting UI such as the mobile URL bar, RTL/left-side vertical scrollbars, and virtual keyboards. The ::view-transition needs to have its size and position set to match the "snapshot root rect"[0]. Currently this is achieved by directly setting the size and location on the ::view-transition's style in the UA stylesheet. However, this comes with several drawbacks: * Requires the main thread to perform an update to change the position. The mobile URL bar can animate in on the compositor thread without a Blink update. * Makes it difficult for authors to style ::view-transition themselves. E.g. to shift the transition they'd have to use getComputedStyle and add their own value, which could be overwritten by the UA. * Is visible to authors via getComputedStyle which could complicate making changes in this area in the future. w3c/csswg-drafts#8070 resolved and specified that the containing block of `::view-transition` should be the snapshot root rect. This CL removes replaces the styles on ::view-transition with `position:fixed; inset: 0` and special cases the containing block for the ::view-transition pseudo element to match the geometry of the snapshot root rect. [0] https://chromium.googlesource.com/chromium/src/+/main/third_party/blink/renderer/core/view_transition/README.md#viewport-sizes Bug: 1383980 Change-Id: Ie05de201dd3775717d4e231d08299471d68a2de4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4166263 Reviewed-by: Vladimir Levin <vmpstr@chromium.org> Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org> Commit-Queue: David Bokan <bokan@chromium.org> Reviewed-by: Khushal Sagar <khushalsagar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1096264} -- wpt-commits: aed10a113c9fc16605ea2ba2df218e6f3dec3f54 wpt-pr: 38131
In #7859 we resolved on the concept of a "snapshot viewport", which would be consistent regardless of things like URL bar, virtual keyboard, and scrollbars, meaning animations would be stable, even if those things only existed on one side of the transition.
This means
::view-transition
would fill this snapshot viewport throughout the transition.We see two options to achieve this:
Option 1: Position
::view-transition
per frame::view-transition
would use regularposition: fixed
positioning.inset: 0
would only fill the layout viewport, which is often smaller than the snaphshot viewport. So, to fix this, negativeinset
values would be used to make::view-transition
fill the snapshot viewport. These values would be updated per frame, to ensure the positioning is correct during any state changes (eg url bar hiding/showing).This would be developer-visible via
getComputedStyle
, and would behave differently if the position was set to a non-fixed value.In browsers that use a compositor to manage
position: fixed
items, there's a worry that there may be rendering instability in frames where the compositor is 'ahead' of the main thread's updates to theinset
.Option 2: Layout
::view-transition
within the "snapshot viewport"The
::view-transition
would haveposition: fixed; inset: 0
. However, we would use spec prose to say this pseudo is laid out in the snapshot viewport, soposition: fixed; inset: 0
would cause::view-transition
to fill the snapshot viewport, rather than the layout viewport.This wouldn't have the compositor issues, as it isn't dependent on main thread style updates. However, it's perhaps a bit weird for this one pseudo to appear to treat layout differently. Is there anything else that does something similar?
We're leaning towards "option 2".
The text was updated successfully, but these errors were encountered: