[Pointer Events] Enable only on the most recent version of the supported iOS family
authorgraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 8 Jul 2019 11:22:06 +0000 (11:22 +0000)
committergraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 8 Jul 2019 11:22:06 +0000 (11:22 +0000)
https://bugs.webkit.org/show_bug.cgi?id=199562
<rdar://problem/52766511>

Reviewed by Dean Jackson.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cancelPointersForGestureRecognizer:]):
(-[WKContentView activeTouchIdentifierForGestureRecognizer:]):
(-[WKContentView touchActionActiveTouches]):
* UIProcess/ios/WKSyntheticTapGestureRecognizer.m:
(-[WKSyntheticTapGestureRecognizer touchesEnded:withEvent:]):
* UIProcess/ios/WKTouchActionGestureRecognizer.h:
* UIProcess/ios/WKTouchActionGestureRecognizer.mm:
(-[WKTouchActionGestureRecognizer canPreventGestureRecognizer:]):

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

We really don't need HAVE_UI_WEB_TOUCH_EVENTS_GESTURE_RECOGNIZER_WITH_ACTIVE_TOUCHES_BY_ID since the UIKit SPI
that was added in iOS 13 that it's checking for is really required for all parts of the implementation of Pointer
Events, including dispatch of the "pointercancel" event and support for the "touch-action" CSS property.

* wtf/Platform.h:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

LayoutTests:

* js/dom/navigator-maxtouchpoints-expected.txt: Since ENABLE_POINTER_EVENTS is now disabled by default, navigator.maxTouchPoints
is "undefined" in thed default case.
* platform/mac/js/dom/navigator-maxtouchpoints-expected.txt: But 0 on macOS.

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

