Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: efd075461ed0d76cd9e6697e469674fa0577bf79
      
https://github.com/WebKit/WebKit/commit/efd075461ed0d76cd9e6697e469674fa0577bf79
  Author: Lily Spiniolas <[email protected]>
  Date:   2026-05-05 (Tue, 05 May 2026)

  Changed paths:
    A 
LayoutTests/fast/scrolling/latching/mainframe-stretch-snaps-back-after-hold-over-subscroller-expected.txt
    A 
LayoutTests/fast/scrolling/latching/mainframe-stretch-snaps-back-after-hold-over-subscroller.html
    M Source/WebCore/page/scrolling/ScrollingTreeLatchingController.cpp
    M Source/WebCore/page/scrolling/ScrollingTreeLatchingController.h

  Log Message:
  -----------
  Main frame scroll stretching may get stuck when gesture is initiated above 
subscroller and held
https://bugs.webkit.org/show_bug.cgi?id=314055
rdar://173104821

Reviewed by Wenson Hsieh and Abrar Rahman Protyasha.

If the the mainframe and a subscroller are both scrolled to the top of the page,
the user initiates a scroll gesture above the subscroller which causes the main
frame to enter a scroll stretch, and the user then holds the gesture for more
than 100ms, the stretch gets stuck if the cursor is still above the subscroller.

This bug is caused by an issue with scroll latching. If a scroll gesture begins
over a subscroller and neither that subscroller nor any of its parent scrollers
can scroll in the direction of the gesture without going out of bounds, then the
main frame's root scrolling node becomes the latched node, and the main frame
correctly enters a scroll stretch. However, when the gesture is held longer than
100ms, the latched node (main frame's root scrolling node in this case)
is no longer considered relevant, so it stops automatically receiving wheel 
events.
When the gesture is finally released, instead of dispatching the ending event to
the latched node, a hit-test is performed. If the cursor is above the 
subscroller
still when this happens, the ending wheel event is sent there instead of the 
main
frame's root scrolling node. Since the main frame does not receive an ending 
wheel
event, it does not rubberband back.

To resolve this, we now also consider the latched node relevant if the wheel 
event
phase is not `Began` so that the latched node remains relevant for the entirety
of a continuous scroll gesture.

Test: 
fast/scrolling/latching/mainframe-stretch-snaps-back-after-hold-over-subscroller.html

* 
LayoutTests/fast/scrolling/latching/mainframe-stretch-snaps-back-after-hold-over-subscroller-expected.txt:
 Added.
* 
LayoutTests/fast/scrolling/latching/mainframe-stretch-snaps-back-after-hold-over-subscroller.html:
 Added.
* Source/WebCore/page/scrolling/ScrollingTreeLatchingController.cpp:
(WebCore::ScrollingTreeLatchingController::receivedWheelEvent):
(WebCore::ScrollingTreeLatchingController::latchingDataForEvent const):
(WebCore::ScrollingTreeLatchingController::latchedNodeHasRecentInteraction 
const):
(WebCore::ScrollingTreeLatchingController::latchedNodeIsRelevant const): 
Deleted.
* Source/WebCore/page/scrolling/ScrollingTreeLatchingController.h:

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



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

Reply via email to