Move UIWebTouchEventsGestureRecognizer.activeTouchesByIdentifier to SPI
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Feb 2019 21:43:43 +0000 (21:43 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Feb 2019 21:43:43 +0000 (21:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=194531
<rdar://problem/47714562>

Patch by Antoine Quint <graouts@apple.com> on 2019-02-21
Reviewed by Tim Horton.

Follow-up commit to ensure this SPI is only called on newer versions of iOS.

Source/WebKit:

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cancelPointersForGestureRecognizer:]):

Source/WTF:

* wtf/Platform.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241900 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WTF/ChangeLog
Source/WTF/wtf/Platform.h
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

index 4ecf773..2ce7a54 100644 (file)
@@ -1,3 +1,15 @@
+2019-02-21  Antoine Quint  <graouts@apple.com>
+
+        Move UIWebTouchEventsGestureRecognizer.activeTouchesByIdentifier to SPI
+        https://bugs.webkit.org/show_bug.cgi?id=194531
+        <rdar://problem/47714562>
+
+        Reviewed by Tim Horton.
+
+        Follow-up commit to ensure this SPI is only called on newer versions of iOS.
+
+        * wtf/Platform.h:
+
 2019-02-21  Dean Jackson  <dino@apple.com>
 
         Rotation animations sometimes use the wrong origin (affects apple.com)
index 0ac31dd..9bfac42 100644 (file)
 #elif PLATFORM(IOS_FAMILY)
 #define ENABLE_MONOSPACE_FONT_EXCEPTION (__IPHONE_OS_VERSION_MIN_REQUIRED < 130000)
 #endif
+
+#if PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000
+#define HAVE_UI_WEB_TOUCH_EVENTS_GESTURE_RECOGNIZER_WITH_ACTIVE_TOUCHES_BY_ID 1
+#endif
index 45fd995..1de2886 100644 (file)
@@ -1,3 +1,16 @@
+2019-02-21  Antoine Quint  <graouts@apple.com>
+
+        Move UIWebTouchEventsGestureRecognizer.activeTouchesByIdentifier to SPI
+        https://bugs.webkit.org/show_bug.cgi?id=194531
+        <rdar://problem/47714562>
+
+        Reviewed by Tim Horton.
+
+        Follow-up commit to ensure this SPI is only called on newer versions of iOS.
+
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView cancelPointersForGestureRecognizer:]):
+
 2019-02-21  Tim Horton  <timothy_horton@apple.com>
 
         Crash under RemoteLayerTreePropertyApplier::applyProperties when reattaching to old process
index b60da74..a2ee9e5 100644 (file)
@@ -1188,16 +1188,15 @@ static inline bool hasFocusedElement(WebKit::FocusedElementInformation focusedEl
 #if ENABLE(POINTER_EVENTS)
 - (void)cancelPointersForGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer
 {
+#if HAVE(UI_WEB_TOUCH_EVENTS_GESTURE_RECOGNIZER_WITH_ACTIVE_TOUCHES_BY_ID)
     // FIXME: <rdar://problem/48035706>
-    if (![_touchEventGestureRecognizer respondsToSelector:@selector(activeTouchesByIdentifier)])
-        return;
-
     NSMapTable<NSNumber *, UITouch *> *activeTouches = [_touchEventGestureRecognizer activeTouchesByIdentifier];
     for (NSNumber *touchIdentifier in activeTouches) {
         UITouch *touch = [activeTouches objectForKey:touchIdentifier];
         if ([touch.gestureRecognizers containsObject:gestureRecognizer])
             _page->cancelPointer([touchIdentifier unsignedIntValue], WebCore::roundedIntPoint([touch locationInView:self]));
     }
+#endif
 }
 #endif