Preview should not start if touch handler prevents default.
authorenrica@apple.com <enrica@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Jul 2015 23:03:25 +0000 (23:03 +0000)
committerenrica@apple.com <enrica@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Jul 2015 23:03:25 +0000 (23:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=147423
rdar://problem/22061043

Reviewed by Tim Horton.

We need to check if _highlightLongPressCanClick has not been reset before
we allow the preview. It can be reset by a touch handler preventing default.

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

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm

index ea7d811..1ef307f 100644 (file)
@@ -1,3 +1,17 @@
+2015-07-29  Enrica Casucci  <enrica@apple.com>
+
+        Preview should not start if touch handler prevents default.
+        https://bugs.webkit.org/show_bug.cgi?id=147423
+        rdar://problem/22061043
+
+        Reviewed by Tim Horton.
+
+        We need to check if _highlightLongPressCanClick has not been reset before
+        we allow the preview. It can be reset by a touch handler preventing default.
+
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
+
 2015-07-29  Chris Fleizach  <cfleizach@apple.com>
 
         AX: iOS: VoiceOver hangs indefinitely when an JS alert appears
index 47d7817..d2b013f 100644 (file)
@@ -3225,6 +3225,9 @@ static bool isAssistableInputType(InputType type)
 
 - (BOOL)_interactionShouldBeginFromPreviewItemController:(UIPreviewItemController *)controller forPosition:(CGPoint)position
 {
+    if (!_highlightLongPressCanClick)
+        return NO;
+
     [self ensurePositionInformationIsUpToDate:position];
     if (_positionInformation.clickableElementName != "A" && _positionInformation.clickableElementName != "IMG")
         return NO;