Re: [csswg-drafts] [css-overflow-4] overflow into the gutter (#5253)

Side note:
> (Firefox matches those expectations right now. Chrome and WebKit seem not to match.)

You need to turn a preference on in Safari for scrollbar gutter to work at all, but once you do, it (mostly) matches Firefox, not Chrome.

(Mostly, because the horizontal scrollbar is drawn differently within its gutter, but that's out of scope here).

----

@dholbert Interesting. This was less obvious that I thought. My first intuition was that you were right.

But then again, the spec says:

> When the [scrollbar gutter](https://drafts.csswg.org/css-overflow-3/#scrollbar-gutter) is present but the scrollbar is not, or the scrollbar is transparent or otherwise does not fully obscure the scrollbar gutter, the background of the scrollbar gutter must be painted as an extension of the padding.

Descendants of an element that overflow into its padding area are painted over the background, not under, so this part doesn't seem true:

> the cyan border-right should be treated as overflow and get covered up by the scrollbar-gutter (so you shouldn't see any cyan initially)

So, as far as I can tell, the layout is correct in Firefox/Safari (presence of a horizontal scrollbar), but the painting is correct in Chrome (cyan thing visible on top of the gutter).

The fully correct solution is a little counter intuitive: you'd be able to see the cyan bar AND you'd get a scrollbar to bring in into out of overflowing onto the padding. That's may seems a little unnecessary to have it be visible and have a horizontal scrollbar, but the alternatives seem worse:
* change the spec to ask for what Firefox and Safari do, and paint the gutter on top of (inflow) descendants, but it seems unnecessary to obscure them.
* change the spec to ask for what Chrome does, but then the layout isn't stable: if for some (unrelated) reason we need to add a scrollbar into that gutter, then the content gets obscured, and we would need to add a scrollbar in the other dimension to be able to get to it, and this instability of the presence of the other scrollbar doesn't seem great.

Does that make sense, or do you think I missed something?

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


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

Received on Monday, 26 February 2024 08:35:15 UTC