Open Bug 1700526 Opened 7 months ago Updated 7 months ago

Block containers with small width/height missing horizontal/vertical scrollbar

Categories

(Core :: Layout: Scrolling and Overflow, enhancement)

enhancement

Tracking

()

People

(Reporter: TYLin, Unassigned)

Details

Attachments

(2 files)

Attached file scrollbar-missing.html

Steps to reproduce:
Load the attached testcase.

Expected result:
All the block containers should have either horizontal or vertical scrollbar.

Actual result:
On my linux, the first block has no horizontal scrollbar, and the third container has no vertical scrollbar.

Note:
On macOS, the same testcase have the expected result. Other browser also have the expected result.

I discovered this bug while looking at the try results after applying my patches in bug 1527949.

The second green box in layout/reftests/bugs/825999.html seems to generate extra scrollbar on windows and macOS, but it turns out that the scrollbar is missing on Linux. Here is one of the failure on windows. https://treeherder.mozilla.org/jobs?repo=try&revision=8357ba59900a7629d1bcab51a5872302ce2aaed7&selectedTaskRun=TTbgLMUKRk21Agw9d2OrnQ.0

My first guess would be that the min size for the scrollbar as computed here

https://searchfox.org/mozilla-central/rev/1758450798ae14492ba28b695f48143840ad6c5b/layout/generic/nsGfxScrollFrame.cpp#449

would be larger then these divs so we would skip the scrollbar.

Indeed, we have code to compute horizontal scrollbar is not desired when the scrollbar min width is large than the scroll port's width. So I guess this bug is more or less by design. The scrollbar min width is varied depending on the platform, and on macOS, the scrollbar disappears if I shrink the first block's width down to 10px.

Just a thought, we might want to always display the slider when there is a horizontal overflow so that overflow-x: auto matches the rendering of overflow-x: scroll in a scroll container with small width. I feel this is less surprising to the author.

Severity: S3 → S4
Type: defect → enhancement
You need to log in before you can comment on or make changes to this bug.