-
Notifications
You must be signed in to change notification settings - Fork 679
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-1] Clarify rendering constraints for elements participating in a transition #8139
Comments
If removed, we would also have to explain in the view transition spec what happens. Since the snapshot capture would produce an atomic image, the positioned elements would be positioned initially with its real containing block, but then they will move with the pseudo element, which isn't what "normal" animations would do. |
I would lean towards not requiring And more importantly, requiring it invites errors in the form of accidentally overwriting |
@fantasai does this need to be aired in a CSSWG meeting? (assuming consensus here is to remove the |
+1 from me as well to remove the contain requirement. But one side effect of contain: layout (or paint) is that the element becomes a stacking context. And we do need this to capture the element as an atomic image. The spec could say that if an element has a non-none computed value for So could we require that developers explicitly ensure that named elements create a stacking context? It could be from an effect (like |
To add to this, I think elements participating in a view transition should have both I want to consider that As a side note, |
+1 to requiring elements participating in a transition to have I don't have a strong preference on whether isolation should be implicitly applied based on
@fantasai @tabatkins do you have a suggestion on which pattern is better based on best CSS practices. |
Layout containment aside, I'm still not convinced that we don't want the shared element to be a containing block for positioned descendants. As Jake described it initially, the effect you would get looks strange. Although I agree that the case may be rare, I think having the shared element be a containing block up front seems better and more helpful to help the developer fix their page |
The case Jake described is the reason I'm advocating against forcing the shared element to be a containing block for positioned descendants. For the layout issue mentioned in the first comment, where the nested element moves with the shared element as a part of its snapshot, developers can easily workaround this by making the descendant a shared element. Here is a concrete example (needs Chrome running with ViewTransition enabled) which simulates what will happen if the ancestor shared element is not a containing block for a fixed position descendant:
The start/end viewport positions of On the other hand if we force shared elements to become containing blocks, authors will have no choice but to change the DOM topology if there are positioned descendants. This can be fairly complicated. Also want to point that this is not a theoretical case, we have seen partner use-cases like this. |
I'm not against
I don't know if you meant this literally, but I don't think it should work literally like this. That isn't how it works with
I don't fully get the reasons for this, but I don't mind that being a restriction. It's something we can revisit later if needed. |
Summarizing an offline discussion. TLDR, no opposition to the following requirements on a shared element:
Both can be done with the proposal above to use But with respect to whether the shared element needs to be a containing block, there's good points for both options:
This needs more input from developers. |
This won't literally use
I like features that have a default that prevents common errors, especially if that error isn't immediately obvious. But in this case any error will be immediately obvious. And, I think there will be cases where the developer really doesn't want a containing block here. |
Depends on how we want to spec it:
Since
+1. That's why I'm leaning towards no containing block by default, with guidance on how developers can detect and fix common errors (by manually adding |
I vote for 1, since that's how the other grouping properties behave. Or is this behaving differently to other grouping properties? |
From this:
Follows that |
Damn, we just hit that after several hours of debugging 🙈 |
Sorry @ydaniv, this is getting fixed soon. :) I missed another restriction we need, the named element needs to be the backdrop root for descendants with a backdrop filter. Given that this element's painting will be rendered via the pseudo-element, it doesn't make sense for an ancestor to readback the named element's painting. @mfreed7 FYI. So the constraints required on a named element, implicitly applied if it has a non-none computed value for view-transition-name, are:
Still undecided on whether it needs to be a containing block. |
One decision remaining on this, is how we should handle:
Source<style>
.named-element,
.child {
width: 150px;
height: 150px;
background: green;
}
.named-element {
view-transition-name: named-element;
margin: 120px;
}
.child {
background: blue;
position: fixed;
top: 0;
left: 0;
}
</style>
<div class="named-element">
named-element
<div class="child">child</div>
</div> Which looks like this: How should the view-transition work, considering changes to Option 1: Capture as-isCapture Here's how the background color and position transitions would look: out.mp4The background color animation looks good. However, the position transition doesn't look 'right', since the captures move with the bounding box of If this isn't what the developer wants, they can make the child part of the transition too: .child {
view-transition-name: child;
} And the result: out.mp4Option 2: Exclude the child from the capture
Here's how that would look: out.mp4This doesn't look quite right, as the The fix is the same as before, which is to make the child part of the transition. This option seems similar to how Firefox handled Option 3: Force a containing blockAdding a non- When the developer does this, their layout will break before they even get to the transition, which should be easy to spot. The best fix for this would be for the developer to change the DOM so the fix-pos element is no longer within This is already the case if the developer wants to animate a transform. |
Note regarding option 3, we may be able to say that |
Thanks for the excellent summary @jakearchibald and @flackr for thinking through the options. We've been weighing these options against 3 parameters: developer expectations (does the behaviour during the transition align with what developers would expect given a layout), developer ease of use (how easy is to for developers to get the behaviour they want, if the default doesn't work for them) and ease of implementation for the engine. Here's my take for the 3 options:
My preference order would be option 1 followed by option 4. Option 2 trades one set of unexpected behaviour from option 1 with a different set of unexpected behaviour and adds implementation complexity. Option 3 seems too restrictive for developers. I'd err on the option which is better for developer expectation/ease of use so would help to hear developer feedback on this. @mirisuzanne FYI. |
I really want to keep this simple rule for developers: When a view transition happens, for each element with a Given that, I'm not convinced that option 1 breaks developer expectations. Or, if it isn't initially what they expect, a quick look at the Even with forcing a containment block, you can achieve the same effect by counter-transforming the child element (it's how the demo was made). It looks weird, sure, but it's following the rule of capturing the element as an image, which seems easy to understand. Option 2 is a smart workaround, but it breaks the simple rule. The rule becomes: When a view transition happens, for each element with a I think that's much harder to understand, and will lead to more unexpected behaviour. Also, when developers encounter this unexpected behaviour, I don't think they're going to easily figure out what's happening. Option 3 maintains the simple rule, but adds an additional rule: Option 4 builds on option 3 by giving you a way to workaround the issue without changing DOM, but it seems like a new bit of layout 'magic' to learn. My preference is option 1. It does what it says, without introducing new rules to learn. If it creates an effect the developer doesn't want, it's easy to figure out and resolve. |
I agree with @jakearchibald on this – I'd vote for option 1. When option 1 'fails' (by not providing a perfect default transition) - that failure is clear to see, understand, and address without any changes to the DOM or other aspects of the layout. The solution is contained to the view-transition. The other options try to magically enforce a perfect default, but end up introducing less obvious side-effects. |
Summary for the CSSWG meeting: In our early implementation, paint containment was required for captured elements. .header {
view-transition-name: header;
contain: paint;
} This requirement was lifted, but we still required layout containment, to ensure captured elements were containing blocks. .header {
view-transition-name: header;
contain: layout;
} This turned out to be frustrating, because it was easy to forget about, the transition would fail, you'd see the warning in dev tools, then add Resolution 1 of 2: Remove the requirement to set Assuming resolution 1 is passed, a non-
…which is the same set of behaviours that comes with The remaining question is: how should we handle elements within the captured element, that use a containing block that's outside the element? We've seen this in the wild, with one of our partners testing the API - they had a pos-fixed close button inside an element with a In cases like this, the size and position of the group is still the border-box of the element with the If the element moves position (and the pos-fixed element naturally doesn't), you can end up with a transition which looks like this: out.mp4…where the pos-fixed element moves when it shouldn't. We considered forcing a containing block to prevent this effect (similar to setting a We also considered more complex solutions that allowed for the fix-pos element to be excluded from the capture, and instead be captured along with the group associated with its containing block. However, we concluded that:
So resolution 2 of 2: Don't require or force a containing block. Capture the element and all its descendants as-is, even if they're positioned to a parent containing block. |
Given that opacity has established that we can paint the content independently without containment, I think technically option 1 should work. My main concern is that non-contained descendants will result in the capture being much larger than the developer realizes (e.g. bounding box of the capture element to the current position of the descendants), however perhaps #8282 will help with this and make it less of an issue. I was also concerned that the inconsistency between this behavior (which effectively allows animating transform without containment) where normally any non-none transform forces containment would be confusing for developers. I can understand how forcing containment can be surprising to developers, but it is the way that transforms work which developers already likely have to deal with. I'm not sure what lead to transforms doing this, and if that rationale is applicable here. Perhaps opacity behaving differently is a good reason we don't need this. |
#913 has history behind why transforms force a containing block. The short answer is implementation complexity across all engines, effects like |
The CSS Working Group just discussed
The full IRC log of that discussion<JakeA> https://github.com//issues/8139#issuecomment-1422602510<TabAtkins> JakeA: I linked to an overview <TabAtkins> JakeA: trying to roll two resolutions into one, very related <chris> thanks fantasai <emilio> persent+ <TabAtkins> JakeA: when we first did an experimental impl, we required paint containment on anything that was gonna be a view transition group <TabAtkins> JakeA: we improved our impl and no longer needed that <TabAtkins> JakeA: We're still asking for contain:layout to make it a containing block, tho <TabAtkins> JakeA: This is a bad dev exp <TabAtkins> JakeA: The transition fails, dunno what's going on, have to look in devtools for it <TabAtkins> JakeA: We've heard from devs they hit the smae issues <TabAtkins> JakeA: So first proposed resolution is we remove the contain:layout requirement, and instead we auto-apply those containments to elements with a view-transition name <florian> q+ <TabAtkins> JakeA: This is similar to how opacity triggers a stackign context, etc <argyle> yay, remove it! JIT contain <astearns> ack florian <TabAtkins> florian: So when you turn things on, you're not modifying 'contain' computed value, but turning them on *as if* contain was set appropriately? <TabAtkins> JakeA: Yeah, doing same as opacity <TabAtkins> florian: sounds reasonable <TabAtkins> florian: I think content-visibility also turns on some containment without messing with computed value <miriam> `container-type` does the same <dbaron> Agree that it should be consistent with content-visibility... which I think this is. <TabAtkins> +1 <argyle> +1 <TabAtkins> fantasai: Are you planning to auto-apply layout containment? <TabAtkins> JakeA: That's the second part of the issue <TabAtkins> PROPOSED RESOLUTION: Remove contain:layout requirement from view transitions <TabAtkins> TabAtkins: This is an incomplete reoslution - we're just changing it from "author must specify" to "we automatically add containment" <TabAtkins> RESOLVED: Remove contain:layout requirement for view-transition to work <TabAtkins> JakeA: So adding view-transition makes the element a stackign content, a backing root, etc. Same as opacity. <TabAtkins> JakeA: Shoudl it also become a containing block? <TabAtkins> JakeA: So what should happen to elements inside the transitioning element that use a containing block outside? We've seen examples of fixpos. <fantasai> s/stackign content, a backing root, etc./generate a stacking context, be agrouping property (forces flat preserve-3d), and be a backdrop root/ <TabAtkins> JakeA: If the beahvior is that we capture the texture as-is (the fixpos is contained in that capture) and we do a transition where the element moves without hte fixpos moving with it <TabAtkins> JakeA: it can look odd - the fixpos is now in a different relative position, but the texture hasn't been updated <TabAtkins> JakeA: There's a video in the issue if my description is confusing <TabAtkins> JakeA: We considered forcing a containing block to prevent that effect <TabAtkins> JakeA: That requires the dev to move the fixpos out of the captured element <TabAtkins> JakeA: Also considered more complex to exclude the fixpos from the capture <TabAtkins> JakeA: Instead capturing it with their containing block <TabAtkins> JakeA: Our conclusion is tha tforcing a CB requires the author to change their DOM, which seems bad, and we have real-world cases that hit this <TabAtkins> JakeA: We also want to keep a simple rule that an element with a view-transition captures the element and its descendants. Not capturing fixposes breaks that. <TabAtkins> JakeA: If we don't fix this tho, we get animations that the author clearly didn't intend <TabAtkins> JakeA: The easiest fix seems to be to give the fixpos a view-transition name, so it view-transitions on its own <emilio> q+ <astearns> ack emilio <TabAtkins> JakeA: So our proposal is that view-transitions *do not* force a containing block <TabAtkins> emilio: What's the plan for animating transform on the image? <fantasai> summary comment is https://github.com//issues/8139#issuecomment-1422602510 btw <TabAtkins> emilio: That seems like it adds complications vs creating a fixpos CB <TabAtkins> JakeA: If animating a transform on the old or new view, you're moving the texture around as a group - you can see it in the video in the issue <TabAtkins> emilio: You need to define the bounds that somehow encloses the abspos and fixpos, otherwise what you're animating is not... i think it introduces complications <TabAtkins> JakeA: The demo I posted in the issue, I created that by having an abspos that starts outside the border of the VT element. We don't do paint containment anymore, so that's fine. You already have to calculate the size and positions from the VT elements, even i there's ink overflow (shadows, filters, or things like positioned descendants) <TabAtkins> emilio: So the transform box is the element, and everything that escapes is just overflow. <TabAtkins> emilio: So if you set trasnform-origin, what are those %s relative to? <TabAtkins> JakeA: If you're setting trasnform-origin on the ::view-* pseudos, it's relative to the border box of that element. <TabAtkins> JakeA: We allow repalced content to overflow (ink overflow). <TabAtkins> emilio: Right, but ink overflow here includes abspos element that used to overflow the transitioning element <TabAtkins> JakeA: That's true today, right? <TabAtkins> emilio: The box relationship is different when you have fixpos inside a transform vs not <khush> q+ <TabAtkins> emilio: So it might be weird if it takes the same trasnform origin <TabAtkins> emilio: But maybe it's okay for the transition.. <TabAtkins> (I still don't understand the issue being discussed.) <astearns> ack khush <TabAtkins> khush: Impl-wise, we use a very similar path to opacity. <TabAtkins> khush: Say the element has to be painted atomically. For elements tha toverflow you find out where they are relative to the VT element, and just use object-overflwo. The layout overflow of the element becomes ink overflow of the transition pseudo. <TabAtkins> emilio: Okay that answers my question <TabAtkins> JakeA: So proposed resolution is view-transition does not create a containing block for the element <TabAtkins> astearns: Proposed resolution is that view-transition makes the element a stacking context, a grouping element, and a backdrop root <TabAtkins> smfr: This applies at all times, not just while the transition is running, right? <TabAtkins> JakeA: Yes, we think that's more consistent. <TabAtkins> smfr: I think a note in the spec about the fixpos behavior would be useful. <TabAtkins> TabAtkins: Are these effects different from contain:layout? <TabAtkins> JakeA: Yes, layout contianment causes a CB as well. <TabAtkins> flackr: I have a concern that this can make it easy for devs to make large cpatured elements, but there's another issue about that and shoudln't block this <TabAtkins> flackr: Also this is different from transform, and I just wanted to make sure there weren't transform-relevant reasons to make it similar, but khushal's response answers that <TabAtkins> astearns: Objections? <TabAtkins> RESOLVED: A non-none view-transition-name acts similar to a non-1 opacity (stacking context, grouping element, backdrop root) <fantasai> scribenick: fantasai |
This reverts commit f2820f7b99c149d989dee94c1b23c791a7b5f387. This was reverted earlier to wait for CSSWG feedback. The resolution aligns with the behaviour in this patch. w3c/csswg-drafts#8139 Original change's description: > Revert "VT: Remove containment requirement." > > This reverts commit e554cf340761c4b11e0da4d0c98b1b58f9189cbd. > > Reason for revert: Decided against this feature for now. > > Original change's description: > > VT: Remove containment requirement. > > > > This patch removes the containment requirement from view-transitions. > > > > This is to align with proposed resolution > > w3c/csswg-drafts#7882 > > > > R=khushalsagar@chromium.org, bokan@chromium.org > > > > Fixed: 1409491 > > Change-Id: Iad0eb54c8d2de503f209a58a9f438e586fcd6a36 > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4188811 > > Reviewed-by: David Bokan <bokan@chromium.org> > > Reviewed-by: Khushal Sagar <khushalsagar@chromium.org> > > Commit-Queue: Vladimir Levin <vmpstr@chromium.org> > > Cr-Commit-Position: refs/heads/main@{#1096187} > > Change-Id: Id0b58230eb372a96aa1f1dff2e7d84e2f297219f > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4192788 > Commit-Queue: Vladimir Levin <vmpstr@chromium.org> > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > Cr-Commit-Position: refs/heads/main@{#1096273} Change-Id: I3da1ee9d5e00b2a9470b99b5f69704fc9b4d0105
This reverts commit f2820f7. This was reverted earlier to wait for CSSWG feedback. The resolution aligns with the behaviour in this patch. w3c/csswg-drafts#8139 Original change's description: > Revert "VT: Remove containment requirement." > > This reverts commit e554cf3. > > Reason for revert: Decided against this feature for now. > > Original change's description: > > VT: Remove containment requirement. > > > > This patch removes the containment requirement from view-transitions. > > > > This is to align with proposed resolution > > w3c/csswg-drafts#7882 > > > > R=khushalsagar@chromium.org, bokan@chromium.org > > > > Fixed: 1409491 > > Change-Id: Iad0eb54c8d2de503f209a58a9f438e586fcd6a36 > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4188811 > > Reviewed-by: David Bokan <bokan@chromium.org> > > Reviewed-by: Khushal Sagar <khushalsagar@chromium.org> > > Commit-Queue: Vladimir Levin <vmpstr@chromium.org> > > Cr-Commit-Position: refs/heads/main@{#1096187} > > Change-Id: Id0b58230eb372a96aa1f1dff2e7d84e2f297219f > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4192788 > Commit-Queue: Vladimir Levin <vmpstr@chromium.org> > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > Cr-Commit-Position: refs/heads/main@{#1096273} Change-Id: I3da1ee9d5e00b2a9470b99b5f69704fc9b4d0105 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4233087 Commit-Queue: Vladimir Levin <vmpstr@chromium.org> Commit-Queue: Khushal Sagar <khushalsagar@chromium.org> Auto-Submit: Khushal Sagar <khushalsagar@chromium.org> Reviewed-by: Vladimir Levin <vmpstr@chromium.org> Cr-Commit-Position: refs/heads/main@{#1102856}
This reverts commit f2820f7b99c149d989dee94c1b23c791a7b5f387. This was reverted earlier to wait for CSSWG feedback. The resolution aligns with the behaviour in this patch. w3c/csswg-drafts#8139 Original change's description: > Revert "VT: Remove containment requirement." > > This reverts commit e554cf340761c4b11e0da4d0c98b1b58f9189cbd. > > Reason for revert: Decided against this feature for now. > > Original change's description: > > VT: Remove containment requirement. > > > > This patch removes the containment requirement from view-transitions. > > > > This is to align with proposed resolution > > w3c/csswg-drafts#7882 > > > > R=khushalsagar@chromium.org, bokan@chromium.org > > > > Fixed: 1409491 > > Change-Id: Iad0eb54c8d2de503f209a58a9f438e586fcd6a36 > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4188811 > > Reviewed-by: David Bokan <bokan@chromium.org> > > Reviewed-by: Khushal Sagar <khushalsagar@chromium.org> > > Commit-Queue: Vladimir Levin <vmpstr@chromium.org> > > Cr-Commit-Position: refs/heads/main@{#1096187} > > Change-Id: Id0b58230eb372a96aa1f1dff2e7d84e2f297219f > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4192788 > Commit-Queue: Vladimir Levin <vmpstr@chromium.org> > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > Cr-Commit-Position: refs/heads/main@{#1096273} Change-Id: I3da1ee9d5e00b2a9470b99b5f69704fc9b4d0105 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4233087 Commit-Queue: Vladimir Levin <vmpstr@chromium.org> Commit-Queue: Khushal Sagar <khushalsagar@chromium.org> Auto-Submit: Khushal Sagar <khushalsagar@chromium.org> Reviewed-by: Vladimir Levin <vmpstr@chromium.org> Cr-Commit-Position: refs/heads/main@{#1102856}
This reverts commit f2820f7b99c149d989dee94c1b23c791a7b5f387. This was reverted earlier to wait for CSSWG feedback. The resolution aligns with the behaviour in this patch. w3c/csswg-drafts#8139 Original change's description: > Revert "VT: Remove containment requirement." > > This reverts commit e554cf340761c4b11e0da4d0c98b1b58f9189cbd. > > Reason for revert: Decided against this feature for now. > > Original change's description: > > VT: Remove containment requirement. > > > > This patch removes the containment requirement from view-transitions. > > > > This is to align with proposed resolution > > w3c/csswg-drafts#7882 > > > > R=khushalsagar@chromium.org, bokan@chromium.org > > > > Fixed: 1409491 > > Change-Id: Iad0eb54c8d2de503f209a58a9f438e586fcd6a36 > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4188811 > > Reviewed-by: David Bokan <bokan@chromium.org> > > Reviewed-by: Khushal Sagar <khushalsagar@chromium.org> > > Commit-Queue: Vladimir Levin <vmpstr@chromium.org> > > Cr-Commit-Position: refs/heads/main@{#1096187} > > Change-Id: Id0b58230eb372a96aa1f1dff2e7d84e2f297219f > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4192788 > Commit-Queue: Vladimir Levin <vmpstr@chromium.org> > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > Cr-Commit-Position: refs/heads/main@{#1096273} Change-Id: I3da1ee9d5e00b2a9470b99b5f69704fc9b4d0105 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4233087 Commit-Queue: Vladimir Levin <vmpstr@chromium.org> Commit-Queue: Khushal Sagar <khushalsagar@chromium.org> Auto-Submit: Khushal Sagar <khushalsagar@chromium.org> Reviewed-by: Vladimir Levin <vmpstr@chromium.org> Cr-Commit-Position: refs/heads/main@{#1102856}
@fantasai @tabatkins I need a bit of advice for speccing this. It seems like there isn't consistency when it comes to where to define this. The choices are:
Taking Should I just do the same as opacity here, and do both options depending on the effect? In cases I do option 2, I'll add a note to the view transitions spec. |
…nt.", a=testonly Automatic update from web-platform-tests Reland "VT: Remove containment requirement." This reverts commit f2820f7b99c149d989dee94c1b23c791a7b5f387. This was reverted earlier to wait for CSSWG feedback. The resolution aligns with the behaviour in this patch. w3c/csswg-drafts#8139 Original change's description: > Revert "VT: Remove containment requirement." > > This reverts commit e554cf340761c4b11e0da4d0c98b1b58f9189cbd. > > Reason for revert: Decided against this feature for now. > > Original change's description: > > VT: Remove containment requirement. > > > > This patch removes the containment requirement from view-transitions. > > > > This is to align with proposed resolution > > w3c/csswg-drafts#7882 > > > > R=khushalsagar@chromium.org, bokan@chromium.org > > > > Fixed: 1409491 > > Change-Id: Iad0eb54c8d2de503f209a58a9f438e586fcd6a36 > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4188811 > > Reviewed-by: David Bokan <bokan@chromium.org> > > Reviewed-by: Khushal Sagar <khushalsagar@chromium.org> > > Commit-Queue: Vladimir Levin <vmpstr@chromium.org> > > Cr-Commit-Position: refs/heads/main@{#1096187} > > Change-Id: Id0b58230eb372a96aa1f1dff2e7d84e2f297219f > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4192788 > Commit-Queue: Vladimir Levin <vmpstr@chromium.org> > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > Cr-Commit-Position: refs/heads/main@{#1096273} Change-Id: I3da1ee9d5e00b2a9470b99b5f69704fc9b4d0105 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4233087 Commit-Queue: Vladimir Levin <vmpstr@chromium.org> Commit-Queue: Khushal Sagar <khushalsagar@chromium.org> Auto-Submit: Khushal Sagar <khushalsagar@chromium.org> Reviewed-by: Vladimir Levin <vmpstr@chromium.org> Cr-Commit-Position: refs/heads/main@{#1102856} -- wpt-commits: 8304fd86ce591ba34f172f46f5fadc017a4db814 wpt-pr: 38421
…nt.", a=testonly Automatic update from web-platform-tests Reland "VT: Remove containment requirement." This reverts commit f2820f7b99c149d989dee94c1b23c791a7b5f387. This was reverted earlier to wait for CSSWG feedback. The resolution aligns with the behaviour in this patch. w3c/csswg-drafts#8139 Original change's description: > Revert "VT: Remove containment requirement." > > This reverts commit e554cf340761c4b11e0da4d0c98b1b58f9189cbd. > > Reason for revert: Decided against this feature for now. > > Original change's description: > > VT: Remove containment requirement. > > > > This patch removes the containment requirement from view-transitions. > > > > This is to align with proposed resolution > > w3c/csswg-drafts#7882 > > > > R=khushalsagar@chromium.org, bokan@chromium.org > > > > Fixed: 1409491 > > Change-Id: Iad0eb54c8d2de503f209a58a9f438e586fcd6a36 > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4188811 > > Reviewed-by: David Bokan <bokan@chromium.org> > > Reviewed-by: Khushal Sagar <khushalsagar@chromium.org> > > Commit-Queue: Vladimir Levin <vmpstr@chromium.org> > > Cr-Commit-Position: refs/heads/main@{#1096187} > > Change-Id: Id0b58230eb372a96aa1f1dff2e7d84e2f297219f > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4192788 > Commit-Queue: Vladimir Levin <vmpstr@chromium.org> > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > Cr-Commit-Position: refs/heads/main@{#1096273} Change-Id: I3da1ee9d5e00b2a9470b99b5f69704fc9b4d0105 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4233087 Commit-Queue: Vladimir Levin <vmpstr@chromium.org> Commit-Queue: Khushal Sagar <khushalsagar@chromium.org> Auto-Submit: Khushal Sagar <khushalsagar@chromium.org> Reviewed-by: Vladimir Levin <vmpstr@chromium.org> Cr-Commit-Position: refs/heads/main@{#1102856} -- wpt-commits: 8304fd86ce591ba34f172f46f5fadc017a4db814 wpt-pr: 38421
I'm going to go for option 1 for all three. It can be changed later if needed. |
This reverts commit f2820f7. This was reverted earlier to wait for CSSWG feedback. The resolution aligns with the behaviour in this patch. w3c/csswg-drafts#8139 Original change's description: > Revert "VT: Remove containment requirement." > > This reverts commit e554cf3. > > Reason for revert: Decided against this feature for now. > > Original change's description: > > VT: Remove containment requirement. > > > > This patch removes the containment requirement from view-transitions. > > > > This is to align with proposed resolution > > w3c/csswg-drafts#7882 > > > > R=khushalsagar@chromium.org, bokan@chromium.org > > > > Fixed: 1409491 > > Change-Id: Iad0eb54c8d2de503f209a58a9f438e586fcd6a36 > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4188811 > > Reviewed-by: David Bokan <bokan@chromium.org> > > Reviewed-by: Khushal Sagar <khushalsagar@chromium.org> > > Commit-Queue: Vladimir Levin <vmpstr@chromium.org> > > Cr-Commit-Position: refs/heads/main@{#1096187} > > Change-Id: Id0b58230eb372a96aa1f1dff2e7d84e2f297219f > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4192788 > Commit-Queue: Vladimir Levin <vmpstr@chromium.org> > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > Cr-Commit-Position: refs/heads/main@{#1096273} (cherry picked from commit 652c5ff) Change-Id: I3da1ee9d5e00b2a9470b99b5f69704fc9b4d0105 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4233087 Commit-Queue: Vladimir Levin <vmpstr@chromium.org> Commit-Queue: Khushal Sagar <khushalsagar@chromium.org> Auto-Submit: Khushal Sagar <khushalsagar@chromium.org> Reviewed-by: Vladimir Levin <vmpstr@chromium.org> Cr-Original-Commit-Position: refs/heads/main@{#1102856} Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4233792 Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org> Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org> Cr-Commit-Position: refs/branch-heads/5563@{#318} Cr-Branched-From: 3ac59a6-refs/heads/main@{#1097615}
This reverts commit f2820f7b99c149d989dee94c1b23c791a7b5f387. This was reverted earlier to wait for CSSWG feedback. The resolution aligns with the behaviour in this patch. w3c/csswg-drafts#8139 Original change's description: > Revert "VT: Remove containment requirement." > > This reverts commit e554cf340761c4b11e0da4d0c98b1b58f9189cbd. > > Reason for revert: Decided against this feature for now. > > Original change's description: > > VT: Remove containment requirement. > > > > This patch removes the containment requirement from view-transitions. > > > > This is to align with proposed resolution > > w3c/csswg-drafts#7882 > > > > R=khushalsagar@chromium.org, bokan@chromium.org > > > > Fixed: 1409491 > > Change-Id: Iad0eb54c8d2de503f209a58a9f438e586fcd6a36 > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4188811 > > Reviewed-by: David Bokan <bokan@chromium.org> > > Reviewed-by: Khushal Sagar <khushalsagar@chromium.org> > > Commit-Queue: Vladimir Levin <vmpstr@chromium.org> > > Cr-Commit-Position: refs/heads/main@{#1096187} > > Change-Id: Id0b58230eb372a96aa1f1dff2e7d84e2f297219f > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4192788 > Commit-Queue: Vladimir Levin <vmpstr@chromium.org> > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > Cr-Commit-Position: refs/heads/main@{#1096273} Change-Id: I3da1ee9d5e00b2a9470b99b5f69704fc9b4d0105 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4233087 Commit-Queue: Vladimir Levin <vmpstr@chromium.org> Commit-Queue: Khushal Sagar <khushalsagar@chromium.org> Auto-Submit: Khushal Sagar <khushalsagar@chromium.org> Reviewed-by: Vladimir Levin <vmpstr@chromium.org> Cr-Commit-Position: refs/heads/main@{#1102856}
Right now, if an element is to be captured for a view transition, we require the developer to set either layout or paint containment. There's no longer a technical reason for this, but it may still catch some unexpected behaviour.
For example, take this sidebar.
Imagine, due to some hacky layout, a logo overlay was within the sidebar:
In CSS terms, the sidebar and the logo are independently positioned, since the logos containing block is some ancestor of the sidebar.
However, with view transitions, if we create a transition where the sidebar moves horizontally, we'll also be moving the logo, since it's part of the same capture. If the sidebar transitions to left by 100px, the old view of the logo (as part of the sidebar view) will slide to the left by 100px and fade out, and the new view of the logo will slide in from the right by 100px and fade in.
contain: layout
ensures children of the sidebar will not use a parent as a containing block. It won't 'fix' the issue above, but it will make it obvious that it won't work, before the transition starts.My thoughts on this:
contain: paint
and my transition fails. I then roll my eyes & addcontain: paint
. This might be a net negative on developer experience.contain: paint
has never saved me from the gotcha above, but my demos have been simple, so they're unlikely to have weird layouts like above.contain: paint
requirement is a backwards compatible change, so we can do it later.The text was updated successfully, but these errors were encountered: