[webkit-changes] [WebKit/WebKit] 153d88: Add WKTouchEventsGestureRecognizer and use it to r...

Wenson Hsieh noreply at github.com
Mon Jul 10 14:06:11 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 153d88fa3ea612b1b3db28834cc3232a8b5c812e
      https://github.com/WebKit/WebKit/commit/153d88fa3ea612b1b3db28834cc3232a8b5c812e
  Author: Wenson Hsieh <wenson_hsieh at apple.com>
  Date:   2023-07-10 (Mon, 10 Jul 2023)

  Changed paths:
    M Source/WebKit/Platform/spi/ios/UIKitSPI.h
    M Source/WebKit/Shared/NativeWebTouchEvent.h
    M Source/WebKit/Shared/ios/NativeWebTouchEventIOS.mm
    M Source/WebKit/SourcesCocoa.txt
    M Source/WebKit/UIProcess/ios/PageClientImplIOS.mm
    M Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
    M Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
    M Source/WebKit/UIProcess/ios/WKSyntheticTapGestureRecognizer.h
    M Source/WebKit/UIProcess/ios/WKSyntheticTapGestureRecognizer.mm
    A Source/WebKit/UIProcess/ios/WKTouchEventsGestureRecognizer.h
    A Source/WebKit/UIProcess/ios/WKTouchEventsGestureRecognizer.mm
    A Source/WebKit/UIProcess/ios/WKTouchEventsGestureRecognizerTypes.h
    M Source/WebKit/WebKit.xcodeproj/project.pbxproj
    M Tools/TestWebKitAPI/Configurations/Base.xcconfig
    M Tools/TestWebKitAPI/Tests/ios/TouchEventTests.mm
    M Tools/TestWebKitAPI/ios/UIKitSPI.h

  Log Message:
  -----------
  Add WKTouchEventsGestureRecognizer and use it to replace UIWebTouchEventsGestureRecognizer
https://bugs.webkit.org/show_bug.cgi?id=258748
rdar://111922409

Reviewed by Megan Gardner.

Introduce `WKTouchEventsGestureRecognizer`, and use it to replace `UIWebTouchEventsGestureRecognizer`
from UIKit. This allows us to observe and dispatch touch events, using only UIKit API.

No change in behavior.

* Source/WebKit/Platform/spi/ios/UIKitSPI.h:
* Source/WebKit/Shared/NativeWebTouchEvent.h:
* Source/WebKit/Shared/ios/NativeWebTouchEventIOS.mm:
(WebKit::webEventTypeForWKTouchEventType):
(WebKit::convertTouchType):
(WebKit::radiusForTouchPoint):
(WebKit::NativeWebTouchEvent::extractWebTouchPoint):
(WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
(WebKit::webEventTypeForUIWebTouchEventType): Deleted.
* Source/WebKit/SourcesCocoa.txt:
* Source/WebKit/UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::doneWithTouchEvent):
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.h:
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setUpInteraction]):
(-[WKContentView cleanUpInteraction]):
(-[WKContentView _touchEventsRecognized:]):
(-[WKContentView _touchEvent:preventsNativeGestures:]):
(-[WKContentView touchEventGestureRecognizer]):
(-[WKContentView gestureRecognizer:shouldIgnoreTouchEvent:]):
(-[WKContentView _webTouchEventsRecognized:]): Deleted.
(-[WKContentView _webTouchEvent:preventsNativeGestures:]): Deleted.

Also take the opportunity to simplify some of the method names here by removing the "web" prefix in
cases where it was only necessary to differentiate WebKit-specific code from other UIKit classes.

(-[WKContentView gestureRecognizer:shouldIgnoreWebTouchWithEvent:]): Deleted.
* Source/WebKit/UIProcess/ios/WKSyntheticTapGestureRecognizer.h:
* Source/WebKit/UIProcess/ios/WKSyntheticTapGestureRecognizer.mm:
(-[WKSyntheticTapGestureRecognizer touchesEnded:withEvent:]):
* Source/WebKit/UIProcess/ios/WKTouchEventsGestureRecognizer.h: Added.
* Source/WebKit/UIProcess/ios/WKTouchEventsGestureRecognizer.mm: Added.
(approximateWallTime):
(+[WKTouchEventsGestureRecognizer initialize]):
(-[WKTouchEventsGestureRecognizer initWithTarget:action:touchDelegate:]):
(-[WKTouchEventsGestureRecognizer activeTouchesByIdentifier]):
(-[WKTouchEventsGestureRecognizer reset]):
(-[WKTouchEventsGestureRecognizer cancel]):
(nextTouchIdentifier):
(-[WKTouchEventsGestureRecognizer _updateTapStateWithTouches:]):
(-[WKTouchEventsGestureRecognizer _updateTapStateWithTouches:type:]):
(-[WKTouchEventsGestureRecognizer _recordTouches:type:]):
(eventTypeForTouchPhase):
(lastExpectedWKEventTypeForTouches):
(-[WKTouchEventsGestureRecognizer performAction]):
(-[WKTouchEventsGestureRecognizer _hasActiveTouchesForEvent:]):
(-[WKTouchEventsGestureRecognizer _processTouches:withEvent:type:]):
(-[WKTouchEventsGestureRecognizer canBePreventedByGestureRecognizer:]):
(-[WKTouchEventsGestureRecognizer touchesBegan:withEvent:]):
(-[WKTouchEventsGestureRecognizer touchesMoved:withEvent:]):
(-[WKTouchEventsGestureRecognizer touchesEnded:withEvent:]):
(-[WKTouchEventsGestureRecognizer touchesCancelled:withEvent:]):
(-[WKTouchEventsGestureRecognizer lastTouchEvent]):
* Source/WebKit/UIProcess/ios/WKTouchEventsGestureRecognizerTypes.h: Copied from Source/WebKit/UIProcess/ios/WKSyntheticTapGestureRecognizer.h.
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Configurations/Base.xcconfig:
* Tools/TestWebKitAPI/Tests/ios/TouchEventTests.mm:
(touchEventsGestureRecognizerClass):
(-[WKWebView touchEventGestureRecognizer]):
(TestWebKitAPI::updateSimulatedTouchEvent):
(TestWebKitAPI::simulatedTouchEvent):
(TestWebKitAPI::TEST):
* Tools/TestWebKitAPI/ios/UIKitSPI.h:

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




More information about the webkit-changes mailing list