haikuwebkit/LayoutTests/fast/scrolling/scroll-position-on-reload-r...

2 lines
38 B
Plaintext
Raw Permalink Normal View History

Fix reload and programmatic scrolling in RTL documents https://bugs.webkit.org/show_bug.cgi?id=152639 Reviewed by Zalan Bujtas. Source/WebCore: Reloading a left-scrolled RTL document would cause the content to appear at an odd offset, and programmatic sideways scrolls in RTL documents also jumped to the wrong location. Fix by resolving offset/position confusion in ScrollableArea::scrollPositionChanged() and the scrolling tree. ScrollableArea::scrollPositionChanged() was erroneously passing a scrollPosition to setScrollOffset(). ScrollingTreeFrameScrollingNode* were confused about offsets and positions. It turns out that the layer position is just -scrollPosition, but minimumScrollPosition() and maximumScrollPosition() need fixing to return positions, not offsets. ScrollingTreeFrameScrollingNode::viewToContentsOffset() was also doing incorrect math with scrollOrigin, which was detected by a failing test. Add more logging to the Scrolling channel. Tests: fast/scrolling/programmatic-document-rtl-scroll.html fast/scrolling/programmatic-document-rtl-scrollIntoView.html fast/scrolling/scroll-position-on-reload-rtl.html * page/FrameView.cpp: (WebCore::FrameView::requestScrollPositionUpdate): * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously): * page/scrolling/ScrollingTreeFrameScrollingNode.cpp: (WebCore::ScrollingTreeFrameScrollingNode::scrollBy): (WebCore::ScrollingTreeFrameScrollingNode::viewToContentsOffset): * page/scrolling/ScrollingTreeFrameScrollingNode.h: * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm: (WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollPosition): (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollLayerPosition): (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateChildNodesAfterScroll): (WebCore::ScrollingTreeFrameScrollingNodeIOS::minimumScrollPosition): (WebCore::ScrollingTreeFrameScrollingNodeIOS::maximumScrollPosition): * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollBy): (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollPosition): (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition): (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition): (WebCore::ScrollingTreeFrameScrollingNodeMac::minimumScrollPosition): (WebCore::ScrollingTreeFrameScrollingNodeMac::maximumScrollPosition): * platform/ScrollView.cpp: (WebCore::ScrollView::setScrollOffset): (WebCore::ScrollView::scrollTo): (WebCore::ScrollView::setScrollPosition): (WebCore::ScrollView::updateScrollbars): * platform/ScrollView.h: * platform/ScrollableArea.cpp: (WebCore::ScrollableArea::scrollPositionChanged): (WebCore::ScrollableArea::setScrollOffsetFromAnimation): (WebCore::ScrollableArea::scrollPositionFromOffset): (WebCore::ScrollableArea::scrollOffsetFromPosition): * platform/ScrollableArea.h: (WebCore::ScrollableArea::scrollPositionFromOffset): (WebCore::ScrollableArea::scrollOffsetFromPosition): * rendering/RenderListBox.cpp: (WebCore::RenderListBox::setScrollOffset): * rendering/RenderListBox.h: Source/WebKit2: Reloading a left-scrolled RTL document would cause the content to appear at an odd offset, and programmatic sideways scrolls in RTL documents also jumped to the wrong location. Fix by resolving offset/position confusion in ScrollableArea::scrollPositionChanged() and the scrolling tree. ScrollableArea::scrollPositionChanged() was erroneously passing a scrollPosition to setScrollOffset(). ScrollingTreeFrameScrollingNode* were confused about offsets and positions. It turns out that the layer position is just -scrollPosition, but minimumScrollPosition() and maximumScrollPosition() need fixing to return positions, not offsets. ScrollingTreeFrameScrollingNode::viewToContentsOffset() was also doing incorrect math with scrollOrigin, which was detected by a failing test. Add more logging to the Scrolling channel. * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h: * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm: (WebKit::PDFPlugin::setScrollOffset): LayoutTests: New tests for programmatic scrolling (2 kinds!) in RTL documents, and reloading a scrolled RTL document. * fast/scrolling/programmatic-document-rtl-scroll-expected.html: Added. * fast/scrolling/programmatic-document-rtl-scroll.html: Added. * fast/scrolling/programmatic-document-rtl-scrollIntoView-expected.txt: Added. * fast/scrolling/programmatic-document-rtl-scrollIntoView.html: Added. * fast/scrolling/scroll-position-on-reload-rtl-expected.txt: Added. * fast/scrolling/scroll-position-on-reload-rtl.html: Added. Canonical link: https://commits.webkit.org/170725@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194487 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-01-02 04:45:36 +00:00
PASS: scrollLeft after reload is -200