haikuwebkit/LayoutTests/fast/css/scrollable-overflow-with-st...

41 lines
625 B
HTML
Raw Permalink Normal View History

Facebook post with lots of comments has cut off scrollbar, and can't scroll fully to the bottom (sticky) https://bugs.webkit.org/show_bug.cgi?id=215719 <rdar://problem/66411757> Reviewed by Simon Fraser. Source/WebCore: While computing the scrollable overflow for inflow positioned (or transformed) renderers, we need to take their paint geometry into account so that scrolling matches their final positions. e.g. <div style="width: 100px; height: 100px;"></div> <div style="position: relative; top: -20; width: 50px; height: 50px;"></div> While the inflow positioned block box is placed right below the previous sibling div, visually they overlap each other. If these boxes happen to be in a scrollable container, the scrolling should be driven by the overlapping state (paint geometry) and not by the layout geometry (where the 2 boxes are placed vertically after each other). While stickily positioned boxes are also considered inflow positioned, their initial inflow layout positions contribute to the scrollable overflow as they are not stationary boxes. Test: fast/css/scrollable-overflow-with-sticky-positioning.html * rendering/RenderBox.cpp: (WebCore::RenderBox::layoutOverflowRectForPropagation const): LayoutTests: * fast/css/scrollable-overflow-with-sticky-positioning-expected.html: Added. * fast/css/scrollable-overflow-with-sticky-positioning.html: Added. Canonical link: https://commits.webkit.org/228625@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266156 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-08-26 02:22:44 +00:00
<style>
#container {
height: 500px;
width: 500px;
overflow: scroll;
border: 1px solid black;
}
.nested {
height: 300px;
background-color: cyan;
}
.scrolly {
width: 100px;
height: 600px;
background-color: blue;
border-bottom: 10px solid green;
}
.relative {
bottom: 0px;
position: relative;
width: 100px;
height: 110px;
background-color: yellow;
}
</style>
PASS if the green border is visible at the bottom of the red box.
<div id=container>
<div class=nested>
<div class=scrolly></div>
<div class=relative></div>
</div>
</div>
<script>
container.scrollTo(0, 240);
</script>