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

  Changed paths:
    M Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
    M Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h
    M Source/WebCore/page/scrolling/ScrollingCoordinatorTypes.cpp
    M Source/WebCore/page/scrolling/ScrollingCoordinatorTypes.h
    M Source/WebCore/page/scrolling/ScrollingTree.h
    M Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp
    M Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp
    M Source/WebKit/Scripts/webkit/messages.py
    M Source/WebKit/Scripts/webkit/tests/MessageArgumentDescriptions.cpp
    M Source/WebKit/Shared/WTFArgumentCoders.serialization.in
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.h
    M 
Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.h
    M 
Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm

  Log Message:
  -----------
  [Async scrolling] Lay the groundwork for programmatic scrolls to send a reply 
back to the web process
https://bugs.webkit.org/show_bug.cgi?id=308188
rdar://170687588

Reviewed by Abrar Rahman Protyasha.

There are cases with async scrolling where UI and web processes can get out of 
sync in
terms of the current scroll position. This can cause things like offset 
hit-testing, and
missing tiles.

This PR lays the groundwork for fixing this problem, which is to have 
programmatic scroll
messages to the UI process (which use `RequestedScrollData`) to be tagged with a
`ScrollRequestIdentifier`, which bounces back to the web process via a new type 
of
`ScrollUpdate`, which is a `ScrollRequestResponse`. A future PR will add 
handling
of this response.

A `ScrollRequestIdentifier` is generated via `willSendScrollPositionRequest()` 
which
`RemoteScrollingCoordinator` overrides to tack on the identifier. We add 
support for
serializing this identifier, and the new `ScrollRequestResponse` type. 
ScrollRequestIdentifiers
are ordered, and we only need to track the most recent (so merging uses the max 
value).

The scroll request gets to the UI-side scrolling tree at 
`ScrollingTreeScrollingNode::handleScrollPositionRequest()`,
which calls `didHandleScrollRequestForNode()` on the scrolling tree to 
formulate the reply
in `RemoteScrollingTree::didHandleScrollRequestForNode()`, which is just 
treated like other scroll updates
(and thus ordered with them).

* Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::requestScrollToPosition):
(WebCore::AsyncScrollingCoordinator::stopAnimatedScroll):
(WebCore::AsyncScrollingCoordinator::applyScrollPositionUpdate):
* Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h:
(WebCore::AsyncScrollingCoordinator::willSendScrollPositionRequest):
* Source/WebCore/page/scrolling/ScrollingCoordinatorTypes.cpp:
(WebCore::RequestedScrollData::merge):
(WebCore::operator<<):
* Source/WebCore/page/scrolling/ScrollingCoordinatorTypes.h:
(WebCore::RequestedScrollData::operator== const):
(WebCore::ScrollUpdate::canMerge const):
(WebCore::ScrollUpdate::merge):
* Source/WebCore/page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::didHandleScrollRequestForNode):
* Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::handleScrollPositionRequest):
* Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
(WebCore::ThreadedScrollingTree::scrollingTreeNodeScrollUpdated):
* Source/WebKit/Scripts/webkit/messages.py:
(serialized_identifiers):
(headers_for_type):
* Source/WebKit/Scripts/webkit/tests/MessageArgumentDescriptions.cpp:
(IPC::serializedIdentifiers):
* Source/WebKit/Shared/WTFArgumentCoders.serialization.in:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::didHandleScrollRequestForNode):
(WebKit::RemoteScrollingTree::scrollingTreeNodeDidStopProgrammaticScroll):
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
* Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.h:
* 
Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm:
(WebKit::RemoteScrollingCoordinator::willSendScrollPositionRequest):

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



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

Reply via email to