Consider suppressing scrollbars that have zero "thickness" in a ::-webkit-scrollbar rule
Categories
(Core :: Layout: Scrolling and Overflow, enhancement)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox151 | --- | fixed |
People
(Reporter: dholbert, Assigned: hiro)
References
(Blocks 1 open bug)
Details
(Keywords: webcompat:platform-bug)
User Story
user-impact-score:20
Attachments
(3 files, 1 obsolete file)
|
1017 bytes,
text/html
|
Details | |
|
115.01 KB,
image/png
|
Details | |
|
Bug 2028308 - Hide scrollbars when ::-webkit-scrollbar has width:0 and height:0. r?#layout-reviewers
48 bytes,
text/x-phabricator-request
|
Details | Review |
See attached testcase. Maybe we should match Chrome in suppressing scrollbars for some of the cases here?
Specifically -- maybe we should suppress all of the scrollbars where the webkit-scrollbar rule gives them zero "thickness"? (horizontal scrollbars that have height: 0 and vertical scrollbars that have width: 0)
This would get us "good" results on WebCompmat Site Report bug 1925937.
| Reporter | ||
Comment 1•5 days ago
•
|
||
Here's a screenshot comparing us to Chrome.
Notable observations:
- Chrome only suppresses scrollbars who have zero "thickness" -- e.g. in Chrome's rendering of the first part of the testcase (top-right portion of my screenshot), the
width:0suppresses the vertical scrollbar, whereas the horizontal scrollbar simply stops painting (but still occupies the regular amount of blank layout space for the scrollbar- track) -- presumably it's blank because I didn't provide styles for how to paint it. - So in Chrome, the third part of this testcase -- the part with
width:0; height:0-- is essentially equivalent toscrollbar-width:none. The first and second part are a bit more subtle because they only zero out one scrollbar. - Firefox Nightly matches Chrome on the fourth part of this testcase (thanks to bug 1977511), and we match Chrome on the fifth part of this testcase because it's using the standard styles.
| Reporter | ||
Comment 2•5 days ago
•
|
||
The gazetasp.com.br site in bug 1925937 uses styles like the third part of my testcase (specifying both width:0 and height:0).
If we suspect other sites might be doing the same thing with a similar scrollbar-hiding intent, we might consider special-casing ::-webkit-scrollbar { width: 0; height: 0; } as behaving like scrollbar-width: none. (Where sites might use e.g. "0px" etc instead of literal 0.)
(We might also try to get the single-axis-collapsing from the first and second part of my testcase -- but as of now, we don't have any confirmation that sites actually do that, so maybe that's something to not worry about until we have a demonstration that it's needed.)
hiro, what do you think? Do you have cycles to craft a followup along those lines? (As of now I only know of one WebCompat Site Report that would benefit from this, so maybe not a high reward, but also perhaps pretty low-cost as well, since I imagine a lot of the supporting pieces are now already there.)
| Assignee | ||
Comment 3•5 days ago
|
||
webkit-scrollbar-zero-width-and-height.html: Tests that setting both width
and height to 0 on ::-webkit-scrollbar hides the scrollbars, matching the
display:none behavior.
webkit-scrollbar-zero-width-and-height-scrollbar-width-thin.html: Tests that
a non-auto scrollbar-width (thin) clobbers the width:0/height:0 hiding, so
scrollbars remain visible.
| Assignee | ||
Comment 4•5 days ago
|
||
I did instruct Claude Code to write D291361 step by step, so that it reflects my preferences, e.g. I don't want to use std::pair of bool. Anyways, if there's any mistake, it's my fault. Indeed now I realized I forgot adding the reviewer. :)
Updated•5 days ago
|
| Assignee | ||
Comment 5•5 days ago
|
||
webkit-scrollbar-zero-width-and-height.html: Tests that setting both width
and height to 0 on ::-webkit-scrollbar hides the scrollbars, matching the
display:none behavior.
webkit-scrollbar-zero-width-and-height-scrollbar-width-thin.html: Tests that
a non-auto scrollbar-width (thin) clobbers the width:0/height:0 hiding, so
scrollbars remain visible.
webkit-scrollbar-percent-width-height.html: Updated to only set one dimension
per test case (width-only or height-only), since setting both to percent values
would now trigger the width:0/height:0 hiding behavior (percent is treated as 0
on Blink/WebKit).
Updated•5 days ago
|
| Assignee | ||
Comment 6•5 days ago
|
||
There was another mistake by me! I was being ignorant about the initial value of width/height style.
And I don't know what happened. there remained a previous version of the patch. I am going to abandon it.
Updated•5 days ago
|
Updated•5 days ago
|
Updated•5 days ago
|
Comment 8•2 days ago
|
||
| bugherder | ||
Description
•