REGRESSION (r176351): Parts of apple.com/contact aren't Lookup-able
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Nov 2014 20:28:15 +0000 (20:28 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Nov 2014 20:28:15 +0000 (20:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=138960
<rdar://problem/19056715>

Reviewed by Beth Dakin.

* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
* WebView/WebActionMenuController.mm:
(-[WebActionMenuController _defaultMenuItemsForDataDetectedText]):
Blacklist contact results, because they don't have useful menus. If we
bail before setting up _currentActionContext, we'll still allow fallthrough
to ordinary text actions, avoiding mysterious failure when a contact is detected.

This doesn't break the case that r176351 was intended to fix,
because in that case we were detecting e.g. addresses.

* platform/spi/mac/DataDetectorsSPI.h:
Softlink some SPI.

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

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

index 1d8048408bd41cf301b2ca1fd98e3ed304df6ce9..ddd7b895a2bc78d455e355520ebdd405af679431 100644 (file)
@@ -1,3 +1,14 @@
+2014-11-21  Tim Horton  <timothy_horton@apple.com>
+
+        REGRESSION (r176351): Parts of apple.com/contact aren't Lookup-able
+        https://bugs.webkit.org/show_bug.cgi?id=138960
+        <rdar://problem/19056715>
+
+        Reviewed by Beth Dakin.
+
+        * platform/spi/mac/DataDetectorsSPI.h:
+        Softlink some SPI.
+
 2014-11-21  Tim Horton  <timothy_horton@apple.com>
 
         Move TextIndicator{Window} to WebCore
index 3f11b8557f6742daf2cc3be9e8f661868315a479..c7dceb8c1db988bd141aaf25a5a5d5b7e33fe722 100644 (file)
@@ -55,6 +55,7 @@ SOFT_LINK(DataDetectorsCore, DDScanQueryCreateFromString, DDScanQueryRef, (CFAll
 SOFT_LINK(DataDetectorsCore, DDScannerScanQuery, DDScanQueryRef, (DDScannerRef scanner, DDScanQueryRef query), (scanner, query))
 SOFT_LINK(DataDetectorsCore, DDScannerCopyResultsWithOptions, CFArrayRef, (DDScannerRef scanner, DDScannerCopyResultsOptions options), (scanner, options))
 SOFT_LINK(DataDetectorsCore, DDResultGetRange, CFRange, (DDResultRef result), (result))
+SOFT_LINK(DataDetectorsCore, DDResultGetType, CFStringRef, (DDResultRef result), (result))
 
 }
 
index 77632fb1f2c27dff5341504a5aca2299f639ee7a..f201e01f424bb22e36c58a73f6e525327caf8aee 100644 (file)
@@ -1,3 +1,20 @@
+2014-11-21  Tim Horton  <timothy_horton@apple.com>
+
+        REGRESSION (r176351): Parts of apple.com/contact aren't Lookup-able
+        https://bugs.webkit.org/show_bug.cgi?id=138960
+        <rdar://problem/19056715>
+
+        Reviewed by Beth Dakin.
+
+        * WebView/WebActionMenuController.mm:
+        (-[WebActionMenuController _defaultMenuItemsForDataDetectedText]):
+        Blacklist contact results, because they don't have useful menus. If we
+        bail before setting up _currentActionContext, we'll still allow fallthrough
+        to ordinary text actions, avoiding mysterious failure when a contact is detected.
+
+        This doesn't break the case that r176351 was intended to fix,
+        because in that case we were detecting e.g. addresses.
+
 2014-11-21  Anders Carlsson  <andersca@apple.com>
 
         Remove the Timer parameters from timer callbacks
index d1534d89d2407d5d06b56cb5e0daa5d106d79a8d..63cad4ee974c0dd82798dec2c529459b44405db9 100644 (file)
@@ -572,6 +572,13 @@ static NSString *pathToPhotoOnDisk(NSString *suggestedFilename)
     if (!actionContext || !detectedDataRange)
         return @[ ];
 
+    // Blacklist contact results, because they don't have useful menus. If we
+    // bail here, before setting up _currentActionContext, we'll still allow fallthrough
+    // to ordinary text actions, avoiding mysterious failure when a contact is detected.
+    if (CFEqual(DDResultGetType([actionContext mainResult]), CFSTR("Contact")))
+        return @[ ];
+
+
     // FIXME: We should hide/show the yellow highlight here.
     _currentActionContext = [actionContext contextForView:_webView altMode:YES interactionStartedHandler:^() {
     } interactionChangedHandler:^() {
index 3a3ed05e458edd1bc2170f2bf747f06d52f6a960..b55ebb879bd6a28f4bcb83eea021f7d89d3597f0 100644 (file)
@@ -1,3 +1,20 @@
+2014-11-21  Tim Horton  <timothy_horton@apple.com>
+
+        REGRESSION (r176351): Parts of apple.com/contact aren't Lookup-able
+        https://bugs.webkit.org/show_bug.cgi?id=138960
+        <rdar://problem/19056715>
+
+        Reviewed by Beth Dakin.
+
+        * UIProcess/mac/WKActionMenuController.mm:
+        (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
+        Blacklist contact results, because they don't have useful menus. If we
+        bail before setting up _currentActionContext, we'll still allow fallthrough
+        to ordinary text actions, avoiding mysterious failure when a contact is detected.
+
+        This doesn't break the case that r176351 was intended to fix,
+        because in that case we were detecting e.g. addresses.
+
 2014-11-21  Tim Horton  <timothy_horton@apple.com>
 
         Move TextIndicator{Window} to WebCore
index ecbe7f5dc9b17b4bb41734f7ff67275f1cefd614..1192280d48cbd38ca1785bac21f459d5ed6fbb7d 100644 (file)
@@ -635,6 +635,12 @@ static NSString *pathToPhotoOnDisk(NSString *suggestedFilename)
     if (!actionContext)
         return @[ ];
 
+    // Blacklist contact results, because they don't have useful menus. If we
+    // bail here, before setting up _currentActionContext, we'll still allow fallthrough
+    // to ordinary text actions, avoiding mysterious failure when a contact is detected.
+    if (CFEqual(DDResultGetType(actionContext.mainResult), CFSTR("Contact")))
+        return @[ ];
+
     // Ref our WebPageProxy for use in the blocks below.
     RefPtr<WebPageProxy> page = _page;
     PageOverlay::PageOverlayID overlayID = _hitTestResult.detectedDataOriginatingPageOverlay;