21 files changed:
LayoutTests/ChangeLog
LayoutTests/js/dom/navigator-maxtouchpoints-expected.txt
LayoutTests/platform/mac/js/dom/navigator-maxtouchpoints-expected.txt [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
Source/WTF/ChangeLog
Source/WTF/wtf/Platform.h
Source/WebCore/ChangeLog
Source/WebCore/Configurations/FeatureDefines.xcconfig
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig
Source/WebKit/ChangeLog
Source/WebKit/Configurations/FeatureDefines.xcconfig
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
Source/WebKit/UIProcess/ios/WKSyntheticTapGestureRecognizer.m
Source/WebKit/UIProcess/ios/WKTouchActionGestureRecognizer.h
Source/WebKit/UIProcess/ios/WKTouchActionGestureRecognizer.mm
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/Configurations/FeatureDefines.xcconfig
Tools/ChangeLog
Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig

index 668c350..f2e5273 100644 (file)
@@ -1,3 +1,15 @@
+2019-07-08  Antoine Quint  <graouts@apple.com>
+
+        [Pointer Events] Enable only on the most recent version of the supported iOS family
+        https://bugs.webkit.org/show_bug.cgi?id=199562
+        <rdar://problem/52766511>
+
+        Reviewed by Dean Jackson.
+
+        * js/dom/navigator-maxtouchpoints-expected.txt: Since ENABLE_POINTER_EVENTS is now disabled by default, navigator.maxTouchPoints
+        is "undefined" in thed default case.
+        * platform/mac/js/dom/navigator-maxtouchpoints-expected.txt: But 0 on macOS.
+
 2019-07-07  Zalan Bujtas  <zalan@apple.com>
 
         [ContentChangeObserver] Difficult to control videos on iqiyi.com as the actions are mouse hover
index 3d064ef..8727760 100644 (file)
@@ -3,7 +3,7 @@ Check return value of navigator.maxTouchPoints.
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-navigator.maxTouchPoints = 0
+navigator.maxTouchPoints = undefined
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/LayoutTests/platform/mac/js/dom/navigator-maxtouchpoints-expected.txt b/LayoutTests/platform/mac/js/dom/navigator-maxtouchpoints-expected.txt
new file mode 100644 (file)
index 0000000..3d064ef
--- /dev/null
@@ -0,0 +1,10 @@
+Check return value of navigator.maxTouchPoints.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+navigator.maxTouchPoints = 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
index cebfd62..3e007bb 100644 (file)
@@ -1,3 +1,13 @@
+2019-07-08  Antoine Quint  <graouts@apple.com>
+
+        [Pointer Events] Enable only on the most recent version of the supported iOS family
+        https://bugs.webkit.org/show_bug.cgi?id=199562
+        <rdar://problem/52766511>
+
+        Reviewed by Dean Jackson.
+
+        * Configurations/FeatureDefines.xcconfig:
+
 2019-07-06  Michael Saboff  <msaboff@apple.com>
 
         switch(String) needs to check for exceptions when resolving the string
index 13ed2c0..fccba80 100644 (file)
@@ -316,8 +316,9 @@ ENABLE_PDFKIT_PLUGIN = $(ENABLE_PDFKIT_PLUGIN_$(WK_PLATFORM_NAME));
 ENABLE_PDFKIT_PLUGIN_macosx = ENABLE_PDFKIT_PLUGIN;
 
 ENABLE_POINTER_EVENTS = $(ENABLE_POINTER_EVENTS_$(WK_PLATFORM_NAME));
-ENABLE_POINTER_EVENTS_iphoneos = ENABLE_POINTER_EVENTS;
-ENABLE_POINTER_EVENTS_iphonesimulator = ENABLE_POINTER_EVENTS;
+ENABLE_POINTER_EVENTS_iphoneos = $(ENABLE_POINTER_EVENTS$(WK_IOS_13));
+ENABLE_POINTER_EVENTS_iphonesimulator = $(ENABLE_POINTER_EVENTS$(WK_IOS_13));
+ENABLE_POINTER_EVENTS_IOS_SINCE_13 = ENABLE_POINTER_EVENTS;
 ENABLE_POINTER_EVENTS_maccatalyst = ENABLE_POINTER_EVENTS;
 ENABLE_POINTER_EVENTS_macosx = ENABLE_POINTER_EVENTS;
 ENABLE_POINTER_EVENTS_watchos = ENABLE_POINTER_EVENTS;
index 8938a99..71ce2ab 100644 (file)
@@ -1,3 +1,17 @@
+2019-07-08  Antoine Quint  <graouts@apple.com>
+
+        [Pointer Events] Enable only on the most recent version of the supported iOS family
+        https://bugs.webkit.org/show_bug.cgi?id=199562
+        <rdar://problem/52766511>
+
+        Reviewed by Dean Jackson.
+
+        We really don't need HAVE_UI_WEB_TOUCH_EVENTS_GESTURE_RECOGNIZER_WITH_ACTIVE_TOUCHES_BY_ID since the UIKit SPI
+        that was added in iOS 13 that it's checking for is really required for all parts of the implementation of Pointer
+        Events, including dispatch of the "pointercancel" event and support for the "touch-action" CSS property.
+
+        * wtf/Platform.h:
+
 2019-07-05  Ryan Haddad  <ryanhaddad@apple.com>
 
         Unreviewed, rolling out r247115.
index b5e63a9..b6cf6bc 100644 (file)
 #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
-
-#if PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000
 #define HAVE_ARKIT_QUICK_LOOK_PREVIEW_ITEM 1
 #endif
 
index b9cd603..ad415c9 100644 (file)
@@ -1,3 +1,13 @@
+2019-07-08  Antoine Quint  <graouts@apple.com>
+
+        [Pointer Events] Enable only on the most recent version of the supported iOS family
+        https://bugs.webkit.org/show_bug.cgi?id=199562
+        <rdar://problem/52766511>
+
+        Reviewed by Dean Jackson.
+
+        * Configurations/FeatureDefines.xcconfig:
+
 2019-07-08  Philippe Normand  <pnormand@igalia.com>
 
         [GStreamer] The CREATE_TRACK macro is messed up
index 13ed2c0..fccba80 100644 (file)
@@ -316,8 +316,9 @@ ENABLE_PDFKIT_PLUGIN = $(ENABLE_PDFKIT_PLUGIN_$(WK_PLATFORM_NAME));
 ENABLE_PDFKIT_PLUGIN_macosx = ENABLE_PDFKIT_PLUGIN;
 
 ENABLE_POINTER_EVENTS = $(ENABLE_POINTER_EVENTS_$(WK_PLATFORM_NAME));
-ENABLE_POINTER_EVENTS_iphoneos = ENABLE_POINTER_EVENTS;
-ENABLE_POINTER_EVENTS_iphonesimulator = ENABLE_POINTER_EVENTS;
+ENABLE_POINTER_EVENTS_iphoneos = $(ENABLE_POINTER_EVENTS$(WK_IOS_13));
+ENABLE_POINTER_EVENTS_iphonesimulator = $(ENABLE_POINTER_EVENTS$(WK_IOS_13));
+ENABLE_POINTER_EVENTS_IOS_SINCE_13 = ENABLE_POINTER_EVENTS;
 ENABLE_POINTER_EVENTS_maccatalyst = ENABLE_POINTER_EVENTS;
 ENABLE_POINTER_EVENTS_macosx = ENABLE_POINTER_EVENTS;
 ENABLE_POINTER_EVENTS_watchos = ENABLE_POINTER_EVENTS;
index 4406811..7b2d415 100644 (file)
@@ -1,3 +1,13 @@
+2019-07-08  Antoine Quint  <graouts@apple.com>
+
+        [Pointer Events] Enable only on the most recent version of the supported iOS family
+        https://bugs.webkit.org/show_bug.cgi?id=199562
+        <rdar://problem/52766511>
+
+        Reviewed by Dean Jackson.
+
+        * Configurations/FeatureDefines.xcconfig:
+
 2019-07-05  Ryan Haddad  <ryanhaddad@apple.com>
 
         Unreviewed, rolling out r247159.
index 13ed2c0..fccba80 100644 (file)
@@ -316,8 +316,9 @@ ENABLE_PDFKIT_PLUGIN = $(ENABLE_PDFKIT_PLUGIN_$(WK_PLATFORM_NAME));
 ENABLE_PDFKIT_PLUGIN_macosx = ENABLE_PDFKIT_PLUGIN;
 
 ENABLE_POINTER_EVENTS = $(ENABLE_POINTER_EVENTS_$(WK_PLATFORM_NAME));
-ENABLE_POINTER_EVENTS_iphoneos = ENABLE_POINTER_EVENTS;
-ENABLE_POINTER_EVENTS_iphonesimulator = ENABLE_POINTER_EVENTS;
+ENABLE_POINTER_EVENTS_iphoneos = $(ENABLE_POINTER_EVENTS$(WK_IOS_13));
+ENABLE_POINTER_EVENTS_iphonesimulator = $(ENABLE_POINTER_EVENTS$(WK_IOS_13));
+ENABLE_POINTER_EVENTS_IOS_SINCE_13 = ENABLE_POINTER_EVENTS;
 ENABLE_POINTER_EVENTS_maccatalyst = ENABLE_POINTER_EVENTS;
 ENABLE_POINTER_EVENTS_macosx = ENABLE_POINTER_EVENTS;
 ENABLE_POINTER_EVENTS_watchos = ENABLE_POINTER_EVENTS;
index 7d656e0..ac892ad 100644 (file)
@@ -1,3 +1,22 @@
+2019-07-08  Antoine Quint  <graouts@apple.com>
+
+        [Pointer Events] Enable only on the most recent version of the supported iOS family
+        https://bugs.webkit.org/show_bug.cgi?id=199562
+        <rdar://problem/52766511>
+
+        Reviewed by Dean Jackson.
+
+        * Configurations/FeatureDefines.xcconfig:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView cancelPointersForGestureRecognizer:]):
+        (-[WKContentView activeTouchIdentifierForGestureRecognizer:]):
+        (-[WKContentView touchActionActiveTouches]):
+        * UIProcess/ios/WKSyntheticTapGestureRecognizer.m:
+        (-[WKSyntheticTapGestureRecognizer touchesEnded:withEvent:]):
+        * UIProcess/ios/WKTouchActionGestureRecognizer.h:
+        * UIProcess/ios/WKTouchActionGestureRecognizer.mm:
+        (-[WKTouchActionGestureRecognizer canPreventGestureRecognizer:]):
+
 2019-07-08  Michael Catanzaro  <mcatanzaro@igalia.com>
 
         [GTK] ViewGestureController constructor leaves m_direction uninitialized
