[webkit-changes] [WebKit/WebKit] 279d12: [css-scroll-snap] Have ScrollSnapAnimatorState cal...
Nikos Mouchtaris
noreply at github.com
Wed Feb 1 10:21:51 PST 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 279d12080527fa36e94941feedf813eac7b87a5a
https://github.com/WebKit/WebKit/commit/279d12080527fa36e94941feedf813eac7b87a5a
Author: Nikolaos Mouchtaris <nmouchtaris at apple.com>
Date: 2023-02-01 (Wed, 01 Feb 2023)
Changed paths:
A LayoutTests/css3/scroll-snap/scroll-snap-remove-snap-area-expected.txt
A LayoutTests/css3/scroll-snap/scroll-snap-remove-snap-area.html
M Source/WebCore/platform/ScrollSnapAnimatorState.cpp
M Source/WebCore/platform/ScrollSnapAnimatorState.h
Log Message:
-----------
[css-scroll-snap] Have ScrollSnapAnimatorState calculate the HashSet of currently snapped boxes immediately
https://bugs.webkit.org/show_bug.cgi?id=251449
rdar://104816359
Reviewed by Simon Fraser.
The added test css3/scroll-snap/scroll-snap-remove-snap-area.html exposes a bug where removing a snap
area while we are currently snapped to multiple boxes will cause the state in the offsets stored in
m_currentlySnappedBoxesX and m_currentlySnappedBoxesY to become out of sync with the state
in m_snapOffsetsInfo. To resolve this, run currentlySnappedBoxes immediately and store its
result, rather than running it when we are no no longer snapped to multiple boxes, where the
state in m_currentlySnappedBoxesX and m_currentlySnappedBoxesY could be stale.
* Source/WebCore/platform/ScrollSnapAnimatorState.cpp:
(WebCore::ScrollSnapAnimatorState::currentlySnappedBoxes const):
(WebCore::ScrollSnapAnimatorState::chooseBoxToResnapTo const):
(WebCore::ScrollSnapAnimatorState::resnapAfterLayout):
(WebCore::isSnappedToMultipleBoxes): Deleted.
* Source/WebCore/platform/ScrollSnapAnimatorState.h:
Canonical link: https://commits.webkit.org/259696@main
More information about the webkit-changes
mailing list