Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f375994f3f8e0c5c9c7eaf2b12c9ade8ca50dde4
      
https://github.com/WebKit/WebKit/commit/f375994f3f8e0c5c9c7eaf2b12c9ade8ca50dde4
  Author: Lily Spiniolas <[email protected]>
  Date:   2026-04-30 (Thu, 30 Apr 2026)

  Changed paths:
    M Source/WebKit/UIProcess/ios/WKTouchEventsGestureRecognizer.mm

  Log Message:
  -----------
  REGRESSION(306362@main): `preventDefault` for `pointerdown` on iOS does not 
stop `mousedown` from firing
https://bugs.webkit.org/show_bug.cgi?id=313688
rdar://174864309

Reviewed by Richard Robinson and Abrar Rahman Protyasha.

In 306362@main we began to clear the pointer capture controller when
`[WKTouchEventsGestureRecognizer reset]` was called so that the map of
active touches wouldn't get stuck when an external gesture recognizer
handled the touch in a specific manner.

However, when the screen is tapped, after `pointerdown` is dispatched,
`PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier`
is called to see if we should also dispatch `mousedown`. Critically, this
is done by examining the map of active touches, which now gets cleared
before the check, thus preventing us from making thte correct determination.

Fix the issue by only clearing the map from
`[WKTouchEventsGestureRecognizer reset]` if the last touch's type isn't
`WKTouchEventType::End`, indicating that the touch sequence finished abnormally.

Tested by
`pointerevents/ios/pointer-events-no-mousedown-when-prevent-default-called-on-pointerdown.html`

* Source/WebKit/UIProcess/ios/WKTouchEventsGestureRecognizer.mm:
(-[WKTouchEventsGestureRecognizer reset]):

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



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

Reply via email to