Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1eb4c74604e953e73ab237cf0fca967e2cf9b188
      
https://github.com/WebKit/WebKit/commit/1eb4c74604e953e73ab237cf0fca967e2cf9b188
  Author: Abrar Rahman Protyasha <[email protected]>
  Date:   2026-08-07 (Fri, 07 Aug 2026)

  Changed paths:
    M Source/WebKit/Shared/NativeWebGestureEvent.h
    M Source/WebKit/Shared/WebEvent.serialization.in
    M Source/WebKit/Shared/mac/NativeWebGestureEventMac.mm
    M Source/WebKit/Shared/mac/WebGestureEvent.h
    M Source/WebKit/UIProcess/ViewGestureController.h
    M Source/WebKit/UIProcess/mac/PageClientImplMac.mm
    M Source/WebKit/UIProcess/mac/ViewGestureControllerMac.mm
    M Source/WebKit/UIProcess/mac/WebViewImpl.h
    M Source/WebKit/UIProcess/mac/WebViewImpl.mm

  Log Message:
  -----------
  [macOS] Support gesture event handling without a backing NSEvent
https://bugs.webkit.org/show_bug.cgi?id=321223
rdar://184273141

Reviewed by Richard Robinson.

Forthcoming changes will make it possible to synthesize work for
ViewGestureController without going through the NSResponder/NSEvent
machinery that drives it today. Since these paths will not have a
backing NSEvent, we introduce this refactor that undoes a couple of
assumptions.

1. We teach WebGestureEvent about the gesture phase. This field is
   either populated by reading the `NSEvent.phase` property, or through
   other means.
2. We add a `Kind` enum to NativeWebGestureEvent, recording whether the
   gesture is a magnification or a rotation.
3. We make it possible to create a NativeWebGestureEvent instance from
   either an NSEvent, or from an explicit initialization structure that
   describes the gesture. In the latter case, we will store a null
   native event field, inspired by precedent established in 303084@main.
4. We pass around the entire NativeWebGestureEvent instance, rather than
   its native event, in the gestureEventWasNotHandledByWebCore path.
   This allows us to drive the namesake SPI when there is a backing
   event, and go straight to ViewGestureController magnification if not.

The new initialization method has no callers yet, and as such this patch
does not introduce a behavior change.

* Source/WebKit/Shared/NativeWebGestureEvent.h:
* Source/WebKit/Shared/WebEvent.serialization.in:
* Source/WebKit/Shared/mac/NativeWebGestureEventMac.mm:
(WebKit::webEventTypeForPhase):
(WebKit::positionInView):
(WebKit::initForEvent):
(WebKit::NativeWebGestureEvent::create):
(WebKit::NativeWebGestureEvent::NativeWebGestureEvent):
(WebKit::webEventTypeForNSEvent): Deleted.
(WebKit::pointForEvent): Deleted.
* Source/WebKit/Shared/mac/WebGestureEvent.h:
(WebKit::WebGestureEvent::WebGestureEvent):
(WebKit::WebGestureEvent::phase const):
* Source/WebKit/UIProcess/ViewGestureController.h:

Also drop PlatformMagnificationEvent, which has no remaining users now
that nothing in ViewGestureController takes an NSEvent directly.

* Source/WebKit/UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::gestureEventWasNotHandledByWebCore):
* Source/WebKit/UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::gestureEventWasNotHandledByWebCore): Deleted.
* Source/WebKit/UIProcess/mac/WebViewImpl.h:
* Source/WebKit/UIProcess/mac/WebViewImpl.mm:
(WebKit::WebViewImpl::gestureEventWasNotHandledByWebCore):
(WebKit::WebViewImpl::gestureEventWasNotHandledByWebCoreFromViewOnly):
(WebKit::WebViewImpl::magnificationGestureWasNotHandledByWebCoreFromViewOnly):

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



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

Reply via email to