haikuwebkit/LayoutTests/fast/scrolling/home-end-keys-scroll-in-rtl...

2 lines
26 B
Plaintext
Raw Permalink Normal View History

Scroll Snap broken when using RTL layout https://bugs.webkit.org/show_bug.cgi?id=193671 <rdar://problem/47457471> Reviewed by Wenson Hsieh. Source/WebCore: There were various places in the scroll snapping code which confused scroll offsets (zero-based) with scroll positions (relative to scroll origin, can be negative). This broke snapping in `direction: rtl` content. The computation of snap locations in updateSnapOffsetsForScrollableArea() was also broken in RTL; we need to snap the right edge of boxes to the right edge of the scroller for the 'start' alignment. (Snapping for LTR boxes in an RTL scroller is poorly defined; for now, follow Gecko.) Tests: css3/scroll-snap/scroll-snap-2d-change-axis-type-rtl.html css3/scroll-snap/scroll-snap-2d-offsets-computed-independently.rtl.html css3/scroll-snap/scroll-snap-elements-container-larger-than-children-rtl.html css3/scroll-snap/scroll-snap-iframe-rtl.html css3/scroll-snap/scroll-snap-offsets-mixed-rtl.html css3/scroll-snap/scroll-snap-offsets-rtl.html * page/scrolling/AxisScrollSnapOffsets.cpp: (WebCore::computeScrollSnapAlignOffset): (WebCore::updateSnapOffsetsForScrollableArea): * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: (WebCore::ScrollingTreeScrollingNodeDelegateMac::scrollOffset const): * platform/ScrollAnimator.cpp: (WebCore::ScrollAnimator::updateActiveScrollSnapIndexForOffset): (WebCore::ScrollAnimator::scrollOffset const): * platform/cocoa/ScrollController.mm: (WebCore::ScrollController::updateScrollSnapPoints): Source/WebKit: There were various places in the scroll snapping code which confused scroll offsets (zero-based) with scroll positions (relative to scroll origin, can be negative). This broke snapping in `direction: rtl` content. The computation of snap locations in updateSnapOffsetsForScrollableArea() was also broken in RTL; we need to snap the right edge of boxes to the right edge of the scroller for the 'start' alignment. (Snapping for LTR boxes in an RTL scroller is poorly defined; for now, follow Gecko.) * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: (WebKit::dump): * UIProcess/API/ios/WKWebViewIOS.mm: (-[WKWebView _updateVisibleContentRects]): * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h: * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm: (WebKit::RemoteScrollingCoordinatorProxy::shouldSnapForMainFrameScrolling const): (WebKit::RemoteScrollingCoordinatorProxy::closestSnapOffsetForMainFrameScrolling const): (WebKit::RemoteScrollingCoordinatorProxy::hasActiveSnapPoint const): (WebKit::RemoteScrollingCoordinatorProxy::nearestActiveContentInsetAdjustedSnapOffset const): (WebKit::RemoteScrollingCoordinatorProxy::nearestActiveContentInsetAdjustedSnapPoint const): Deleted. LayoutTests: * css3/scroll-snap/resources/iframe-content-rtl.html: Added. * css3/scroll-snap/scroll-snap-2d-change-axis-type-rtl-expected.txt: Added. * css3/scroll-snap/scroll-snap-2d-change-axis-type-rtl.html: Copied from LayoutTests/css3/scroll-snap/scroll-snap-2d-change-axis-type.html. * css3/scroll-snap/scroll-snap-2d-change-axis-type.html: * css3/scroll-snap/scroll-snap-2d-offsets-computed-independently.html: * css3/scroll-snap/scroll-snap-2d-offsets-computed-independently.rtl-expected.txt: Added. * css3/scroll-snap/scroll-snap-2d-offsets-computed-independently.rtl.html: Copied from LayoutTests/css3/scroll-snap/scroll-snap-2d-offsets-computed-independently.html. * css3/scroll-snap/scroll-snap-elements-container-larger-than-children-rtl-expected.txt: Added. * css3/scroll-snap/scroll-snap-elements-container-larger-than-children-rtl.html: Copied from LayoutTests/css3/scroll-snap/scroll-snap-elements-container-larger-than-children.html. * css3/scroll-snap/scroll-snap-elements-container-larger-than-children.html: * css3/scroll-snap/scroll-snap-iframe-rtl-expected.txt: Added. * css3/scroll-snap/scroll-snap-iframe-rtl.html: Added. * css3/scroll-snap/scroll-snap-offsets-mixed-rtl-expected.txt: Added. * css3/scroll-snap/scroll-snap-offsets-mixed-rtl.html: Added. * css3/scroll-snap/scroll-snap-offsets-rtl-expected.txt: Added. * css3/scroll-snap/scroll-snap-offsets-rtl.html: Added. * fast/scrolling/home-end-keys-scroll-in-rtl-document-expected.txt: Added. Canonical link: https://commits.webkit.org/227631@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@264908 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-07-27 02:03:46 +00:00
PASS: scrollLeft is -1208