Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b3caa50f3bdc9a117cb22a736568813c3cf3350e
      
https://github.com/WebKit/WebKit/commit/b3caa50f3bdc9a117cb22a736568813c3cf3350e
  Author: Lily Spiniolas <[email protected]>
  Date:   2026-03-27 (Fri, 27 Mar 2026)

  Changed paths:
    M Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm
    M Source/WebCore/platform/RubberbandingState.h
    M Source/WebCore/platform/mac/ScrollingEffectsController.mm

  Log Message:
  -----------
  Rubberband animation restoration sometimes appears incorrect
https://bugs.webkit.org/show_bug.cgi?id=310913
rdar://173029226

Reviewed by Abrar Rahman Protyasha.

Fix two bugs with rubberband restoration.

Bug one: If the page fully rubberbands to a non-zero overscroll location,
the page reloads, rubberbanding restoration is triggered, and the overscroll
location returns to 0, no animation plays.
Fix by not gating restoration behind whether or not an animation is
already playing. Even if one is not playing at restoration time, if the
overscroll is greater than 0 and then becomes 0 after page load, we still need
to rubberband.

Bug two: After a rubberband animation is restored, scroll stretch may increase
unexpectedly with no user interaction, causing it to appear to "jump" before
rubberbanding back. This is caused by stale wheel events continuing to dispatch
after the page reloads.
Fix by absorbing wheel events during rubberband restoration, and by not
restoring scroll force and momentum velocity since these are related to active
gestures rather than rubberbanding animations.

Tests will be added in a later patch.

* Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
* Source/WebCore/platform/RubberbandingState.h:
* Source/WebCore/platform/mac/ScrollingEffectsController.mm:
(WebCore::ScrollingEffectsController::captureRubberbandingState const):
(WebCore::ScrollingEffectsController::restoreRubberbandingState):

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



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

Reply via email to