Re: [csswg-drafts] [css-sizing-4] Scrollbars when intrinsic-width is > width? (#4415)

So in `div { width: max-content; contain-intrinsic-size: 100px 100px; overflow: auto; }`, the element becomes 100px by 100px - c-i-s gives the max-content width, and also gives the height.

Then if there's 150px of content, a vertical scrollbar *only* will appear, taking up some of the 100px width.  (Assuming there's no unbreakable inline in the content that wouldn't fit into 84px; if there is, it'll create a horizontal scrollbar too.)


But in `div { width: max-content; height: 50px; contain-intrinsic-size: 100px 100px; overflow: auto; }`, the element is 116px by 50px, because the c-i-s overflowed the specified height and triggered a scrollbar, so scrollbar size is part of the max-content size.

Then if 150px of content lays out into there, it continues to have *only* a vertical scrollbar, again unless the content has an unbreakable inline long enough to force a horizontal one.

----

One final question now. In the second example, what if there is *no* content in the box? The element is still gonna be 116x50, but will there be a scrollbar letting us scroll to see the full 100px of empty space?

I can handle it either way, I'll just need to be more subtle about "ignoring" if we want to keep that empty space scrollable.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4415#issuecomment-621365480 using your GitHub account

Received on Wednesday, 29 April 2020 17:50:50 UTC