Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2dce2395a46b77141ed9e6cadb6b5e5bee1e1bf3
      
https://github.com/WebKit/WebKit/commit/2dce2395a46b77141ed9e6cadb6b5e5bee1e1bf3
  Author: Fujii Hironori <[email protected]>
  Date:   2026-08-17 (Mon, 17 Aug 2026)

  Changed paths:
    M LayoutTests/fast/events/touch/basic-multi-touch-events-limited.html
    M LayoutTests/fast/events/touch/basic-multi-touch-events.html
    M LayoutTests/fast/events/touch/basic-single-touch-events.html
    M LayoutTests/fast/events/touch/input-touch-target.html
    M LayoutTests/fast/events/touch/moved-touch-target.html
    M LayoutTests/fast/events/touch/multi-touch-grouped-targets.html
    M LayoutTests/fast/events/touch/multi-touch-inside-iframes.html
    M LayoutTests/fast/events/touch/multi-touch-inside-nested-iframes.html
    M LayoutTests/fast/events/touch/multi-touch-some-without-handlers.html
    M LayoutTests/fast/events/touch/removed-fragment-touch-target.html
    M LayoutTests/fast/events/touch/removed-touch-target.html
    M LayoutTests/fast/events/touch/resources/touch-stale-node-crash.js
    M LayoutTests/fast/events/touch/send-oncancel-event.html
    M LayoutTests/fast/events/touch/tap-highlight-color.html
    M LayoutTests/fast/events/touch/text-node-touch-target.html
    M LayoutTests/fast/events/touch/textarea-touch-target.html
    M LayoutTests/fast/events/touch/touch-active-state.html
    M LayoutTests/fast/events/touch/touch-coords-in-zoom-and-scroll.html
    M LayoutTests/fast/events/touch/touch-event-frames.html
    M LayoutTests/fast/events/touch/touch-event-pageXY.html
    M LayoutTests/fast/events/touch/touch-inside-iframe.html
    M LayoutTests/fast/events/touch/touch-scaled-scrolled.html
    M LayoutTests/fast/events/touch/touch-slider-no-js-touch-listener.html
    M LayoutTests/fast/events/touch/touch-slider.html
    M LayoutTests/fast/events/touch/touch-stale-node-crash.html
    M LayoutTests/fast/events/touch/touch-target.html
    M LayoutTests/resources/ui-helper.js
    M Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
    M Source/WTF/wtf/PlatformEnableGlib.h
    M Source/WebCore/dom/Document.cpp
    M Source/WebCore/html/HTMLInputElementInlines.h
    M Source/WebCore/page/scrolling/ScrollingTree.cpp
    M Source/WebCore/page/scrolling/ScrollingTree.h
    M Source/WebCore/page/scrolling/ThreadedScrollingTree.h
    M Source/WebCore/page/scrolling/coordinated/ScrollingTreeCoordinated.cpp
    M Source/WebCore/page/scrolling/coordinated/ScrollingTreeCoordinated.h
    M Source/WebCore/platform/ScrollingEffectsController.cpp
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/WebPageProxy.h
    M Source/WebKit/WebProcess/WebPage/EventDispatcher.cpp
    M Source/WebKit/WebProcess/WebPage/EventDispatcher.h
    M Source/WebKit/WebProcess/WebPage/EventDispatcher.messages.in
    M Source/WebKit/WebProcess/WebPage/WebPage.cpp
    M Source/WebKit/WebProcess/WebPage/WebPage.h

  Log Message:
  -----------
  [GTK][WPE] Support touch event asynchronous scrolling
https://bugs.webkit.org/show_bug.cgi?id=318938

Reviewed by Carlos Garcia Campos.

GTK and WPE ports support touch events, but previously supported the
asynchronous scrolling only for wheel events. While the iOS port supports
asynchronous scrolling for touch events too, its platform layer tree and
scrolling tree reside in the UIProcess. In contrast, GTK and WPE maintain both
trees in the WebProcess using Coordinated Graphics, so the iOS implementation
cannot be directly reused.

This patch adds support for touch event asynchronous scrolling in GTK and WPE
by following an approach similar to asynchronous wheel event scrolling:

1. Enable ENABLE_TOUCH_EVENT_REGIONS to register touch related event regions to
   the platform layer tree.
2. Send touch events to EventDispatcher in the EventDispatcher thread of web 
process.
3. Handle touch events asynchronously or synchronously depending on whether the
   touch target falls within a non-passive touch event region.

