Title: [188296] branches/safari-601.1.46-branch/Source/WebKit2

Diff

Modified: branches/safari-601.1.46-branch/Source/WebKit2/ChangeLog (188295 => 188296)


--- branches/safari-601.1.46-branch/Source/WebKit2/ChangeLog	2015-08-11 21:19:42 UTC (rev 188295)
+++ branches/safari-601.1.46-branch/Source/WebKit2/ChangeLog	2015-08-11 21:26:08 UTC (rev 188296)
@@ -1,3 +1,38 @@
+2015-08-11  Matthew Hanson  <[email protected]>
+
+        Merge r188285. rdar://problem/22206433
+
+    2015-08-11  Beth Dakin  <[email protected]>
+
+            REGRESSION (r188053): Sometimes unable to save an image from Google Search/
+            imgur via long press
+            https://bugs.webkit.org/show_bug.cgi?id=147896
+
+            Reviewed by Enrica Casucci.
+
+            http://trac.webkit.org/changeset/188053 added code to call cleanupSheet when
+            the long press gesture is cancelled. However, the gesture will be called with
+            the cancelled state when then user taps an item in the action sheet (such as
+            “save image”), and sometimes the “cancel” comes in before the image has been
+            saved. That is a problem because we need to avoid cleaning up the sheet until
+            after the image is saved. Before that patch, we never cleaned up the sheet on
+            cancel, so this patch goes back to that behavior. We also have to remove some
+            assertions that assume that everything will be totally cleaned up when a new
+            sheet is created, but that is not necessarily true due to interactions
+            between the preview gesture and the long press gesture.
+
+            Remove assertions.
+            * UIProcess/ios/WKActionSheetAssistant.mm:
+            (-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]):
+            (-[WKActionSheetAssistant showImageSheet]):
+            (-[WKActionSheetAssistant showLinkSheet]):
+            (-[WKActionSheetAssistant showDataDetectorsSheet]):
+
+            Revert the part of Enrica’s patch that called cleanupSheet when the gesture
+            is cancelled.
+            * UIProcess/ios/WKContentViewInteraction.mm:
+            (-[WKContentView _longPressRecognized:]):
+
 2015-08-10  Babak Shafiei  <[email protected]>
 
         Merge r188223.

Modified: branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm (188295 => 188296)


--- branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm	2015-08-11 21:19:42 UTC (rev 188295)
+++ branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm	2015-08-11 21:26:08 UTC (rev 188296)
@@ -206,7 +206,6 @@
 
 - (void)_createSheetWithElementActions:(NSArray *)actions showLinkTitle:(BOOL)showLinkTitle
 {
-    ASSERT(!_interactionSheet);
     auto delegate = _delegate.get();
     if (!delegate)
         return;
@@ -263,7 +262,6 @@
 
 - (void)showImageSheet
 {
-    ASSERT(!_interactionSheet);
     ASSERT(!_elementInfo);
 
     auto delegate = _delegate.get();
@@ -373,7 +371,6 @@
 
 - (void)showLinkSheet
 {
-    ASSERT(!_interactionSheet);
     ASSERT(!_elementInfo);
 
     auto delegate = _delegate.get();
@@ -406,8 +403,6 @@
 
 - (void)showDataDetectorsSheet
 {
-    ASSERT(!_interactionSheet);
-
     auto delegate = _delegate.get();
     if (!delegate)
         return;

Modified: branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (188295 => 188296)


--- branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm	2015-08-11 21:19:42 UTC (rev 188295)
+++ branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm	2015-08-11 21:26:08 UTC (rev 188296)
@@ -1086,22 +1086,13 @@
 
     _lastInteractionLocation = gestureRecognizer.startPoint;
 
-    switch ([gestureRecognizer state]) {
-    case UIGestureRecognizerStateBegan:
-    {
+    if ([gestureRecognizer state] == UIGestureRecognizerStateBegan) {
         SEL action = "" _actionForLongPress];
         if (action) {
             [self performSelector:action];
             [self _cancelLongPressGestureRecognizer];
         }
     }
-        break;
-    case UIGestureRecognizerStateCancelled:
-        [_actionSheetAssistant cleanupSheet];
-        break;
-    default:
-        break;
-    }
 }
 
 - (void)_singleTapRecognized:(UITapGestureRecognizer *)gestureRecognizer
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to