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

  Changed paths:
    A 
LayoutTests/fast/events/touch/ios/click-event-after-pointerdown-prevent-default-on-ancestor-expected.txt
    A 
LayoutTests/fast/events/touch/ios/click-event-after-pointerdown-prevent-default-on-ancestor.html
    R 
LayoutTests/pointerevents/ios/pointerdown-prevent-default-prevents-page-scrolling-expected.txt
    R 
LayoutTests/pointerevents/ios/pointerdown-prevent-default-prevents-page-scrolling.html
    R 
LayoutTests/pointerevents/ios/pointerdown-without-prevent-default-allows-page-scrolling-expected.txt
    R 
LayoutTests/pointerevents/ios/pointerdown-without-prevent-default-allows-page-scrolling.html
    M Source/WebCore/page/PointerCaptureController.cpp
    M Source/WebCore/page/PointerCaptureController.h
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
    M Source/WebKit/WebProcess/WebPage/WebPage.cpp

  Log Message:
  -----------
  REGRESSION (310491@main): Synthetic click fails to dispatch when 
`preventDefault` is called for `pointerdown`
https://bugs.webkit.org/show_bug.cgi?id=315786
rdar://177895899

Reviewed by Abrar Rahman Protyasha and Aditya Keerthi.

In 310491@main we stop scrolling if preventDefault() is called on a pointerdown
element. This is done by setting
m_pointerDownDefaultPreventedDuringCurrentHandling in PointerCaptureController.
We then check the value in handleTouchEvent, and if true, then we return true
to indicate the event was handled. If the touch event is handled, we then block
scrolling. However, we *also* suppress synthetic clicks in this case.

However, even the intended behavior of the patch is incorrect. We should not
prevent scrolling simply because `preventDefault` is called for `pointerdown`
resulting from a touch input. Such behavior is not present in the spec and is
not performed by any other browser.

Revert to the old behavior prior to 310491@main and add a test to ensure this
doesn't happen again.

Test: 
fast/events/touch/ios/click-event-after-pointerdown-prevent-default-on-ancestor.html

* 
LayoutTests/fast/events/touch/ios/click-event-after-pointerdown-prevent-default-on-ancestor-expected.txt:
 Added.
* 
LayoutTests/fast/events/touch/ios/click-event-after-pointerdown-prevent-default-on-ancestor.html:
 Added.
* 
LayoutTests/pointerevents/ios/pointerdown-prevent-default-prevents-page-scrolling-expected.txt:
 Removed.
* 
LayoutTests/pointerevents/ios/pointerdown-prevent-default-prevents-page-scrolling.html:
 Removed.
* 
LayoutTests/pointerevents/ios/pointerdown-without-prevent-default-allows-page-scrolling-expected.txt:
 Removed.
* 
LayoutTests/pointerevents/ios/pointerdown-without-prevent-default-allows-page-scrolling.html:
 Removed.
* Source/WebCore/page/PointerCaptureController.cpp:
(WebCore::PointerCaptureController::pointerEventWasDispatched):
* Source/WebCore/page/PointerCaptureController.h:
(WebCore::PointerCaptureController::resetPointerDownDefaultPrevention): Deleted.
(WebCore::PointerCaptureController::wasPointerDownDefaultPrevented const): 
Deleted.
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::sendUnpreventableTouchEvent):
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _touchEvent:preventsNativeGestures:]):
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::handleTouchEvent):

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



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

Reply via email to