Title: [211920] branches/safari-604.1.5-branch/Source/WebKit2
Revision
211920
Author
matthew_han...@apple.com
Date
2017-02-08 18:05:54 -0800 (Wed, 08 Feb 2017)

Log Message

Merge r211643. rdar://problem/30334861

Modified Paths

Diff

Modified: branches/safari-604.1.5-branch/Source/WebKit2/ChangeLog (211919 => 211920)


--- branches/safari-604.1.5-branch/Source/WebKit2/ChangeLog	2017-02-09 02:05:51 UTC (rev 211919)
+++ branches/safari-604.1.5-branch/Source/WebKit2/ChangeLog	2017-02-09 02:05:54 UTC (rev 211920)
@@ -1,5 +1,28 @@
 2017-02-08  Matthew Hanson  <matt_han...@apple.com>
 
+        Merge r211643. rdar://problem/30334861
+
+    2017-02-03  Wenson Hsieh  <wenson_hs...@apple.com>
+
+            WKActionSheet should dismiss with animation when done with the sheet
+            https://bugs.webkit.org/show_bug.cgi?id=167804
+            <rdar://problem/30334861>
+
+            Reviewed by Tim Horton.
+
+            Currently, we do not dismiss the action menu when -doneWithSheet is invoked. While this is okay when the menu is
+            dismissed via tap (since it will be dismissed as default behavior by the popover controller) we need to manually
+            dismiss it if we are trying to programmatically dismiss the action sheet/menu.
+
+            * UIProcess/ios/WKActionSheet.mm:
+            (-[WKActionSheet presentSheetFromRect:]):
+            (-[WKActionSheet doneWithSheet]):
+            * UIProcess/ios/WKContentViewInteraction.mm:
+            (-[WKContentView setupInteraction]):
+            (-[WKContentView resignFirstResponder]):
+
+2017-02-08  Matthew Hanson  <matt_han...@apple.com>
+
         Merge r211597. rdar://problem/30295261
 
     2017-02-02  Wenson Hsieh  <wenson_hs...@apple.com>

Modified: branches/safari-604.1.5-branch/Source/WebKit2/UIProcess/ios/WKActionSheet.mm (211919 => 211920)


--- branches/safari-604.1.5-branch/Source/WebKit2/UIProcess/ios/WKActionSheet.mm	2017-02-09 02:05:51 UTC (rev 211919)
+++ branches/safari-604.1.5-branch/Source/WebKit2/UIProcess/ios/WKActionSheet.mm	2017-02-09 02:05:54 UTC (rev 211920)
@@ -37,6 +37,7 @@
     BOOL _isRotating;
     BOOL _readyToPresentAfterRotation;
 
+    RetainPtr<UIViewController> _currentPresentingViewController;
     RetainPtr<UIViewController> _presentedViewControllerWhileRotating;
     RetainPtr<id <UIPopoverPresentationControllerDelegate>> _popoverPresentationControllerDelegateWhileRotating;
 }
@@ -99,8 +100,8 @@
     if (_popoverPresentationControllerDelegateWhileRotating)
         presentationController.delegate = _popoverPresentationControllerDelegateWhileRotating.get();
 
-    UIViewController *presentingViewController = [UIViewController _viewControllerForFullScreenPresentationFromView:view];
-    [presentingViewController presentViewController:presentedViewController animated:YES completion:NULL];
+    _currentPresentingViewController = [UIViewController _viewControllerForFullScreenPresentationFromView:view];
+    [_currentPresentingViewController presentViewController:presentedViewController animated:YES completion:nil];
 
     return YES;
 }
@@ -107,6 +108,10 @@
 
 - (void)doneWithSheet
 {
+    if (_currentPresentingViewController)
+        [_currentPresentingViewController dismissViewControllerAnimated:YES completion:nil];
+
+    _currentPresentingViewController = nil;
     _presentedViewControllerWhileRotating = nil;
     _popoverPresentationControllerDelegateWhileRotating = nil;
 

Modified: branches/safari-604.1.5-branch/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (211919 => 211920)


--- branches/safari-604.1.5-branch/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm	2017-02-09 02:05:51 UTC (rev 211919)
+++ branches/safari-604.1.5-branch/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm	2017-02-09 02:05:54 UTC (rev 211920)
@@ -580,7 +580,7 @@
 
 #if ENABLE(DATA_INTERACTION)
     _dataInteractionGestureRecognizer = adoptNS([[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(_dataInteractionGestureRecognizer:)]);
-    [_dataInteractionGestureRecognizer setDelay:0.25];
+    [_dataInteractionGestureRecognizer setDelay:0.5];
     [_dataInteractionGestureRecognizer setDelegate:self];
     [_dataInteractionGestureRecognizer _setRequiresQuietImpulse:YES];
     [self addGestureRecognizer:_dataInteractionGestureRecognizer.get()];
@@ -848,9 +848,6 @@
 
 - (BOOL)resignFirstResponder
 {
-#if ENABLE(DATA_INTERACTION)
-    _dataInteractionState.shouldHandleLongPressAction = NO;
-#endif
     // FIXME: Maybe we should call resignFirstResponder on the superclass
     // and do nothing if the return value is NO.
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to