index 13ed2c0..fccba80 100644 (file)
@@ -316,8 +316,9 @@ ENABLE_PDFKIT_PLUGIN = $(ENABLE_PDFKIT_PLUGIN_$(WK_PLATFORM_NAME));
 ENABLE_PDFKIT_PLUGIN_macosx = ENABLE_PDFKIT_PLUGIN;
 
 ENABLE_POINTER_EVENTS = $(ENABLE_POINTER_EVENTS_$(WK_PLATFORM_NAME));
-ENABLE_POINTER_EVENTS_iphoneos = ENABLE_POINTER_EVENTS;
-ENABLE_POINTER_EVENTS_iphonesimulator = ENABLE_POINTER_EVENTS;
+ENABLE_POINTER_EVENTS_iphoneos = $(ENABLE_POINTER_EVENTS$(WK_IOS_13));
+ENABLE_POINTER_EVENTS_iphonesimulator = $(ENABLE_POINTER_EVENTS$(WK_IOS_13));
+ENABLE_POINTER_EVENTS_IOS_SINCE_13 = ENABLE_POINTER_EVENTS;
 ENABLE_POINTER_EVENTS_maccatalyst = ENABLE_POINTER_EVENTS;
 ENABLE_POINTER_EVENTS_macosx = ENABLE_POINTER_EVENTS;
 ENABLE_POINTER_EVENTS_watchos = ENABLE_POINTER_EVENTS;
