Re: [csswg-drafts] [css-contain-2][css-conditional-5] Weaker form of layout containment for container queries. (#10544)

The CSS Working Group just discussed `Containment`, and agreed to the following:

* `RESOLVED: container-type does not force layout containment, but does force an independent formatting context`

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> Topic: Containment<br>
&lt;fantasai> github: https://wiki.csswg.org/planning/tpac-2024#proposed-covid-protocols<br>
&lt;fantasai> iank_: When we did CQ, we split containment into layout and size containment<br>
&lt;fantasai> iank_: inline-size and block-size also<br>
&lt;dbaron> github: https://github.com/w3c/csswg-drafts/issues/10544<br>
&lt;fantasai> iank_: We've been running into issues because of enforcing layout containment<br>
&lt;florian> q+<br>
&lt;fantasai> iank_: when you CQ, you can't baseline-align, you can't allow abspos/fixedbpos to escape, scrollable overflow is broken, etc.<br>
&lt;fantasai> iank_: side-effects are annoying for developers<br>
&lt;fantasai> iank_: After investigation, the only restriction we really need is that it establishes a new formatting context<br>
&lt;fantasai> iank_: Lots of issues where devs ask us to remove these restrictions<br>
&lt;fantasai> iank_: a few paths forward<br>
&lt;emilio> q+<br>
&lt;fantasai> iank_: most ideal one, which contains the most compat risk -- but we're fine trying that, roll out behind a flag and work with devs to fix sites -- is to change container type to not enforce layout conainment, just size containment<br>
&lt;fantasai> iank_: and also establish a new formatting context<br>
&lt;fantasai> iank_: that's my ideal proposal<br>
&lt;fantasai> iank_: There are a couple other variants possible<br>
&lt;fantasai> iank_: miriam would also like to take this variant<br>
&lt;Rossen2> ack florian<br>
&lt;fantasai> florian: I'm unsure. I understand the desire to relax these constraints<br>
&lt;fantasai> florian: but not convinced about necessity<br>
&lt;fantasai> florian: e.g. abspos, if you allow to escape, then at a higher level in the tree they could cause scrollbars<br>
&lt;fantasai> florian: which then change the layout space you have to lay out in<br>
&lt;fantasai> florian: which changes the width you're querying against<br>
&lt;fantasai> florian: so it's annoying, but the constraint was there to break the circularity<br>
&lt;fantasai> florian: so yes, annoying, but are they necessary? and otherwise how do you cope?<br>
&lt;fantasai> iank_: falls under "always move forward" constraint<br>
&lt;fantasai> iank_: if you set up container, then can cause relayout<br>
&lt;fantasai> iank_: principle is moving forward -- so you add scrollbars, and don't remove them<br>
&lt;Rossen2> ack emilio<br>
&lt;fantasai> emilio: was going to bring up similar concerns<br>
&lt;fantasai> emilio: last time I checked, browsers still somewhat inconsistent wrt circularities<br>
&lt;fantasai> emilio: has that changed?<br>
&lt;fantasai> emilio: not opposed to removing, but...<br>
&lt;fantasai> emilio: for all browsers it's straighforward to do *something*<br>
&lt;fantasai> emilio: we break cycles similarly to webkit<br>
&lt;fantasai> iank_: I don't think you or webkit are following the spec<br>
&lt;fantasai> emilio: for us it would be a bigger change, because circular case would become a lot more common<br>
&lt;fantasai> iank_: block-size circularity is pretty common, actually<br>
&lt;fantasai> iank_: and I would like to fix this for web developers. It's the #1 complaint we receive for container queries<br>
&lt;florian> q?<br>
&lt;fantasai> emilio: they should complain to the WG<br>
&lt;florian> q+<br>
&lt;fantasai> iank_: they have been<br>
&lt;Rossen2> ack florian<br>
&lt;fantasai> florian: "always move forward" approach, you're saying FF and WK don't follow it well? How well is specified?<br>
&lt;fantasai> florian: Are we sure that we can gain interop on this approach?<br>
&lt;fantasai> florian: if so, then that's a path forward<br>
&lt;fantasai> florian: but if unproven, then maybe it's premature to resolve this issue<br>
&lt;fantasai> florian: maybe need to make sure "always move forward" is web-compatible<br>
&lt;fantasai> iank_: We do it today, so definitely web-compatible<br>
&lt;fantasai> iank_: FF and WK fail some tests because not doing it correctly<br>
&lt;fantasai> iank_: it comes down to interleaving style and layout, and I think we're the only ones doing it correctly today<br>
&lt;fantasai> florian: is it well-defined enough?<br>
&lt;fantasai> iank_: I also don't want to stall on this issue, because compat closes<br>
&lt;emilio> +1<br>
&lt;Rossen2> ack fantasai<br>
&lt;fantasai> fantasai: Can't speak for webkit officially because haven't discussed internally<br>
&lt;emilio> fantasai: can't speak for webkit, but in principle we want to support authors making their use cases work<br>
&lt;emilio> ah<br>
&lt;fantasai> fantasai: Some concerns about style/layout interleaving being underspecified -- I know Tab was handwaving at it in anchorpos spec<br>
&lt;fantasai> fantasai: would be good to get that specced thorougly<br>
&lt;fantasai> fantasai: but I think we should support Chrome experimenting to see how far we can push this in the direction that authors expect<br>
&lt;fantasai> iank_: [proposal]<br>
&lt;fantasai> iank_: Option 1 is introducing a new containment type, and then we have to define what that does<br>
&lt;fantasai> iank_: This option bypasses it<br>
&lt;iank_> proposed resolution: container-type does not force layout containment, but does force an independent formatting context.<br>
&lt;florian> i/[proposal]/florian: Not exactly sure what the difference in practice is between option 1 and 2, but seems fine.<br>
&lt;fantasai> RESOLVED: container-type does not force layout containment, but does force an independent formatting context<br>
&lt;Rossen2> fantasai: asking TabAtkins and iank_ to work on this independently and bring it back to the WG for review<br>
&lt;TabAtkins> Yeah happy to get an edit into the spec and ask for review<br>
&lt;fantasai> s/this independently/defining style+layout interleaving more thoroughly/<br>
</details>


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


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

Received on Wednesday, 24 July 2024 16:25:55 UTC