Closed Bug 1365806 Opened 6 years ago Closed 3 years ago
empty element has an offsetheight if given overflow-y:scroll, unlike other browsers
As per the attached testcase, giving an otherwise-empty element overflow-y:scroll will forcefully give it an offsetHeight (the actual value varies from theme to theme). Other browsers all give the element a zero offsetHeight (I have tested Chrome, Safari, Edge, and Internet Explorer 11). This currently affects the UK Labor Party's website, as it expects the offsetHeight of such an element to be === 0, and otherwise leaves its height alone, making a section of the site's content appear much smaller than it otherwise would be (as shown in the related webcompat.com issue #6353).
I'm guessing that's because we impose a minimum size on the scrollbar, and other UAs don't? data:text/html,<div style="overflow-y:scroll; border:1px solid"></div> I think that comes from the Widget layer, e.g.: http://searchfox.org/mozilla-central/rev/f55349994fdac101d121b11dac769f3f17fbec4b/widget/gtk/nsNativeThemeGTK.cpp#1486-1500
Component: DOM → Widget
Yes, this seems to be the culprit. When I remove that switch-case, the rendering is similar to other browsers. But I'm not sure if the problem in bug 513006 that case fixed is still a concern. Thoughts?
In Chrome the box is 0px high and in Firefox, this is 16px high data:text/html,<div style="height:auto;overflow-y:scroll;background-color:pink"></div> Visible on Rakuten on Android https://webcompat.com/issues/22960
Webcompat Priority: --- → ?
Component: Layout: Tables → Layout: Scrolling and Overflow
Attachment #9144917 - Attachment description: Bug 1365806 - Make scrollbars not impose a minimum size. r=dholbert → Bug 1365806 - Make scrollbars not impose a minimum size on the scroller. r=dholbert
Pushed by email@example.com: https://hg.mozilla.org/integration/autoland/rev/842955b61f01 Make scrollbars not impose a minimum size on the scroller. r=dholbert
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/autoland/rev/012f25fede5c Make scrollbars not impose a minimum size on the scroller. r=dholbert
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/23466 for changes under testing/web-platform/tests
Whiteboard: [webcompat][tpi:+] → [webcompat][tpi:+], [wptsync upstream]
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.