Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a1a65ba028ebc3aeeab4aca74f01a87e93902d4a
      
https://github.com/WebKit/WebKit/commit/a1a65ba028ebc3aeeab4aca74f01a87e93902d4a
  Author: Roberto Rodriguez <[email protected]>
  Date:   2026-02-25 (Wed, 25 Feb 2026)

  Changed paths:
    M Source/WebKit/WebProcess/WebPage/EventDispatcher.cpp
    M Source/WebKit/WebProcess/WebPage/EventDispatcher.h
    M Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm

  Log Message:
  -----------
  [iOS] Fix touch freeze during rapid swiping with active touch event listeners
https://bugs.webkit.org/show_bug.cgi?id=306598
rdar://169279665

Reviewed by Wenson Hsieh and Abrar Rahman Protyasha.

A race condition between UIProcess main thread and WebContentProcess IPC
thread causes touch input to freeze on iOS. When a preventable TouchMove is
queued on the IPC thread but not yet dispatched, and a TouchStart reply flips
_touchEventsCanPreventNativeGestures to NO, the next TouchMove routes as
unpreventable. EventDispatcher coalesces the two TouchMoves, destroying the
preventable CompletionHandler that would have transitioned
m_touchMovePreventionState out of Waiting. The state gets permanently stuck,
blocking all deferring gesture recognizers until the
GestureRecognizerConsistencyEnforcer safety timeout fires.

Fix this by changing TouchEventData to hold a Vector<CompletionHandler>
instead of a single CompletionHandler. When coalescing, the incoming handler
is appended to the existing vector rather than replacing it. At dispatch
time, all coalesced-away handlers are invoked with the JS result before the
final handler, ensuring no state transitions are lost.

* Source/WebKit/WebProcess/WebPage/EventDispatcher.cpp:
(WebKit::TouchEventData::TouchEventData):
(WebKit::EventDispatcher::touchEvent):
(WebKit::EventDispatcher::dispatchTouchEvents):
* Source/WebKit/WebProcess/WebPage/EventDispatcher.h:
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::dispatchAsynchronousTouchEvents):
(WebKit::WebPage::cancelAsynchronousTouchEvents):

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



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

Reply via email to