haikuwebkit/Source/WebCore/page/scrolling
Martin Robinson aa58705720 [css-scroll-snap] Don't snap to offscreen snap areas in unidirectional scrolls
https://bugs.webkit.org/show_bug.cgi?id=227949
<rdar://problem/80895783>

Reviewed by Frédéric Wang.

LayoutTests/imported/w3c:

* web-platform-tests/css/css-scroll-snap/snap-to-visible-areas-both-expected.txt: This bidirectional
scrolling test no longer snaps because we don't have support for choosing between two candidates
properly yet.
* web-platform-tests/css/css-scroll-snap/snap-to-visible-areas-x-axis-expected.txt: Updated to show newly passing test.
* web-platform-tests/css/css-scroll-snap/snap-to-visible-areas-y-axis-expected.txt: Ditto.

Source/WebCore:

No new tests. This is covered by two existing WPT tests.

* page/scrolling/ScrollSnapOffsetsInfo.cpp:
(WebCore::componentForAxis): Added this helper.
(WebCore::hasCompatibleSnapArea): Added this helper that checks to see if any of the snap areas
at a given scroll snap position are compatible with the viewport.
(WebCore::adjustPreviousAndNextForOnscreenSnapAreas): Adjusts the selected previous and next snap
positions by looking backward and forward for the first compatible snap position.
(WebCore::closestSnapOffsetWithInfoAndAxis): Use the new helper.


Canonical link: https://commits.webkit.org/240633@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281189 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-18 15:59:48 +00:00
..
cocoa
mac
nicosia [css-scroll-snap] Pass the full target point when selecting a snap offset 2021-07-22 09:00:27 +00:00
AsyncScrollingCoordinator.cpp
AsyncScrollingCoordinator.h
ScrollLatchingController.cpp
ScrollLatchingController.h
ScrollSnapOffsetsInfo.cpp [css-scroll-snap] Don't snap to offscreen snap areas in unidirectional scrolls 2021-08-18 15:59:48 +00:00
ScrollSnapOffsetsInfo.h [css-scroll-snap] Consider all snap areas at a given snap offset when snapping 2021-08-02 08:54:16 +00:00
ScrollingConstraints.cpp
ScrollingConstraints.h
ScrollingCoordinator.cpp
ScrollingCoordinator.h
ScrollingCoordinatorTypes.h
ScrollingMomentumCalculator.cpp
ScrollingMomentumCalculator.h
ScrollingStateFixedNode.cpp
ScrollingStateFixedNode.h
ScrollingStateFrameHostingNode.cpp
ScrollingStateFrameHostingNode.h
ScrollingStateFrameScrollingNode.cpp
ScrollingStateFrameScrollingNode.h
ScrollingStateNode.cpp
ScrollingStateNode.h
ScrollingStateOverflowScrollProxyNode.cpp
ScrollingStateOverflowScrollProxyNode.h
ScrollingStateOverflowScrollingNode.cpp
ScrollingStateOverflowScrollingNode.h
ScrollingStatePositionedNode.cpp
ScrollingStatePositionedNode.h
ScrollingStateScrollingNode.cpp
ScrollingStateScrollingNode.h
ScrollingStateStickyNode.cpp
ScrollingStateStickyNode.h
ScrollingStateTree.cpp
ScrollingStateTree.h
ScrollingThread.cpp
ScrollingThread.h
ScrollingTree.cpp
ScrollingTree.h
ScrollingTreeFrameHostingNode.cpp
ScrollingTreeFrameHostingNode.h
ScrollingTreeFrameScrollingNode.cpp
ScrollingTreeFrameScrollingNode.h
ScrollingTreeGestureState.cpp
ScrollingTreeGestureState.h
ScrollingTreeLatchingController.cpp
ScrollingTreeLatchingController.h
ScrollingTreeNode.cpp
ScrollingTreeNode.h
ScrollingTreeOverflowScrollingNode.cpp
ScrollingTreeOverflowScrollingNode.h
ScrollingTreeScrollingNode.cpp
ScrollingTreeScrollingNode.h
ScrollingTreeScrollingNodeDelegate.cpp
ScrollingTreeScrollingNodeDelegate.h
ThreadedScrollingTree.cpp
ThreadedScrollingTree.h