Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 279d12080527fa36e94941feedf813eac7b87a5a
      
https://github.com/WebKit/WebKit/commit/279d12080527fa36e94941feedf813eac7b87a5a
  Author: Nikolaos Mouchtaris <[email protected]>
  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


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to