index fd3f5d6..fa2df85 100644 (file)
@@ -1287,28 +1287,22 @@ typedef NS_ENUM(NSInteger, EndEditingReason) {
 #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>
     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
 }
 
 - (WTF::Optional<unsigned>)activeTouchIdentifierForGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer
 {
-#if HAVE(UI_WEB_TOUCH_EVENTS_GESTURE_RECOGNIZER_WITH_ACTIVE_TOUCHES_BY_ID)
-    // FIXME: <rdar://problem/48035706>
     NSMapTable<NSNumber *, UITouch *> *activeTouches = [_touchEventGestureRecognizer activeTouchesByIdentifier];
     for (NSNumber *touchIdentifier in activeTouches) {
         UITouch *touch = [activeTouches objectForKey:touchIdentifier];
         if ([touch.gestureRecognizers containsObject:gestureRecognizer])
             return [touchIdentifier unsignedIntValue];
     }
-#endif
     return WTF::nullopt;
 }
 #endif
@@ -1399,12 +1393,10 @@ inline static UIKeyModifierFlags gestureRecognizerModifierFlags(UIGestureRecogni
     return gestureRecognizer == [_webView scrollView].pinchGestureRecognizer;
 }
 
-#if HAVE(UI_WEB_TOUCH_EVENTS_GESTURE_RECOGNIZER_WITH_ACTIVE_TOUCHES_BY_ID)
 - (NSMapTable<NSNumber *, UITouch *> *)touchActionActiveTouches
 {
     return [_touchEventGestureRecognizer activeTouchesByIdentifier];
 }
