Re: [csswg-drafts] [css-overflow][css-contain][css-sizing] `overflow: auto` incompatible with size containment and container queries (#7875)

The CSS Working Group just discussed ``[css-overflow][css-contain][css-sizing] `overflow: auto` incompatible with size containment and container queries``.

<details><summary>The full IRC log of that discussion</summary>
&lt;emeyer> oriol: We had a resolution but I’m not sure if that was the right solution<br>
&lt;emeyer> …Problem is that with overflow:auto, if the browser is using classical scrollbars, those take up space<br>
&lt;emeyer> …This can happen in two ways<br>
&lt;emeyer> …Browser may behave a bit different, if the element is sized intrinsically, the scrollbar size is added on top of content size<br>
&lt;emeyer> …If the size is explicit, then outer size of the element is preserved and scrollbars go inside<br>
&lt;emeyer> …We resolved the address the problem we don’t want, having to check to see if ancestors have to change size<br>
&lt;emeyer> …We always want to stop at element with size containment<br>
&lt;emeyer> …So we resolved to have scrollbars shrink content size<br>
&lt;emeyer> …Question with this is, first, this addresses the auto case, but what about the overflow:scroll case?<br>
&lt;emeyer> …Second, even if we preserve outer size of the element, there are features that depend on content size, like container queries and contain-intrinsic-size:auto<br>
&lt;emeyer> …By letting auto scrollbars affect content size, we have instability with container queries and contain-intrinsic-size:auto<br>
&lt;emeyer> …Maybe it would be simpler to say that if an element has size containment or c-i-s:auto, then overflow:auto would need to computer to overflow:scroll<br>
&lt;emeyer> …By forcing the element to consistently get scrollbars, we’d avoid problems, might not look as good<br>
&lt;florian> q+<br>
&lt;emeyer> …Open to ideas, but finding a solution that covers all problems simultaneously is tricky<br>
&lt;iank_> q+<br>
&lt;Rossen_> ack florian<br>
&lt;emeyer> florian: I think your suggestion of getting stable scrollbars does help<br>
&lt;emeyer> …I support that<br>
&lt;emeyer> …Maybe we could do indirectoin through scroillbar-gutter properties<br>
&lt;emeyer> oriol: Those properties have the stable keyword, but I think it only affects on axis<br>
&lt;emeyer> florian: Yeah, maybe that won’t work<br>
&lt;miriam> q+<br>
&lt;emeyer> …Containment is magic enough already; I think we could make it do strange things like this<br>
&lt;emeyer> iank_: I do worry about web compatbility<br>
&lt;emeyer> …People throw overflow:auto on random elements<br>
&lt;emeyer> …Also, the optimization mentioned in the spec is on a best-case scenario<br>
&lt;emeyer> …You aren’t required to use it for whatever reason<br>
&lt;Rossen_> ack iank_<br>
&lt;emeyer> florian: Ian, did you mean we should let the outer size with overflow:auto change and that regains consistency at the expense of optimization?<br>
&lt;emeyer> iank_: Want to think about it a little more, but I would be fine with that<br>
&lt;emeyer> …It’s a little bit of a hairy area<br>
&lt;Rossen_> ack miriam<br>
&lt;emeyer> miriam: Confused about the loop you mentioned of scrollbars getting added due to content<br>
&lt;emeyer> …That seems like the same loop we had to work through to get container queries at all, how is this new/different?<br>
&lt;emeyer> oriol: You can make contents change size with container queries<br>
&lt;emeyer> iank_: This falls into the you-always-move-forward pool<br>
&lt;emeyer> …We start assuming no scrollbars, then add if needed<br>
&lt;emeyer> oriol: It’s not like browsers are freezing, but if you start forcing things with JS or such, operations that should not affect things visually can change things<br>
&lt;emeyer> …I have some examples in the issue of things looking broken<br>
&lt;emeyer> iank_: To me, those examples are browser bugs<br>
&lt;emeyer> oriol: Then we need to define the expected behavior<br>
&lt;emeyer> miriam: I thought we did<br>
&lt;emeyer> Rossen: Is is the case that when we start with no scrollbars, you can only add scrollbars in the normal case, excluding container queries?<br>
&lt;emeyer> s/Is is/Is it/<br>
&lt;emeyer> …Is the proposal to make changing the scrollbar state once per layout a defined behavior?<br>
&lt;emeyer> oriol: Yeah, I want to avoid circularities<br>
&lt;emeyer> …Mia was saying we can already avoid them, so maybe I missed something<br>
&lt;emeyer> …Reading the specification, it seems there’s a circularity<br>
&lt;emeyer> …Was proposing a way to keep the content from affecting the content size of the container<br>
&lt;miriam> note and example here discuss this exact example: https://www.w3.org/TR/css-contain-3/#containment-inline-size<br>
&lt;emeyer> …If there’s another solution that only take a look at size at one point and not others, that may be fine<br>
&lt;emeyer> iank_: We said you’re performing a layout and engines will try to optimize, but can skip them<br>
&lt;emeyer> …You start with no scrollbars, then add a scrollbar or two if needed, then finish<br>
&lt;emeyer> …So you only add scrollbars during layout<br>
&lt;emeyer> …It’s tricky to get the optimization correct<br>
&lt;emeyer> …This circularity can arise with regular content, so this isn’t particularly new<br>
&lt;emeyer> Rossen: Is there a clarification or solution we need to record here, or is there an added step that seems reasonable?<br>
&lt;emeyer> miriam: Not sure; I think this is covered and I see this exact case mentioned in the spec, so I need to know what’s unclear and in need of clarification<br>
&lt;emeyer> oriol: Even if we use this approach on whether query styles apply or not, there’s a problem with contain-intrinsic-size:auto which remembers the content size<br>
&lt;emeyer> …We have some inconsistency here, and I think the other cases are addressed in other ways, but I don’t see this c-i-s problem addressed<br>
&lt;emeyer> miriam: It’s likely we do need to clarify here<br>
&lt;emeyer> Rossen: Let’s the conversation back to the issue and work out a solution there<br>
&lt;emeyer> s/Let’s the/Let’s take the/<br>
</details>


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


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

Received on Wednesday, 22 March 2023 16:36:39 UTC