macCatalyst: Swipe navigation gestures do not work
https://bugs.webkit.org/show_bug.cgi?id=203205
<rdar://problem/54617473>
Reviewed by Wenson Hsieh.
Source/WebKit:
* UIProcess/ios/ViewGestureControllerIOS.mm:
(-[WKSwipeTransitionController gestureRecognizerForInteractiveTransition:WithTarget:action:]):
Use a different gesture recognizer for swipe in macCatalyst that behaves
more like the macOS implementation, based on scrolling instead of the
gesture coming from a screen edge.
Source/WTF:
* wtf/Platform.h:
Add a new HAVE.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@251382 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog
index b908abe..10252f0 100644
--- a/Source/WTF/ChangeLog
+++ b/Source/WTF/ChangeLog
@@ -1,3 +1,14 @@
+2019-10-21 Tim Horton <timothy_horton@apple.com>
+
+ macCatalyst: Swipe navigation gestures do not work
+ https://bugs.webkit.org/show_bug.cgi?id=203205
+ <rdar://problem/54617473>
+
+ Reviewed by Wenson Hsieh.
+
+ * wtf/Platform.h:
+ Add a new HAVE.
+
2019-10-20 Mark Lam <mark.lam@apple.com>
Remove all uses of untagCodePtr in debugging code.
diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h
index 05a3c09..053ee95 100644
--- a/Source/WTF/wtf/Platform.h
+++ b/Source/WTF/wtf/Platform.h
@@ -1561,6 +1561,7 @@
#if PLATFORM(MACCATALYST)
#define ENABLE_PLATFORM_DRIVEN_TEXT_CHECKING 1
#define HAVE_HOVER_GESTURE_RECOGNIZER 1
+#define HAVE_UI_PARALLAX_TRANSITION_GESTURE_RECOGNIZER 1
#endif
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || PLATFORM(IOS_FAMILY)
diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog
index 66ea6db..a0e9646 100644
--- a/Source/WebKit/ChangeLog
+++ b/Source/WebKit/ChangeLog
@@ -1,3 +1,17 @@
+2019-10-21 Tim Horton <timothy_horton@apple.com>
+
+ macCatalyst: Swipe navigation gestures do not work
+ https://bugs.webkit.org/show_bug.cgi?id=203205
+ <rdar://problem/54617473>
+
+ Reviewed by Wenson Hsieh.
+
+ * UIProcess/ios/ViewGestureControllerIOS.mm:
+ (-[WKSwipeTransitionController gestureRecognizerForInteractiveTransition:WithTarget:action:]):
+ Use a different gesture recognizer for swipe in macCatalyst that behaves
+ more like the macOS implementation, based on scrolling instead of the
+ gesture coming from a screen edge.
+
2019-10-21 Daniel Bates <dabates@apple.com>
Add some PencilKit extension points
diff --git a/Source/WebKit/UIProcess/ios/ViewGestureControllerIOS.mm b/Source/WebKit/UIProcess/ios/ViewGestureControllerIOS.mm
index e4f757c..6e268a8 100644
--- a/Source/WebKit/UIProcess/ios/ViewGestureControllerIOS.mm
+++ b/Source/WebKit/UIProcess/ios/ViewGestureControllerIOS.mm
@@ -121,8 +121,13 @@
- (UIPanGestureRecognizer *)gestureRecognizerForInteractiveTransition:(_UINavigationInteractiveTransitionBase *)transition WithTarget:(id)target action:(SEL)action
{
+#if HAVE(UI_PARALLAX_TRANSITION_GESTURE_RECOGNIZER)
+ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN
+ _UIParallaxTransitionPanGestureRecognizer *recognizer = [[_UIParallaxTransitionPanGestureRecognizer alloc] initWithTarget:target action:action];
+ALLOW_NEW_API_WITHOUT_GUARDS_END
+#else
UIScreenEdgePanGestureRecognizer *recognizer = [[UIScreenEdgePanGestureRecognizer alloc] initWithTarget:target action:action];
-
+#endif
bool isLTR = [UIView userInterfaceLayoutDirectionForSemanticContentAttribute:[_gestureRecognizerView.get() semanticContentAttribute]] == UIUserInterfaceLayoutDirectionLeftToRight;
switch ([self directionForTransition:transition]) {