Re: [csswg-drafts] [css-contain-3] Ancestor Layout Loops with Single-Axis Containment (#6426)

The CSS Working Group just discussed `[css-contain-3] Ancestor Layout Loops with Single-Axis Containment`, and agreed to the following:

* `RESOLVED: Accept iank_'s proposal to guarantee full layout algorithm is always forward moving`

<details><summary>The full IRC log of that discussion</summary>
&lt;dael_> Topic: [css-contain-3] Ancestor Layout Loops with Single-Axis Containment<br>
&lt;dael_> github: https://github.com/w3c/csswg-drafts/issues/6426<br>
&lt;dael_> miriam: It turns out this is hard. We knew that<br>
&lt;dael_> miriam: I tried to document 4 known instances where content changing size on 1 axis, generally block, has impact on available size for inline. So if we try and contain inline only get a loop<br>
&lt;dael_> miriam: Generally have a pattern where outer ancestor, element contained on inline axis, inside of that contents responding to container query<br>
&lt;dael_> miriam: With those three nested bits, a few of the issues are orthogonal writing modes. 2 other cases that are common. Ancestor is overflow scroll ad the contents can trigger scrollbar on ancestor which changes inline space available<br>
&lt;dael_> miriam: Another is floats as they get taller or shorter how they stack might change<br>
&lt;dael_> miriam: In my first document I wrote out the brute force solutions. They're not ideal for users. iank_'s idea is better<br>
&lt;dael_> iank_: I need to study one of these a bit more but they all fall into effectively we layout a child once with given space, read child height, and based on that give it a new available space.<br>
&lt;iank_> https://www.software.hixie.ch/utilities/js/live-dom-viewer/?saved=9775<br>
&lt;dael_> iank_: Fundamentally need to make sure we never walk backwards. This is true today<br>
&lt;dael_> iank_: I pasted in irc an example ^<br>
&lt;dael_> iank_: Orange box and inside it has a child with an a-r. Conisder width first, get height where we can't fix. Then consider second of 50px. All engines walk forwards like that.<br>
&lt;dael_> iank_: We don't try and say now that I'm this height maybe i could fit back here after all<br>
&lt;dael_> florian: Do you mean this is hte end of hte line principle we don't need the pieces miriam highlighted or that it solves them all?<br>
&lt;Rossen_> q?<br>
&lt;florian> q+<br>
&lt;fantasai> me q-<br>
&lt;dael_> iank_: I think we state it and it solves them all. Orthogonal. We layout with one set of contstraints, layout, adjust. We move forward.<br>
&lt;fantasai> s/me q-//<br>
&lt;Rossen_> ack florian<br>
&lt;dael_> florian: I'm a bit concerned this is different than float. We should avoid making css accidently stateful<br>
&lt;dael_> florian: Float, ancestors are not effected by float in the same way<br>
&lt;dael_> florian: Roughly I feel the way miriam proposed is annoyingly specific but need to do it to avoid vague or stateful<br>
&lt;dael_> iank_: I don't think it's stateful. We have a bug on orthogonal, but with that case to compute intrinsic size for the orthogonal child we need to lay it out with some available size.<br>
&lt;dael_> iank_: We layout with that size. may effect size of the parent. Now when we do layout pass we give orthogonal child different constraints and it lays out differently<br>
&lt;dael_> florian: That sounds true<br>
&lt;dael_> iank_: If you can come up with a case you think is stateful happy to access<br>
&lt;dael_> iank_: Orthogonal is hard b/c engines have a lot of bugs. miriam example shows a bug<br>
&lt;dael_> florian: For scrollbar and padding do you think we can get away without hatchet miriam proposed?<br>
&lt;dael_> iank_: I think so. A-r is fine, floats is fine, I think classic scrollbars is fine as long as you add them in a particular way. We'll slowly add scrollbars to get to a state. I think it should be okay<br>
&lt;dael_> florian: I thought if you didn't have miriam approach you would get a different result if you start on a 800 px window different result then if you start bigger and sthrink<br>
&lt;dael_> iank_: No, shouldn't be an issue. That's a browser issue and should be fixed.<br>
&lt;dael_> iank_: If there is an ambig set of steps where we need more specific order we should do that<br>
&lt;dael_> iank_: When forming a new context in relation to floats we had a specific order on how people should walk through. Pretty much everything else falls into that<br>
&lt;dael_> florian: If we go that way we can have a spec that's less magic but we need to be very precise so it's stable and interop<br>
&lt;dael_> iank_: yes<br>
&lt;dael_> florian: Can someone implementing list the steps? Undefined would be bad<br>
&lt;dael_> iank_: Depends what you mean by define<br>
&lt;dael_> iank_: We don't have a spec for block layout but we have resolved how floats behave.<br>
&lt;dael_> iank_: I can describe how this works for orthogonal children, I think that's well defined<br>
&lt;dael_> florian: My ask would be for the 4 cases miriam highlighted which I think are specific enough, could you either point to the spec language that make them non-problematic or propose sufficient spec text?<br>
&lt;dael_> iank_: I can work with miriam on that<br>
&lt;dael_> Rossen_: Sounds like we're forming consensus around going forward with reasoning captured in the issue by iank_. Additional exercise to figure out where changes have to land<br>
&lt;dael_> Rossen_: Anything else to add here? I see people on this issue chimed in<br>
&lt;dael_> florian: Great if we can go there. The things proposed are cludges we thought unavoidable. If they're avoidable, great<br>
&lt;dael_> Rossen_: In terms of solution anything else to add here?<br>
&lt;dael_> dholbert: I think your example with a-r is a good case for something that behaves like this without needing container queries. Good extension of that<br>
&lt;dael_> iank_: I think I can create examples as well with time<br>
&lt;dael_> Rossen_: We call them test cases; please add them :)<br>
&lt;dael_> Rossen_: Let's resolve on path forward. And it'll be iank_ for you to figure out wehre edits should go<br>
&lt;dael_> Rossen_: Prop: Accept iank_'s proposal to guarantee full layout algorithm is always forward moving<br>
&lt;dael_> florian: Sort of important to get to this in a timely manner. This discussion has been going on for years in GH. If there is a solution, great, but I'm worried we will force other browsers to reverse engineer crhome or do something else if we don't write it<br>
&lt;dael_> chrishtr: resolution to go with iank_ proposal?<br>
&lt;dael_> iank_: write it down at least for the examples. Part of the problem is large parts of some algos are undefined. Can spac how things should walk forward<br>
&lt;dael_> chrishtr: So parts of algo that intersect need to be written<br>
&lt;dael_> iank_: Part of issue is float not well defined. List of side effects. most recent for float layout is in a GH issue but not in spec. Pointing to the various places we've resolved<br>
&lt;dael_> iank_: For intrinsic size we have it written<br>
&lt;dael_> florian: I don't think iank_ proposal is not self contained enough. It's an approach we need to look into more details.<br>
&lt;dael_> Rossen_: yes. We don't have specificals<br>
&lt;dael_> florian: We agree to try and solve that way. And we go that way and we come back to resolve on details<br>
&lt;dael_> Rossen_: Have proposed path forward. Don't have details about specifics, but approach makes sense. You've made your point and people agree.<br>
&lt;dael_> fantasai: We had previously declined to publish fpwd because of this issue. If we get to a point we're okay with the issue we should publish fpwd<br>
&lt;dael_> previous proposal: Accept iank_'s proposal to guarantee full layout algorithm is always forward moving<br>
&lt;dael_> Rossen_: That's the proposed resolution. Obj?<br>
&lt;dael_> RESOLVED: Accept iank_'s proposal to guarantee full layout algorithm is always forward moving<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6426#issuecomment-960298637 using your GitHub account


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

Received on Wednesday, 3 November 2021 23:43:57 UTC