empty element has an offsetheight if given overflow-y:scroll, unlike other browsers
Categories
(Core :: Layout: Scrolling and Overflow, defect, P3)
Tracking
()
People
(Reporter: wisniewskit, Assigned: emilio)
References
(Regressed 1 open bug, )
Details
(Keywords: polish, testcase, Whiteboard: [webcompat][tpi:+], [wptsync upstream])
Attachments
(2 files)
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).
Comment 1•6 years ago
|
||
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
![]() |
||
Updated•6 years ago
|
Reporter | ||
Comment 2•6 years ago
|
||
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?
![]() |
||
Updated•5 years ago
|
![]() |
||
Updated•5 years ago
|
![]() |
||
Comment 3•5 years ago
|
||
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
Comment 4•5 years ago
|
||
Migrating Webcompat whiteboard priorities to project flags. See bug 1547409.
Comment 5•5 years ago
|
||
See bug 1547409. Migrating whiteboard priority tags to program flags.
Updated•4 years ago
|
Comment 6•4 years ago
|
||
To add, this is causing issues on https://console.cloud.google.com with a persistent bar floating on screen. (Although they should be using overflow: auto
there instead)
Comparison between Firefox and Chrome behavior: https://i.imgur.com/8LmpOKz.png
Assignee | ||
Comment 8•4 years ago
|
||
Fwiw, this is the widget-imposed min size of the scrollbar element.
Comment 9•4 years ago
|
||
Should we change that imposition?
Assignee | ||
Comment 10•4 years ago
|
||
Probably... I can look into it, just not right now.
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 12•3 years ago
|
||
Also, don't suppress scrollbars if the scrollport is less than their
width, as that can happen now :)
Scrollbars code is tricky, so I'll wait until the soft freeze is over to
land this.
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Updated•3 years ago
|
Comment 15•3 years ago
|
||
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/842955b61f01 Make scrollbars not impose a minimum size on the scroller. r=dholbert
Comment 16•3 years ago
|
||
Backed out for wr failures on contain-size-scrollbars-002.html
Backout link: https://hg.mozilla.org/integration/autoland/rev/ad7eed76c065f345ba7f4136c81564a4ad2de95e
Log link: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=301009550&repo=autoland&lineNumber=5368
Also on contain-size-flexbox-002.html : https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=301010389&repo=autoland&lineNumber=17613
Comment 17•3 years ago
|
||
Pushed by ealvarez@mozilla.com: 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
Assignee | ||
Updated•3 years ago
|
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
Comment 20•3 years ago
|
||
bugherder |
Upstream PR merged by moz-wptsync-bot
Updated•3 years ago
|
Description
•