Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f244f515a09c41cf21eb39ea883eba4c45a36c38
      
https://github.com/WebKit/WebKit/commit/f244f515a09c41cf21eb39ea883eba4c45a36c38
  Author: Simon Fraser <[email protected]>
  Date:   2026-07-20 (Mon, 20 Jul 2026)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-snap/input/paged-expected.txt
    M Source/WebCore/page/scrolling/ScrollSnapOffsetsInfo.cpp
    M Source/WebCore/page/scrolling/ScrollSnapOffsetsInfo.h
    M Source/WebCore/platform/ScrollAnimator.cpp
    M Source/WebCore/platform/ScrollAnimator.h
    M Source/WebCore/platform/ScrollSnapAnimatorState.cpp
    M Source/WebCore/platform/ScrollSnapAnimatorState.h
    M Source/WebCore/platform/ScrollTypes.cpp
    M Source/WebCore/platform/ScrollTypes.h
    M Source/WebCore/platform/ScrollableArea.cpp
    M Source/WebCore/platform/ScrollingEffectsController.cpp
    M Source/WebCore/platform/ScrollingEffectsController.h

  Log Message:
  -----------
  [Scroll snap] Page Down skips over snap points
https://bugs.webkit.org/show_bug.cgi?id=319731
rdar://182562852

Reviewed by Alan Baradlay.

When doing paged scrolling (Page Down or spacebar), scroll snap needs to not 
skip intermediate
snap points[1].

Fix by plumbing an enum value down to `closestSnapOffsetWithInfoAndAxis()` so 
we know when we're
doing a paged scroll, and use that to choose the next/previous snap point as 
appropriate.

Convert `ScrollBehavior` to an enum class, and use `EnumSet` instead of 
`OptionSet`.

Fixes `css/css-scroll-snap/input/paged.html`.

[1] https://drafts.csswg.org/css-scroll-snap-1/#snap-overflow

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-snap/input/paged-expected.txt:
* Source/WebCore/page/scrolling/ScrollSnapOffsetsInfo.cpp:
(WebCore::closestSnapOffsetWithInfoAndAxis):
(WebCore::LayoutScrollSnapOffsetsInfo::closestSnapOffset const):
(WebCore::FloatScrollSnapOffsetsInfo::closestSnapOffset const):
* Source/WebCore/page/scrolling/ScrollSnapOffsetsInfo.h:
* Source/WebCore/platform/ScrollAnimator.cpp:
(WebCore::ScrollAnimator::singleAxisScroll):
(WebCore::ScrollAnimator::handleSteppedScrolling):
* Source/WebCore/platform/ScrollAnimator.h:
* Source/WebCore/platform/ScrollSnapAnimatorState.cpp:
(WebCore::ScrollSnapAnimatorState::adjustedScrollDestination const):
* Source/WebCore/platform/ScrollSnapAnimatorState.h:
* Source/WebCore/platform/ScrollTypes.cpp:
(WebCore::operator<<):
* Source/WebCore/platform/ScrollTypes.h:
* Source/WebCore/platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::scroll):
* Source/WebCore/platform/ScrollingEffectsController.cpp:
(WebCore::ScrollingEffectsController::adjustedScrollDestination const):
* Source/WebCore/platform/ScrollingEffectsController.h:

Canonical link: https://commits.webkit.org/317562@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to