Data Detectors popovers should be dismissed upon scrolling
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Nov 2014 19:17:11 +0000 (19:17 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Nov 2014 19:17:11 +0000 (19:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=138600
<rdar://problem/18932770>

Reviewed by Beth Dakin.

* platform/spi/mac/DataDetectorsSPI.h:
Adjust the SPI header.

* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController prepareForMenu:withEvent:]):
Dismiss popovers when we start preparing another menu.

(-[WKActionMenuController dismissActionMenuPopovers]):
Use the new DataDetectors SPI.

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

Source/WebCore/ChangeLog
Source/WebCore/platform/spi/mac/DataDetectorsSPI.h
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/mac/WKActionMenuController.mm

index 5d64af5a9cca157df80bff822611539dae204a72..dc47e8c651711b52a685d950f66a0078a8b3f26d 100644 (file)
@@ -1,3 +1,14 @@
+2014-11-11  Tim Horton  <timothy_horton@apple.com>
+
+        Data Detectors popovers should be dismissed upon scrolling
+        https://bugs.webkit.org/show_bug.cgi?id=138600
+        <rdar://problem/18932770>
+
+        Reviewed by Beth Dakin.
+
+        * platform/spi/mac/DataDetectorsSPI.h:
+        Adjust the SPI header.
+
 2014-11-11  Tim Horton  <timothy_horton@apple.com>
 
         Localize strings for action menus
index 9b330dd8d72b2a36bfec1e451231810b96d4cf49..2c7f553cf2b6bd6e83ad61a65b3e789f8c5a6f81 100644 (file)
@@ -74,6 +74,6 @@ SOFT_LINK_CLASS(DataDetectors, DDActionsManager)
 
 + (DDActionsManager *)sharedManager;
 - (NSArray *)menuItemsForResult:(DDResultRef)result actionContext:(DDActionContext *)context;
-- (void)unanchorBubbles;
+- (void)requestBubbleClosureUnanchorOnFailure:(BOOL)unanchorOnFailure;
 
 @end
index ce61ee05c9a2cad1d37029c111aaebde4288bc1c..cc541031818e8f36793c1f4e120129fd45f589af 100644 (file)
@@ -1,3 +1,18 @@
+2014-11-11  Tim Horton  <timothy_horton@apple.com>
+
+        Data Detectors popovers should be dismissed upon scrolling
+        https://bugs.webkit.org/show_bug.cgi?id=138600
+        <rdar://problem/18932770>
+
+        Reviewed by Beth Dakin.
+
+        * UIProcess/mac/WKActionMenuController.mm:
+        (-[WKActionMenuController prepareForMenu:withEvent:]):
+        Dismiss popovers when we start preparing another menu.
+
+        (-[WKActionMenuController dismissActionMenuPopovers]):
+        Use the new DataDetectors SPI.
+
 2014-11-11  Tim Horton  <timothy_horton@apple.com>
 
         Localize strings for action menus
index fcd253b3a3935f773f3090055bc6954eae167ecb..b0fb9ed42567b7067c5ee38818e44618f86c3c1f 100644 (file)
@@ -176,12 +176,13 @@ using namespace WebKit;
         return;
     }
 
+    [self dismissActionMenuPopovers];
+
     _page->performActionMenuHitTestAtLocation([_wkView convertPoint:event.locationInWindow fromView:nil]);
 
     _state = ActionMenuState::Pending;
     [self _updateActionMenuItemsForStage:MenuUpdateStage::PrepareForMenu];
 
-    [self _hideTextIndicator];
     _shouldKeepPreviewPopoverOpen = NO;
 }
 
@@ -243,9 +244,7 @@ using namespace WebKit;
 
 - (void)dismissActionMenuPopovers
 {
-    // Ideally, this would actually dismiss the data detector popovers. We don't currently have the ability to request
-    // that and know whether or not it succeeded, so we'll settle for unanchoring.
-    [[getDDActionsManagerClass() sharedManager] unanchorBubbles];
+    [[getDDActionsManagerClass() sharedManager] requestBubbleClosureUnanchorOnFailure:YES];
 
     [self _hideTextIndicator];
     [self _clearPreviewPopover];