-
Notifications
You must be signed in to change notification settings - Fork 698
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-overflow-4] overflow into the gutter #5253
Comments
cc: @felipeerias |
@frivoal @tabatkins Can you provide an example for when this would come into effect? |
<div>abcde</div> div {
font-size: 16px
font-family: monospace;
width: 4ch;
overflow: auto;
scrollbar-gutter: stable;
} Assume with that particular font that 1ch = 8px, which is narrower than the typical 16px width of a scrollbar and its gutter. "abcd" fit within the element's content area, and "e" overflows to the right. with classic scrollbars and Do we get a horizontal scrollbar? What about if we had
* not web compatible, unless we make a difference between the case where there is a visible scrollbar in the gutter or not I think we should do 3. Note that the difference between 2 and 3 only becomes apparent if we have the |
The CSS Working Group just discussed
The full IRC log of that discussion<Frances> Rossen: Moving to scrollbar gutter, some members are not available to discuss topics.<Frances> Florian: Didn't define so far overflowing into the gutter, do we treat as padding effectively, or an area beyond the padding to have an effect on overflow? <Frances> Florian: Constrained if overflowing into a scrollbar, could trigger overflow and would have to account for it. If overflowing into the gutter of a classic scrollbar, might not trigger overflow. Could trigger instability. <Frances> Florian: Classic scrollbars could have the same answer, if overflowing into classic scrollbar, if overflowing into overlay scrollbar. Nuance of scrollbar gutter only has the stable value. A value to reserve for space in overlay scrollbars. <TabAtkins> Sounds reasonable to me. <flackr> q+ <Frances> PROPOSAL: overflowing into the gutter of a classic scrollbar triggers scrollable overflow, overflowing into the gutter of a overlay scrollbar does not trigger scrollable overflow <astearns> ack flackr <Rossen_> ack flackr <Frances> flackr: Layout of the site could be affected <Frances> Florian: Will be accessible regardless, can scroll though the content anways. <Frances> flackr: Different platforms could be affected. <Frances> Florian: Not necessarily <Frances> RESOLVED: overflowing into the gutter of a classic scrollbar triggers scrollable overflow, overflowing into the gutter of a overlay scrollbar does not trigger scrollable overflow |
I think maybe the following is a testcase that doesn't have the "assume you have a particular font with these sizing characteristics" special-requirement of Florian's example above: div {
width: 80px;
overflow: auto;
scrollbar-gutter: stable;
border: 1px solid black;
}
span.filler {
display: inline-block;
width: 79px;
height: 50px;
border-right: 2px solid cyan;
box-sizing: border-box;
} <div><span class="filler"></span></div> Live jsfiddle: https://jsfiddle.net/dholbert/s13f9rde/ (Notably, .filler is 1px skinnier than its parent, which means it will almost certainly intrude into the parent's reserved scrollbar-gutter area. And .filler has a 2px border-right to help you see whether its right edge is visible vs. whether it's been clipped by having been treated as overflow.) If I'm understanding the resolution correctly: for a browser with classic scrollbars, then today's CSSWG resolution means the following:
@frivoal can you confirm whether I'm getting that right? (Firefox matches those expectations right now. Chrome and WebKit seem not to match.) |
Side note:
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:
Descendants of an element that overflow into its padding area are painted over the background, not under, so this part doesn't seem true:
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:
Does that make sense, or do you think I missed something? |
"The fully correct solution" above sounds good to me. I'm wondering if we can make it work by modifying the definition of scrollable overflow to include the empty scrollbar gutters, as if they are a part of the padding box, which will be consistent with "the background of the scrollbar gutter must be painted as an extension of the padding". Maybe we should also clarify that the scrollport should not be affected by empty scrollbar gutters, to get the correct paint behavior. It seems that Safari and Firefox shrink the scrollport with the empty scrollbar gutters. |
If an element has a scrollbar gutter on its inline end side, and some content of that element (or its children) that would qualify as scrollable overflow extends into the gutter (but not beyond), do we consider that:
A strict interpretation of 1 is wouldn't be web compatible: a the very least we need a scrollbar to access content that goes into a gutter in which there is a visible classic scrollbar, since that's the legacy behavior, and since otherwise, that content would be unreachable.
For stability's sake, I think we should extend that to
stable
gutters with classic scrollbars even when the scrollbar is not visible (i.e.overflow:auto
and no overflowing content in the block axis). Same thing foralways
gutters, since in the case of classic scrollbars, they're the same asstable
ones. So that would mean doing 3.We could also do 2, but that doesn't seem useful / necessary.
The text was updated successfully, but these errors were encountered: