Skip to content
Permalink
Browse files
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]):


Canonical link: https://commits.webkit.org/184846@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211643 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
whsieh committed Feb 3, 2017
1 parent 44b2001 commit edeb628d16c5e052909126af4dafe380181f6c78
Showing with 27 additions and 6 deletions.
  1. +19 −0 Source/WebKit2/ChangeLog
  2. +7 −2 Source/WebKit2/UIProcess/ios/WKActionSheet.mm
  3. +1 −4 Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
@@ -1,3 +1,22 @@
2017-02-03 Wenson Hsieh <wenson_hsieh@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-03 Olivier Blin <olivier.blin@softathome.com>

Doc generation failure in WebKitSecurityOrigin
@@ -37,6 +37,7 @@ @implementation WKActionSheet {
BOOL _isRotating;
BOOL _readyToPresentAfterRotation;

RetainPtr<UIViewController> _currentPresentingViewController;
RetainPtr<UIViewController> _presentedViewControllerWhileRotating;
RetainPtr<id <UIPopoverPresentationControllerDelegate>> _popoverPresentationControllerDelegateWhileRotating;
}
@@ -99,14 +100,18 @@ - (BOOL)presentSheetFromRect:(CGRect)presentationRect
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;
}

- (void)doneWithSheet
{
if (_currentPresentingViewController)
[_currentPresentingViewController dismissViewControllerAnimated:YES completion:nil];

_currentPresentingViewController = nil;
_presentedViewControllerWhileRotating = nil;
_popoverPresentationControllerDelegateWhileRotating = nil;

@@ -582,7 +582,7 @@ - (void)setupInteraction

#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()];
@@ -850,9 +850,6 @@ - (BOOL)becomeFirstResponder

- (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.

0 comments on commit edeb628

Please sign in to comment.