Open Bug 1302700 Opened 8 years ago Updated 2 months ago

unexpected discrepancy in scrollbar thumb size depending on writing-mode

Categories

(Core :: Layout: Scrolling and Overflow, defect, P3)

defect

Tracking

()

People

(Reporter: jfkthame, Unassigned)

References

Details

Attachments

(1 file)

See attached testcase. The two test divs are the same size, and their scrollable contents is also the same size; it seems reasonable to expect that the thumbs of their vertical scrollbars will also match. But they don't (at least for me on Linux; results with the testcases in bug 1302389 seemed to be somewhat platform-dependent). I'm suspicious that default font or line-height metrics may be contributing here, though I haven't diagnosed exactly where the discrepancy arises.
Priority: -- → P3

While debugging bug 1042151, I found a useful reftest scrollbars.html for flexbox on wpt. Part of the reason that the test is failing on Firefox is because of this bug.

I discover that when calculating vertical scrollbar thumb size, we use lineScrollAmount as a factor [1], and lineScrollAmount depends on font metrics (AveCharWidth and MaxHeight) [2] which can be different depends on the container being vertical or horizontal. That's why setting font-size: 0 on the scroll container can eliminate the discrepancy.

I'm not sure what's expected outcome of this bug though.

[1] https://searchfox.org/mozilla-central/rev/a315a1a0f09550e23e4590a77e74f36543315da3/layout/generic/nsGfxScrollFrame.cpp#6232,6244
[2] https://searchfox.org/mozilla-central/rev/a315a1a0f09550e23e4590a77e74f36543315da3/layout/generic/nsGfxScrollFrame.cpp#4673-4674

Severity: normal → S4
Component: Layout → Layout: Scrolling and Overflow

As far as I can tell, the lineScrollAmount is only used for the "increment" property which is independent of the thumb size. But it's not surprising to me that the thumb size depends on font properties, because the thumb size depends on the scrollable content height which can be affected by the font-size of the content.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: