haikuwebkit/LayoutTests/css3/scroll-snap/scroll-padding-mainframe-pa...

12 lines
383 B
Plaintext
Raw Permalink Normal View History

scroll-padding should affect paging operations https://bugs.webkit.org/show_bug.cgi?id=219074 <rdar://problem/71747786> Patch by Martin Robinson <mrobinson@igalia.com> on 2021-01-25 Reviewed by Simon Fraser. Source/WebCore: Have scroll-padding affect the amount of the scrollable area that moves during paging operations. This is the behavior specified in the scroll snap specification and allows scrollable areas with partially obscured areas to properly page through their content. See https://drafts.csswg.org/css-scroll-snap-1/#propdef-scroll-padding. Tests: css3/scroll-snap/scroll-padding-mainframe-paging.html css3/scroll-snap/scroll-padding-overflow-paging.html * page/FrameView.cpp: (WebCore::FrameView::updateScrollbarSteps): Added this override method which properly sets page steps. Only FrameView has access to the document. * page/FrameView.h: * platform/ScrollView.cpp: (WebCore::ScrollView::updateScrollbars): Added this helper method, which is virtual so that FrameView can override it. (WebCore::ScrollView::updateScrollbarSteps): Use the helper method to actually set the scrollbar steps. * platform/ScrollView.h: Add new method declarations. * rendering/RenderBox.cpp: (WebCore::RenderBox::scrollPaddingForViewportRect): Add this new helper which gets the scroll-padding for a box. * rendering/RenderBox.h: Add new helper. * rendering/RenderLayer.cpp: (WebCore::expandScrollRectToVisibleTargetRectToIncludeScrollPadding): Use the new RenderBox helper. (WebCore::RenderLayer::updateScrollbarsAfterLayout): Use the new updateScrollbarSteps helper. (WebCore::RenderLayer::updateScrollbarSteps): Added this helper so that RenderLayerModelObject can update steps when necessary. * rendering/RenderLayer.h: Added new declarations. * rendering/RenderLayerModelObject.cpp: (WebCore::RenderLayerModelObject::styleDidChange): Update steps on FrameViews and RenderLayers when the style change dictates it. LayoutTests: * css3/scroll-snap/scroll-padding-mainframe-paging-expected.txt: Added. * css3/scroll-snap/scroll-padding-mainframe-paging.html: Added. * css3/scroll-snap/scroll-padding-overflow-paging-expected.txt: Added. * css3/scroll-snap/scroll-padding-overflow-paging.html: Added. * platform/ios-wk2/TestExpectations: Skip failing tests. * platform/mac-wk1/TestExpectations: Skip failing tests. Canonical link: https://commits.webkit.org/233294@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-25 09:45:47 +00:00
PASS paging moved body
PASS paging moved padded body
PASS document.scrollingElement.scrollTop is within 1 of 535.6837606837607
PASS paging moved padded body
PASS document.scrollingElement.scrollTop is within 1 of 535.6837606837607
PASS paging moved padded body
PASS document.scrollingElement.scrollTop is within 2 of 526.3675213675214
PASS successfullyParsed is true
TEST COMPLETE