[iOS] Link previews sometimes don't hide the link highlight
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Aug 2015 20:23:36 +0000 (20:23 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Aug 2015 20:23:36 +0000 (20:23 +0000)
https://bugs.webkit.org/show_bug.cgi?id=147585
<rdar://problem/22119648>

Reviewed by Beth Dakin.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _interactionStartedFromPreviewItemController:]):
(-[WKContentView _interactionStoppedFromPreviewItemController:]):
(-[WKContentView _previewItemController:didDismissPreview:committing:]):
(-[WKContentView _previewItemController:willPresentPreview:forPosition:inSourceView:]): Deleted.
Use interactionStarted/Stopped, which are always called, instead of didDismiss/willPresent,
which are only called if we return a custom view controller from _presentedViewControllerForPreviewItemController.
We continue using didDismiss to inform clients of dismissal because they'll
only care if they customized the view controller.

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

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

index 294df17..8de2274 100644 (file)
@@ -1,3 +1,21 @@
+2015-08-03  Tim Horton  <timothy_horton@apple.com>
+
+        [iOS] Link previews sometimes don't hide the link highlight
+        https://bugs.webkit.org/show_bug.cgi?id=147585
+        <rdar://problem/22119648>
+
+        Reviewed by Beth Dakin.
+
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView _interactionStartedFromPreviewItemController:]):
+        (-[WKContentView _interactionStoppedFromPreviewItemController:]):
+        (-[WKContentView _previewItemController:didDismissPreview:committing:]):
+        (-[WKContentView _previewItemController:willPresentPreview:forPosition:inSourceView:]): Deleted.
+        Use interactionStarted/Stopped, which are always called, instead of didDismiss/willPresent,
+        which are only called if we return a custom view controller from _presentedViewControllerForPreviewItemController.
+        We continue using didDismiss to inform clients of dismissal because they'll
+        only care if they customized the view controller.
+
 2015-08-03  Chris Dumez  <cdumez@apple.com>
 
         [WK2][NetworkCache] Do not munmap() on the main thread
index d2b013f..f2bfbfb 100644 (file)
@@ -3361,18 +3361,22 @@ static bool isAssistableInputType(InputType type)
 
 }
 
-- (void)_previewItemController:(UIPreviewItemController *)controller willPresentPreview:(UIViewController *)viewController forPosition:(CGPoint)position inSourceView:(UIView *)sourceView
+- (void)_interactionStartedFromPreviewItemController:(UIPreviewItemController *)controller
 {
     [self _removeDefaultGestureRecognizers];
 
     [self _cancelInteraction];
 }
 
-- (void)_previewItemController:(UIPreviewItemController *)controller didDismissPreview:(UIViewController *)viewController committing:(BOOL)committing
+- (void)_interactionStoppedFromPreviewItemController:(UIPreviewItemController *)controller
 {
     [self _addDefaultGestureRecognizers];
+
     _page->stopInteraction();
+}
 
+- (void)_previewItemController:(UIPreviewItemController *)controller didDismissPreview:(UIViewController *)viewController committing:(BOOL)committing
+{
     id<WKUIDelegatePrivate> uiDelegate = static_cast<id <WKUIDelegatePrivate>>([_webView UIDelegate]);
     if ([uiDelegate respondsToSelector:@selector(_webView:didDismissPreviewViewController:committing:)])
         [uiDelegate _webView:_webView didDismissPreviewViewController:viewController committing:committing];