Scrolling and drawing compete for incoming gestures
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 25 Nov 2018 12:05:02 +0000 (12:05 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 25 Nov 2018 12:05:02 +0000 (12:05 +0000)
https://bugs.webkit.org/show_bug.cgi?id=191940

Reviewed by Wenson Hsieh.

* Platform/spi/ios/PencilKitSPI.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/ios/WKDrawingView.mm:
(-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):
Make scrolling and drawing mutually exclusive if editable images
are enabled.

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

Source/WebKit/ChangeLog
Source/WebKit/Platform/spi/ios/PencilKitSPI.h
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/ios/WKDrawingView.mm

index 5e5325c..bb76b41 100644 (file)
@@ -1,3 +1,18 @@
+2018-11-25  Tim Horton  <timothy_horton@apple.com>
+
+        Scrolling and drawing compete for incoming gestures
+        https://bugs.webkit.org/show_bug.cgi?id=191940
+
+        Reviewed by Wenson Hsieh.
+
+        * Platform/spi/ios/PencilKitSPI.h:
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _initializeWithConfiguration:]):
+        * UIProcess/ios/WKDrawingView.mm:
+        (-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):
+        Make scrolling and drawing mutually exclusive if editable images
+        are enabled.
+
 2018-11-24  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         [Cocoa] Fix a few localizable string descriptions in WebEditCommandProxy.cpp and WebEditorClient.mm
index 8160872..00a1e75 100644 (file)
@@ -32,6 +32,9 @@
 #else
 
 @interface PKCanvasView : UIView
+
+@property (nonatomic, getter=isFingerDrawingEnabled) BOOL fingerDrawingEnabled;
+
 @end
 
 #endif
index bc3022e..aed5bd0 100644 (file)
@@ -666,6 +666,9 @@ static void validate(WKWebViewConfiguration *configuration)
     [_scrollView setInternalDelegate:self];
     [_scrollView setBouncesZoom:YES];
 
+    if ([_configuration _editableImagesEnabled])
+        [_scrollView panGestureRecognizer].allowedTouchTypes = @[ @(UITouchTypeDirect) ];
+
     _avoidsUnsafeArea = YES;
     [self _updateScrollViewInsetAdjustmentBehavior];
 
index 8af4c0b..fb93bd0 100644 (file)
@@ -46,6 +46,7 @@ SOFT_LINK_CLASS(PencilKit, PKCanvasView);
 
     _pencilView = adoptNS([allocPKCanvasViewInstance() initWithFrame:CGRectZero]);
 
+    [_pencilView setFingerDrawingEnabled:NO];
     [_pencilView setUserInteractionEnabled:YES];
     [_pencilView setOpaque:NO];