haikuwebkit/Source/WebCore/page/scrolling/nicosia
Martin Robinson b5a5bdd9b0 [css-scroll-snap] Pass the full target point when selecting a snap offset
https://bugs.webkit.org/show_bug.cgi?id=228023

Reviewed by Frédéric Wang.

Source/WebCore:

Pass the full proposed destination scroll offset when calling closestSnapOffset. For
now, only the component in the scroll direction is used, but eventually the other
component will be used to avoid snapping to snap areas that are entirely off the screen.

No new tests. This change is simply a refactor in preparation for a behavior
change and shouldn't change behavior itself.

* page/scrolling/ScrollSnapOffsetsInfo.cpp:
(WebCore::closestSnapOffsetWithInfoAndAxis):
(WebCore::LayoutScrollSnapOffsetsInfo::closestSnapOffset const):
(WebCore::FloatScrollSnapOffsetsInfo::closestSnapOffset const):
* page/scrolling/ScrollSnapOffsetsInfo.h:
* page/scrolling/nicosia/ScrollingTreeScrollingNodeDelegateNicosia.cpp:
(WebCore::ScrollingTreeScrollingNodeDelegateNicosia::handleWheelEvent):
* platform/ScrollAnimator.cpp:
(WebCore::ScrollAnimator::scroll):
(WebCore::ScrollAnimator::adjustScrollOffsetForSnappingIfNeeded):
* platform/ScrollAnimator.h:
* platform/ScrollController.cpp:
(WebCore::ScrollController::setNearestScrollSnapIndexForAxisAndOffset):
(WebCore::ScrollController::adjustScrollDestination):
(WebCore::ScrollController::updateActiveScrollSnapIndexForClientOffset):
(WebCore::ScrollController::resnapAfterLayout):
* platform/ScrollController.h:
* platform/ScrollSnapAnimatorState.cpp:
(WebCore::ScrollSnapAnimatorState::setupAnimationForState):
(WebCore::ScrollSnapAnimatorState::targetOffsetForStartOffset const):
* platform/ScrollSnapAnimatorState.h:
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::doPostThumbMoveSnapping):

Source/WebKit:

* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::adjustTargetContentOffsetForSnapping):
(WebKit::RemoteScrollingCoordinatorProxy::closestSnapOffsetForMainFrameScrolling const):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(-[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]):


Canonical link: https://commits.webkit.org/239866@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280171 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-22 09:00:27 +00:00
..
ScrollingCoordinatorNicosia.cpp Remove WTF::Optional synonym for std::optional, using that class template directly instead 2021-05-30 16:11:40 +00:00
ScrollingCoordinatorNicosia.h Remove WTF::Optional synonym for std::optional, using that class template directly instead 2021-05-30 16:11:40 +00:00
ScrollingStateNodeNicosia.cpp
ScrollingTreeFixedNode.cpp
ScrollingTreeFixedNode.h
ScrollingTreeFrameScrollingNodeNicosia.cpp
ScrollingTreeFrameScrollingNodeNicosia.h
ScrollingTreeNicosia.cpp [GTK][WPE] Wrong frame scrolled when view is horizontally scrolled with async scrolling enabled 2021-04-07 08:32:32 +00:00
ScrollingTreeNicosia.h
ScrollingTreeOverflowScrollProxyNode.cpp
ScrollingTreeOverflowScrollProxyNode.h
ScrollingTreeOverflowScrollingNodeNicosia.cpp
ScrollingTreeOverflowScrollingNodeNicosia.h
ScrollingTreePositionedNode.cpp
ScrollingTreePositionedNode.h
ScrollingTreeScrollingNodeDelegateNicosia.cpp [css-scroll-snap] Pass the full target point when selecting a snap offset 2021-07-22 09:00:27 +00:00
ScrollingTreeScrollingNodeDelegateNicosia.h
ScrollingTreeStickyNode.cpp [WPE] position:sticky content is not correctly offset on async scrolled overflow layers with an RTL vertical scrollbar 2021-06-03 23:39:32 +00:00
ScrollingTreeStickyNode.h