-#endif
 
 - (void)_resetPanningPreventionFlags
 {
index 3c66527..65e4c36 100644 (file)
@@ -78,7 +78,7 @@
 - (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
 {
     [super touchesEnded:touches withEvent:event];
-#if ENABLE(POINTER_EVENTS) && HAVE(UI_WEB_TOUCH_EVENTS_GESTURE_RECOGNIZER_WITH_ACTIVE_TOUCHES_BY_ID)
+#if ENABLE(POINTER_EVENTS)
     if (!_supportingWebTouchEventsGestureRecognizer)
         return;
 
index 7ce04da..4afa34b 100644 (file)
@@ -39,9 +39,7 @@
 
 @protocol WKTouchActionGestureRecognizerDelegate <NSObject>
 - (BOOL)gestureRecognizerMayPinchToZoomWebView:(UIGestureRecognizer *)gestureRecognizer;
-#if HAVE(UI_WEB_TOUCH_EVENTS_GESTURE_RECOGNIZER_WITH_ACTIVE_TOUCHES_BY_ID)
 - (NSMapTable<NSNumber *, UITouch *> *)touchActionActiveTouches;
-#endif
 @end
 
 #endif
index 0f6b934..835fc65 100644 (file)
@@ -86,7 +86,6 @@
     return NO;
 }
 
-#if HAVE(UI_WEB_TOUCH_EVENTS_GESTURE_RECOGNIZER_WITH_ACTIVE_TOUCHES_BY_ID)
 - (BOOL)canPreventGestureRecognizer:(UIGestureRecognizer *)preventedGestureRecognizer
 {
     if (_touchActionsByTouchIdentifier.isEmpty())
 
     return NO;
 }
-#endif
 
 @end
 
index 0797db0..37026d1 100644 (file)
@@ -1,3 +1,13 @@
+2019-07-08  Antoine Quint  <graouts@apple.com>
+
+        [Pointer Events] Enable only on the most recent version of the supported iOS family
+        https://bugs.webkit.org/show_bug.cgi?id=199562
+        <rdar://problem/52766511>
+
+        Reviewed by Dean Jackson.
+
+        * Configurations/FeatureDefines.xcconfig:
+
 2019-07-03  Sam Weinig  <weinig@apple.com>
 
         Adopt simple structured bindings in more places
index 13ed2c0..fccba80 100644 (file)
@@ -316,8 +316,9 @@ ENABLE_PDFKIT_PLUGIN = $(ENABLE_PDFKIT_PLUGIN_$(WK_PLATFORM_NAME));
 ENABLE_PDFKIT_PLUGIN_macosx = ENABLE_PDFKIT_PLUGIN;
 
 ENABLE_POINTER_EVENTS = $(ENABLE_POINTER_EVENTS_$(WK_PLATFORM_NAME));
-ENABLE_POINTER_EVENTS_iphoneos = ENABLE_POINTER_EVENTS;
-ENABLE_POINTER_EVENTS_iphonesimulator = ENABLE_POINTER_EVENTS;
+ENABLE_POINTER_EVENTS_iphoneos = $(ENABLE_POINTER_EVENTS$(WK_IOS_13));
+ENABLE_POINTER_EVENTS_iphonesimulator = $(ENABLE_POINTER_EVENTS$(WK_IOS_13));
+ENABLE_POINTER_EVENTS_IOS_SINCE_13 = ENABLE_POINTER_EVENTS;
 ENABLE_POINTER_EVENTS_maccatalyst = ENABLE_POINTER_EVENTS;
 ENABLE_POINTER_EVENTS_macosx = ENABLE_POINTER_EVENTS;
 ENABLE_POINTER_EVENTS_watchos = ENABLE_POINTER_EVENTS;
index 822e3ef..64f079d 100644 (file)
@@ -1,3 +1,13 @@
+2019-07-08  Antoine Quint  <graouts@apple.com>
+
+        [Pointer Events] Enable only on the most recent version of the supported iOS family
+        https://bugs.webkit.org/show_bug.cgi?id=199562
+        <rdar://problem/52766511>
+
+        Reviewed by Dean Jackson.
+
+        * TestWebKitAPI/Configurations/FeatureDefines.xcconfig:
+
 2019-07-06  Simon Fraser  <simon.fraser@apple.com>
 
         Long hang when loading a cnn.com page on iOS
index 13ed2c0..fccba80 100644 (file)
@@ -316,8 +316,9 @@ ENABLE_PDFKIT_PLUGIN = $(ENABLE_PDFKIT_PLUGIN_$(WK_PLATFORM_NAME));
 ENABLE_PDFKIT_PLUGIN_macosx = ENABLE_PDFKIT_PLUGIN;
 
 ENABLE_POINTER_EVENTS = $(ENABLE_POINTER_EVENTS_$(WK_PLATFORM_NAME));
-ENABLE_POINTER_EVENTS_iphoneos = ENABLE_POINTER_EVENTS;
-ENABLE_POINTER_EVENTS_iphonesimulator = ENABLE_POINTER_EVENTS;
+ENABLE_POINTER_EVENTS_iphoneos = $(ENABLE_POINTER_EVENTS$(WK_IOS_13));
+ENABLE_POINTER_EVENTS_iphonesimulator = $(ENABLE_POINTER_EVENTS$(WK_IOS_13));
+ENABLE_POINTER_EVENTS_IOS_SINCE_13 = ENABLE_POINTER_EVENTS;
 ENABLE_POINTER_EVENTS_maccatalyst = ENABLE_POINTER_EVENTS;
 ENABLE_POINTER_EVENTS_macosx = ENABLE_POINTER_EVENTS;
 ENABLE_POINTER_EVENTS_watchos = ENABLE_POINTER_EVENTS;