Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 52d8eb35f4f1cb7ecb0a1626ea6fa8c4227f9ab0
      
https://github.com/WebKit/WebKit/commit/52d8eb35f4f1cb7ecb0a1626ea6fa8c4227f9ab0
  Author: Simon Fraser <[email protected]>
  Date:   2026-02-21 (Sat, 21 Feb 2026)

  Changed paths:
    M 
LayoutTests/fast/scrolling/ios/non-invertible-transformed-over-scroller.html
    M Source/WebCore/page/scrolling/ScrollingTree.cpp
    M Source/WebCore/page/scrolling/ScrollingTree.h
    M Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp
    M Source/WebCore/page/scrolling/ThreadedScrollingTree.h
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.h
    M Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingTreeMac.h
    M Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingTreeMac.mm

  Log Message:
  -----------
  Reduce the amount of duplicated code around 
`scrollingThreadAddedPendingUpdate()`
https://bugs.webkit.org/show_bug.cgi?id=308347
rdar://170839814

Reviewed by Anne van Kesteren.

RemoteScrollingTree and RemoteScrollingTreeMac had lots of copies of the code 
that calls
`scrollingThreadAddedPendingUpdate()` on the scrolling coordinator, but in 
different ways
in each.

Fix by adding the virtual `ScrollingTree::didAddPendingScrollUpdate()`, calling 
that
in `ScrollingTree::addPendingScrollUpdate()`, and then overriding it in the 
derived
classes to do whatever they need to do.

A minor complication is `ThreadedScrollingTree` which needs to send a 
`WheelEventTestMonitor::DeferReason`
in one case, requiring `addPendingScrollUpdateInternal()` and a special 
`addPendingScrollUpdateWithDeferReason()`.

There's a minor behavior change, which is that 
`RemoteScrollingTreeMac::scrollingTreeNodeDidStopWheelEventScroll()`
now calls `scrollingThreadAddedPendingUpdate()` directly when on the main 
thread, but maybe it should
have done that all along.

* LayoutTests/fast/scrolling/ios/non-invertible-transformed-over-scroller.html: 
This test needs to wait between the
`scrollTop = 0` and `immediateScrollElementAtContentPointToOffset()` so the UI 
process has the zero top.
* Source/WebCore/page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::addPendingScrollUpdateInternal):
(WebCore::ScrollingTree::addPendingScrollUpdate):
* Source/WebCore/page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::didAddPendingScrollUpdate):
* Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
(WebCore::ThreadedScrollingTree::scrollingTreeNodeScrollUpdated):
(WebCore::ThreadedScrollingTree::didAddPendingScrollUpdate):
(WebCore::ThreadedScrollingTree::addPendingScrollUpdateWithDeferReason):
* Source/WebCore/page/scrolling/ThreadedScrollingTree.h:
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
(WebKit::RemoteScrollingTree::scrollingTreeNodeDidStopAnimatedScroll):
(WebKit::RemoteScrollingTree::scrollingTreeNodeDidStopWheelEventScroll):
(WebKit::RemoteScrollingTree::scrollingTreeNodeDidStopProgrammaticScroll):
(WebKit::RemoteScrollingTree::didAddPendingScrollUpdate):
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
* Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingTreeMac.h:
* Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingTreeMac.mm:
(WebKit::RemoteScrollingTreeMac::scrollingTreeNodeDidScroll):
(WebKit::RemoteScrollingTreeMac::scrollingTreeNodeDidStopAnimatedScroll):
(WebKit::RemoteScrollingTreeMac::scrollingTreeNodeDidStopWheelEventScroll):
(WebKit::RemoteScrollingTreeMac::scrollingTreeNodeDidStopProgrammaticScroll):
(WebKit::RemoteScrollingTreeMac::didAddPendingScrollUpdate):

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



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

Reply via email to