Additionally, updated touch event layout tests. Because touch event regions
must be calculated and propagated to the scrolling tree before dispatching
touch events, tests registering new event listeners now wait for two animation
frames before dispatching touch events. Added a new helper function
UIHelper.renderingComplete().

* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WTF/wtf/PlatformEnableGlib.h:
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::hasTouchEventHandlers const):
* Source/WebCore/page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::determineTouchEventTrackingTypeForPoint):
(WebCore::ScrollingTree::mainFrameScrollOffset const):
* Source/WebCore/page/scrolling/ScrollingTree.h:
* Source/WebCore/page/scrolling/coordinated/ScrollingTreeCoordinated.cpp:
(WebCore::ScrollingTreeCoordinated::findTouchEventTrackingTypeForPoint const):
(WebCore::findLayerForPoint):
(WebCore::mergeTrackingTypes):
(WebCore::ScrollingTreeCoordinated::eventTrackingTypeForTouchEvent):
(WebCore::findLayerOfEventRegionAtPoint):
* Source/WebCore/page/scrolling/coordinated/ScrollingTreeCoordinated.h:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::processNextQueuedTouchEvent):
(WebKit::WebPageProxy::touchEventHandlingCompleted):
(WebKit::WebPageProxy::handleTouchEvent):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/WebProcess/WebPage/EventDispatcher.cpp:
(WebKit::mergeTrackingTypes):
(WebKit::EventDispatcher::updateTouchEventTracking):
(WebKit::EventDispatcher::touchEventTrackingType const):
(WebKit::EventDispatcher::dispatchTouchEventViaMainThread):
(WebKit::EventDispatcher::touchEvent):
(WebKit::EventDispatcher::EventDispatcher):
* Source/WebKit/WebProcess/WebPage/EventDispatcher.h:
* Source/WebKit/WebProcess/WebPage/EventDispatcher.messages.in:
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::dispatchTouchEvent):
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* LayoutTests/fast/events/touch/basic-multi-touch-events-limited.html:
* LayoutTests/fast/events/touch/basic-multi-touch-events.html:
* LayoutTests/fast/events/touch/basic-single-touch-events.html:
* LayoutTests/fast/events/touch/input-touch-target.html:
* LayoutTests/fast/events/touch/moved-touch-target.html:
* LayoutTests/fast/events/touch/multi-touch-grouped-targets.html:
* LayoutTests/fast/events/touch/multi-touch-inside-iframes.html:
* LayoutTests/fast/events/touch/multi-touch-inside-nested-iframes.html:
* LayoutTests/fast/events/touch/multi-touch-some-without-handlers.html:
* LayoutTests/fast/events/touch/removed-fragment-touch-target.html:
* LayoutTests/fast/events/touch/removed-touch-target.html:
* LayoutTests/fast/events/touch/send-oncancel-event.html:
* LayoutTests/fast/events/touch/tap-highlight-color.html:
* LayoutTests/fast/events/touch/text-node-touch-target.html:
* LayoutTests/fast/events/touch/textarea-touch-target.html:
* LayoutTests/fast/events/touch/touch-active-state.html:
* LayoutTests/fast/events/touch/touch-coords-in-zoom-and-scroll.html:
* LayoutTests/fast/events/touch/touch-event-frames.html:
* LayoutTests/fast/events/touch/touch-event-pageXY.html:
* LayoutTests/fast/events/touch/touch-inside-iframe.html:
* LayoutTests/fast/events/touch/touch-scaled-scrolled.html:
* LayoutTests/fast/events/touch/touch-slider-no-js-touch-listener.html:
* LayoutTests/fast/events/touch/touch-slider.html:
* LayoutTests/fast/events/touch/touch-target.html:
* LayoutTests/fast/events/touch/resources/touch-stale-node-crash.js:
(onload.async await):
(onload):
(onload.async if): Deleted.
* LayoutTests/fast/events/touch/touch-stale-node-crash.html:
* LayoutTests/resources/ui-helper.js:
(window.UIHelper.async renderingUpdate):
(window.UIHelper.async renderingComplete):
* Source/WebCore/html/HTMLInputElementInlines.h:
(WebCore::HTMLInputElement::updateTouchEventHandler):
* Source/WebCore/platform/ScrollingEffectsController.cpp:
(WebCore::ScrollingEffectsController::handleWheelEvent):
* Source/WebCore/page/scrolling/ThreadedScrollingTree.h:
(WebCore::ThreadedScrollingTree::eventTrackingTypeForTouchEvent):

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



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

Reply via email to