Tapping and holding a link should have a share option
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Nov 2015 18:24:49 +0000 (18:24 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Nov 2015 18:24:49 +0000 (18:24 +0000)
https://bugs.webkit.org/show_bug.cgi?id=150693

Reviewed by Dan Bernstein.

This is a follow-up to the original change. This change fixes non-ascii URLs.
They should maintain their non-ascii characters when they are shared.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView actionSheetAssistant:shareElementWithURL:rect:]):
* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView actionSheetAssistant:shareElementWithURL:rect:]):

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

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

index 169f6a8bdfa64510fdd9c51c09fb8f0f10de9911..99bd70b11d43a263bfcd82f5591f1abdb71046f9 100644 (file)
@@ -1,3 +1,18 @@
+2015-11-02  Beth Dakin  <bdakin@apple.com>
+
+        Tapping and holding a link should have a share option
+        https://bugs.webkit.org/show_bug.cgi?id=150693
+
+        Reviewed by Dan Bernstein.
+
+        This is a follow-up to the original change. This change fixes non-ascii URLs. 
+        They should maintain their non-ascii characters when they are shared.
+
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView actionSheetAssistant:shareElementWithURL:rect:]):
+        * UIProcess/ios/WKPDFView.mm:
+        (-[WKPDFView actionSheetAssistant:shareElementWithURL:rect:]):
+
 2015-11-02  Youenn Fablet  <youenn.fablet@crf.canon.fr>
 
         Rename JSDOMWrapper.impl to JSDOMWrapper.wrapped
 2015-11-02  Youenn Fablet  <youenn.fablet@crf.canon.fr>
 
         Rename JSDOMWrapper.impl to JSDOMWrapper.wrapped
index 0c8c9a7d488e4bf15751d636903f8b2ba368c2a8..a9eb2c36754a9df6c85ce8c18a57aa63452ff49f 100644 (file)
@@ -69,6 +69,7 @@
 #import <WebCore/Scrollbar.h>
 #import <WebCore/SoftLinking.h>
 #import <WebCore/TextIndicator.h>
 #import <WebCore/Scrollbar.h>
 #import <WebCore/SoftLinking.h>
 #import <WebCore/TextIndicator.h>
+#import <WebCore/WebCoreNSURLExtras.h>
 #import <WebCore/WebEvent.h>
 #import <WebKit/WebSelectionRect.h> // FIXME: WK2 should not include WebKit headers!
 #import <WebKitSystemInterfaceIOS.h>
 #import <WebCore/WebEvent.h>
 #import <WebKit/WebSelectionRect.h> // FIXME: WK2 should not include WebKit headers!
 #import <WebKitSystemInterfaceIOS.h>
@@ -3374,9 +3375,9 @@ static bool isAssistableInputType(InputType type)
 - (void)actionSheetAssistant:(WKActionSheetAssistant *)assistant shareElementWithURL:(NSURL *)url rect:(CGRect)boundingRect
 {
     if (_textSelectionAssistant)
 - (void)actionSheetAssistant:(WKActionSheetAssistant *)assistant shareElementWithURL:(NSURL *)url rect:(CGRect)boundingRect
 {
     if (_textSelectionAssistant)
-        [_textSelectionAssistant showShareSheetFor:url.absoluteString fromRect:boundingRect];
+        [_textSelectionAssistant showShareSheetFor:userVisibleString(url) fromRect:boundingRect];
     else if (_webSelectionAssistant)
     else if (_webSelectionAssistant)
-        [_webSelectionAssistant showShareSheetFor:url.absoluteString fromRect:boundingRect];
+        [_webSelectionAssistant showShareSheetFor:userVisibleString(url) fromRect:boundingRect];
 }
 
 #if HAVE(APP_LINKS)
 }
 
 #if HAVE(APP_LINKS)
index 7144d43b0288199f27b5cf5b5feda3b96bacbfd5..a76bc1784e4dbaca7cc9ff37de99ced75ff75292 100644 (file)
@@ -41,6 +41,7 @@
 #import <MobileCoreServices/UTCoreTypes.h>
 #import <WebCore/FloatRect.h>
 #import <WebCore/LocalizedStrings.h>
 #import <MobileCoreServices/UTCoreTypes.h>
 #import <WebCore/FloatRect.h>
 #import <WebCore/LocalizedStrings.h>
+#import <WebCore/WebCoreNSURLExtras.h>
 #import <wtf/RetainPtr.h>
 #import <wtf/Vector.h>
 
 #import <wtf/RetainPtr.h>
 #import <wtf/Vector.h>
 
@@ -723,7 +724,7 @@ static NSStringCompareOptions stringCompareOptions(_WKFindOptions options)
 - (void)actionSheetAssistant:(WKActionSheetAssistant *)assistant shareElementWithURL:(NSURL *)url rect:(CGRect)boundingRect
 {
     _webSelectionAssistant = adoptNS([[UIWKSelectionAssistant alloc] initWithView:self]);
 - (void)actionSheetAssistant:(WKActionSheetAssistant *)assistant shareElementWithURL:(NSURL *)url rect:(CGRect)boundingRect
 {
     _webSelectionAssistant = adoptNS([[UIWKSelectionAssistant alloc] initWithView:self]);
-    [_webSelectionAssistant showShareSheetFor:url.absoluteString fromRect:boundingRect];
+    [_webSelectionAssistant showShareSheetFor:userVisibleString(url) fromRect:boundingRect];
     _webSelectionAssistant = nil;
 }
 
     _webSelectionAssistant = nil;
 }