haikuwebkit/LayoutTests/fast/scrolling/programmatic-horizontal-bt-...

40 lines
821 B
HTML
Raw Permalink Normal View History

REGRESSION (r168244): Content in horizontal-bt page is offset such that only the end is viewable and there is a white gap at the top https://bugs.webkit.org/show_bug.cgi?id=136019 Reviewed by Dan Bernstein. Source/WebCore: In horizontal-bt documents (where the page starts scrolled to the bottom, and scrolling up goes into negative scroll positions), the position of the root content layer would be set incorrectly by the scrolling thread, resulting in misplaced content. Fix by having the renamed "yPositionForRootContentLayer" take scroll origin into account, and being more consistent about using scrollOrigin to position this layer. Test: fast/scrolling/programmatic-horizontal-bt-document-scroll.html * page/FrameView.cpp: (WebCore::FrameView::yPositionForFooterLayer): Moved (WebCore::FrameView::positionForRootContentLayer): Take scrollOrigin, and subtract it from the computed value. (WebCore::FrameView::yPositionForRootContentLayer): Renamed. * page/FrameView.h: * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll): We've already pushed the new scrollPosition onto the FrameView, so we can just use the member function to compute the positionForContentsLayer. * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition): This is the bug fix; FrameView::positionForRootContentLayer() now takes scrollOrigin into account. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateRootLayerPosition): Rather than using the documentRect, position the root content layer in terms of the scroll origin (which is -documentRect.location()). Source/WebKit2: Now call frameView.positionForRootContentLayer(), and add a FIXME questioning the behavior in horizontal b-t documents. However, this code isn't hit now that we always do extended backgrounds, so never have shadow layers. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::shadowLayerPositionForFrame): LayoutTests: Test that scrolls a horizontal-bt document. * fast/scrolling/programmatic-horizontal-bt-document-scroll-expected.html: Added. * fast/scrolling/programmatic-horizontal-bt-document-scroll.html: Added. Canonical link: https://commits.webkit.org/171411@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@195445 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-01-22 06:45:05 +00:00
<html style="-webkit-writing-mode: horizontal-bt;">
<head>
<style>
body {
margin: 0;
}
.origin {
position: absolute;
top: 0;
left: 0;
width: 10px;
height: 10px;
background-color: blue;
}
#indicator {
position: absolute;
left: 0;
top: -500px;
width: 100px;
height: 100px;
background-color: green;
}
</style>
<script>
function runTest()
{
document.scrollingElement.scrollTop = -500;
}
window.addEventListener('load', runTest, false);
</script>
</head>
<body>
<div class="origin"></div>
<div id="indicator"></div>
<div id="result"></div>
</body>
</html>