Re: [csswg-drafts] [css-contain][css-overflow] Setting containment on root should not make scrolling impossible (#9003)

The CSS Working Group just discussed `[css-contain][css-overflow] Setting containment on root should not make scrolling impossible`.

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> miriam: Decided with container queries not to have container on root<br>
&lt;fantasai> miriam: but said authors should be able to set root as container, and be able to query it similar to media queries with some advantages of it being an element<br>
&lt;fantasai> miriam: but it doesn't quite work<br>
&lt;fantasai> miriam: because if you set size/layout containment on root element<br>
&lt;florian> q+<br>
&lt;fantasai> miriam: the overflow property propagates to the viewport, but size/layout containment causes the root to not have any scrollable overflow<br>
&lt;fantasai> miriam: so we need to either say, when you set containment on root, the overflow property doesn't propagate to root and get scrollbars<br>
&lt;fantasai> miriam: or we propagate containment to the viewport<br>
&lt;fantasai> miriam: not sure if that means anything other than "it doesn't apply to the root"<br>
&lt;Rossen_> ack florian<br>
&lt;fantasai> florian: I believe the first one has a well-defined behavior that's useful<br>
&lt;fantasai> florian: One thing that makes it ok is that when we no longer propagate to viewport, the the viewport gets default value of 'overflow' which resolves to auto on the viewport<br>
&lt;emilio> q+<br>
&lt;fantasai> florian: therefore if the root itself would overflow the viewport, you get scrollbars to see all of it. It might be odd, but you can access all the content<br>
&lt;emilio> fantasai: I think that having the containment and overflow apply to the root element would be pretty terrible<br>
&lt;emilio> ... because if you do size/layout containment you get 0-height and no overflow<br>
&lt;emilio> ... if you also have paint containment you also clip<br>
&lt;emilio> ... if you compensate by making the root element larger<br>
&lt;emilio> ... then you have a scrollbar which is inside the border edge of the root element rather than to the viewport<br>
&lt;florian> q+<br>
&lt;emilio> ... which is also not great<br>
&lt;Rossen_> ack florian<br>
&lt;florian> q-<br>
&lt;Rossen_> ack fantasai<br>
&lt;emilio> fantasai: I think the first option is terrible and we should propagate containment to the viewport<br>
&lt;fantasai> miriam: you would likely uses 100% rather than 100 vh<br>
&lt;fantasai> miriam: but it's only minimally better<br>
&lt;fantasai> miriam: I agree that the other is nicer for authors<br>
&lt;fantasai> Rossen_: would that be compatible? then percentages on body would resolve (whcih wouldn't previously)<br>
&lt;Rossen_> ack emilio<br>
&lt;florian> q+<br>
&lt;dbaron> emilio: What's the difference between propagating containment to the viewport rather than just not applying containment to the root?<br>
&lt;dbaron> Scribe+<br>
&lt;fantasai> iank_: containment on root is probably pretty rare in the web<br>
&lt;dbaron> miriam: It establishes a container for querying.<br>
&lt;fantasai> iank_: remind me the syntax?<br>
&lt;fantasai> miriam: @container [...]<br>
&lt;fantasai> emilio: so the size of the root...<br>
&lt;dbaron> (I think what I scribed above goes here)<br>
&lt;fantasai> emilio: what you want isn't the root element box size, it's the viewport?<br>
&lt;fantasai> miriam: I was assuming you'd get the root size, but in general what the author would do is size the root to 100% so they can get the viewport size<br>
&lt;fantasai> miriam: the difference between that and media query is that you can use actual font sizes (for font units)<br>
&lt;fantasai> miriam: other than that you want a container that's a fallback for everything for the page<br>
&lt;fantasai> emilio: isn't the fallback already the root?<br>
&lt;fantasai> miriam: no, there is no default<br>
&lt;Rossen_> q?<br>
&lt;fantasai> miriam: we intentionally didn't, because there are cases where it would be surprising if you didn't expect it<br>
&lt;fantasai> florian: so, size containment doesn't mean size to zero. It means size as empty<br>
&lt;fantasai> florian: most typically case is querying width, so empty isn't zero<br>
&lt;fantasai> florian: it would work better than viewport, because if there are margins etc, then you are considering those<br>
&lt;fantasai> florian: in the block axis, yes, you would size the root to zero<br>
&lt;fantasai> florian: but is it that bad?<br>
&lt;emilio> q+<br>
&lt;fantasai> florian: I'm not sure the scenario is that bad as imagined<br>
&lt;Rossen_> ack florian<br>
&lt;fantasai> emilio: fallback is for container units but not container queries?<br>
&lt;Rossen_> ack emilio<br>
&lt;fantasai> emilio: that's a bit weird<br>
&lt;fantasai> miriam: yes<br>
&lt;fantasai> emilio: ignoring containment on root to make this work seems sketchy<br>
&lt;fantasai> emilio: I am a bit torn<br>
&lt;fantasai> dbaron: I'm struggling at this point to understand the ways in which ignoring containment on the root and propoagating to the viewport different<br>
&lt;fantasai> dbaron: (other than for container establishing effects)<br>
&lt;fantasai> dbaron: though I guess they differ because of the size of the root, but unsure what that means for effect on developers<br>
&lt;florian> q?<br>
&lt;florian> q+ fantasai<br>
&lt;fantasai> emilio: is alternative to this to provide an opt-in to fall back to viewport somehow?<br>
&lt;fantasai> emilio: if we didn't do the fallback because we think it's confusing.. then what makes it not confusing would be having an opt in<br>
&lt;fantasai> iank_: it's confusing if you're writing these rules and you don't expect it to resolve yet because you haven't specified a container, and then it suddenly resolves<br>
&lt;fantasai> miriam: if you're mainly using CQ on small things, and end up not being in a small thing and get a very large result<br>
&lt;fantasai> miriam: can be confusing<br>
&lt;fantasai> miriam: bu in other cases want the nearest container, and in that case want the fallback<br>
&lt;fantasai> miriam: if you added containment on root, you can add a name so that you can reference it<br>
&lt;fantasai> miriam: if you're in control you can handle both use cases, if not can only handle one<br>
&lt;Rossen_>  ack fantasai<br>
&lt;emilio> fantasai: don't know what to say<br>
&lt;emilio> florian: put you on the queue about the scenario you were concerned about<br>
&lt;emilio> ... not sure what happens<br>
&lt;emilio> fantasai: containment works in both axes right?<br>
&lt;emilio> florian: not necessarily, if you only do it on one axis doesn't collapse to zero<br>
&lt;emilio> ... in the block direction if you set it to a 100% shouldn't it be fine<br>
&lt;emilio> ... if we propagated neither overflow nor containment, shouldn't it work?<br>
&lt;emilio> ... you'd set the block size to 100%<br>
&lt;emilio> fantasai: if the content needs to scroll you wouldn't be using the viewport scroller but an internal scroller<br>
&lt;emilio> ... is it the same?<br>
&lt;emilio> q+<br>
&lt;fantasai> emilio: It's not the same. There are UA features that only work on the root scroller, like marking find-inpage things, etc.<br>
&lt;fantasai> smfr: anothre difference is bakground-attachment fixed is optimized for root scrolling<br>
&lt;fantasai> Rossen_: let's take the issue back to GH and talk about it there, once we have a path for resolution we can bring it back<br>
&lt;fantasai> me github-bot, topic https://github.com/w3c/csswg-drafts/issues/3473<br>
</details>


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


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

Received on Friday, 21 July 2023 21:15:51 UTC