<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[235489] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/235489">235489</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2018-08-29 17:20:26 -0700 (Wed, 29 Aug 2018)</dd>
</dl>

<h3>Log Message</h3>
<pre>Implement the Web Share API
https://bugs.webkit.org/show_bug.cgi?id=171100
<rdar://problem/31751734>

Patch by Olivia Barnett <obarnett@apple.com> on 2018-08-29
Reviewed by Tim Horton.

LayoutTests/imported/w3c:

* web-platform-tests/web-share/idlharness.https-expected.txt:
* web-platform-tests/web-share/share-empty.https-expected.txt:
* web-platform-tests/web-share/share-securecontext.http-expected.txt:
* web-platform-tests/web-share/share-url-invalid.https-expected.txt:
* web-platform-tests/web-share/share-without-user-gesture.https-expected.txt:
Updated expected results.

Source/WebCore:

Added one test in fast/events/ios called share.html; adjusted expectations for existing tests.

* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* features.json:
* loader/EmptyClients.cpp:
(WebCore::EmptyChromeClient::showShareSheet):
* loader/EmptyClients.h:
Added empty showShareSheet function.

* page/Chrome.cpp:
(WebCore::Chrome::showShareSheet):
* page/Chrome.h:
Added call to showShareSheet on client.

* page/ChromeClient.h:
Virtual showShareSheet function.

* page/Navigator.cpp:
(WebCore::Navigator::share):
* page/Navigator.h:
Share function that returns a promise and invokes the share sheet.

* page/Navigator.idl:
Implements NavigatorShare

* page/NavigatorShare.idl: Added.
Added definition of share function returning a promise.

* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setWebShareEnabled):
(WebCore::RuntimeEnabledFeatures::webShareEnabled const):
Added RuntimeEnabledFeature switch.

* page/ShareData.h: Added.
* page/ShareData.idl: Added.
Definition of ShareData struct.

Source/WebKit:

* Platform/spi/ios/UIKitSPI.h:
Added NSURL _title property as in the WebCore UIKitSPI.

* Scripts/webkit/messages.py:
ShareDataWithParsedURL special case for header for type.

* Shared/ShareSheetCallbackID.h:
Added a typedef for a share sheet callback id.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<ShareData>::encode):
(IPC::ArgumentCoder<ShareData>::decode):
(IPC::ArgumentCoder<ShareDataWithParsedURL>::encode):
(IPC::ArgumentCoder<ShareDataWithParsedURL>::decode):
* Shared/WebCoreArgumentCoders.h:
Added encoding and decoding functionality for new structs.

* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetWebShareEnabled):
(WKPreferencesGetWebShareEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
Added switch for RuntimeEnabledFeature.

* UIProcess/API/Cocoa/WKWebView.mm:
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
Added hook for share sheet testing.

* UIProcess/PageClient.h:
(WebKit::PageClient::showShareSheet):
Page client call to invoke share sheet.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::showShareSheet):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
Web page proxy handling of call to invoke share sheet.
Creates completion handler to send to WKShareSheet.mm
Completion handler sends message to WebPage with message id.

* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::showShareSheet):
Page client implementation call to invoke share sheet.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cleanupInteraction]):
(-[WKContentView _showShareSheet:completionHandler:]):
(-[WKContentView shareSheetDidDismiss:]):
(-[WKContentView invokeShareSheetWithResolution:resolved):
Call to WKShareSheet to invoke the share sheet and callback.
Hook for share sheet resolution testing.

* UIProcess/ios/forms/WKShareSheet.h: Added.
* UIProcess/ios/forms/WKShareSheet.mm: Added.
(-[WKShareSheet initWithView:]):
(-[WKShareSheet presentWithParameters:completionHandler:]):
(-[WKShareSheet _dispatchDidDismiss]):
(-[WKShareSheet _cancel]):
(-[WKShareSheet dismiss]):
(-[WKShareSheet _dismissDisplayAnimated:]):
(-[WKShareSheet _presentFullscreenViewController:animated:]):
(-[WKShareSheet invokeShareSheetWithResolution:resolved:]):
Completion handler call and creation of share sheet with parameters.
Hook that force resolves the share sheet completion handler for testing.

* WebKit.xcodeproj/project.pbxproj:

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::showShareSheet):
Call to page to invoke share sheet.

* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::nextShareSheetContextId):
(WebKit::WebPage::showShareSheet):
(WebKit::WebPage::showShareSheetResponse):
WebPage calls proxy and saves context id for promise.

* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
Callback for completed response.

Source/WebKitLegacy/ios:

* WebCoreSupport/WebChromeClientIOS.h:
* WebCoreSupport/WebChromeClientIOS.mm:
(WebChromeClientIOS::showShareSheet):
Empty declaration of showShareSheet.

Source/WebKitLegacy/mac:

* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::showShareSheet):
Empty declaration of showShareSheet.

LayoutTests:

* fast/dom/navigator-detached-no-crash-expected.txt:
Updated expected results.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastdomnavigatordetachednocrashexpectedtxt">trunk/LayoutTests/fast/dom/navigator-detached-no-crash-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsresourcesuihelperjs">trunk/LayoutTests/resources/ui-helper.js</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcesmake">trunk/Source/WebCore/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebCoreSourcestxt">trunk/Source/WebCore/Sources.txt</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorefeaturesjson">trunk/Source/WebCore/features.json</a></li>
<li><a href="#trunkSourceWebCoreloaderEmptyClientscpp">trunk/Source/WebCore/loader/EmptyClients.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderEmptyClientsh">trunk/Source/WebCore/loader/EmptyClients.h</a></li>
<li><a href="#trunkSourceWebCorepageChromecpp">trunk/Source/WebCore/page/Chrome.cpp</a></li>
<li><a href="#trunkSourceWebCorepageChromeh">trunk/Source/WebCore/page/Chrome.h</a></li>
<li><a href="#trunkSourceWebCorepageChromeClienth">trunk/Source/WebCore/page/ChromeClient.h</a></li>
<li><a href="#trunkSourceWebCorepageNavigatorcpp">trunk/Source/WebCore/page/Navigator.cpp</a></li>
<li><a href="#trunkSourceWebCorepageNavigatorh">trunk/Source/WebCore/page/Navigator.h</a></li>
<li><a href="#trunkSourceWebCorepageNavigatoridl">trunk/Source/WebCore/page/Navigator.idl</a></li>
<li><a href="#trunkSourceWebCorepageRuntimeEnabledFeaturesh">trunk/Source/WebCore/page/RuntimeEnabledFeatures.h</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitPlatformspiiosUIKitSPIh">trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h</a></li>
<li><a href="#trunkSourceWebKitScriptswebkitmessagespy">trunk/Source/WebKit/Scripts/webkit/messages.py</a></li>
<li><a href="#trunkSourceWebKitSharedWebCoreArgumentCoderscpp">trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp</a></li>
<li><a href="#trunkSourceWebKitSharedWebCoreArgumentCodersh">trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h</a></li>
<li><a href="#trunkSourceWebKitSharedWebPreferencesyaml">trunk/Source/WebKit/Shared/WebPreferences.yaml</a></li>
<li><a href="#trunkSourceWebKitSharedWebPreferencesDefaultValuesh">trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPICWKPreferencescpp">trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPICWKPreferencesRefPrivateh">trunk/Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPICocoaWKWebViewmm">trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPICocoaWKWebViewPrivateh">trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessPageClienth">trunk/Source/WebKit/UIProcess/PageClient.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebPageProxycpp">trunk/Source/WebKit/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebPageProxyh">trunk/Source/WebKit/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebPageProxymessagesin">trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKitUIProcessiosPageClientImplIOSh">trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessiosPageClientImplIOSmm">trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessiosWKContentViewInteractionh">trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessiosWKContentViewInteractionmm">trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm</a></li>
<li><a href="#trunkSourceWebKitWebKitxcodeprojprojectpbxproj">trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebCoreSupportWebChromeClientcpp">trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebCoreSupportWebChromeClienth">trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageWebPagecpp">trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageWebPageh">trunk/Source/WebKit/WebProcess/WebPage/WebPage.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageWebPagemessagesin">trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in</a></li>
<li><a href="#trunkSourceWebKitLegacyiosChangeLog">trunk/Source/WebKitLegacy/ios/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitLegacyiosWebCoreSupportWebChromeClientIOSh">trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebChromeClientIOS.h</a></li>
<li><a href="#trunkSourceWebKitLegacyiosWebCoreSupportWebChromeClientIOSmm">trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebChromeClientIOS.mm</a></li>
<li><a href="#trunkSourceWebKitLegacymacChangeLog">trunk/Source/WebKitLegacy/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitLegacymacWebCoreSupportWebChromeClienth">trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h</a></li>
<li><a href="#trunkSourceWebKitLegacymacWebCoreSupportWebChromeClientmm">trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm</a></li>
<li><a href="#trunkToolsDumpRenderTreeiosUIScriptControllerIOSmm">trunk/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm</a></li>
<li><a href="#trunkToolsTestRunnerSharedUIScriptContextBindingsUIScriptControlleridl">trunk/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl</a></li>
<li><a href="#trunkToolsTestRunnerSharedUIScriptContextUIScriptControllercpp">trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp</a></li>
<li><a href="#trunkToolsTestRunnerSharedUIScriptContextUIScriptControllerh">trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h</a></li>
<li><a href="#trunkToolsWebKitTestRunneriosUIScriptControllerIOSmm">trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfasteventsiosshareexpectedtxt">trunk/LayoutTests/fast/events/ios/share-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventsiossharehtml">trunk/LayoutTests/fast/events/ios/share.html</a></li>
<li>trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/web-share/</li>
<li><a href="#trunkLayoutTestsplatformioswk2importedw3cwebplatformtestswebshareidlharnesshttpsexpectedtxt">trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/web-share/idlharness.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformioswk2importedw3cwebplatformtestswebshareshareemptyhttpsexpectedtxt">trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/web-share/share-empty.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformioswk2importedw3cwebplatformtestswebsharesharesecurecontexthttpexpectedtxt">trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/web-share/share-securecontext.http-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformioswk2importedw3cwebplatformtestswebshareshareurlinvalidhttpsexpectedtxt">trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/web-share/share-url-invalid.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformioswk2importedw3cwebplatformtestswebsharesharewithoutusergesturehttpsexpectedtxt">trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/web-share/share-without-user-gesture.https-expected.txt</a></li>
<li><a href="#trunkSourceWebCorepageNavigatorShareidl">trunk/Source/WebCore/page/NavigatorShare.idl</a></li>
<li><a href="#trunkSourceWebCorepageShareDatah">trunk/Source/WebCore/page/ShareData.h</a></li>
<li><a href="#trunkSourceWebCorepageShareDataidl">trunk/Source/WebCore/page/ShareData.idl</a></li>
<li><a href="#trunkSourceWebKitSharedShareSheetCallbackIDh">trunk/Source/WebKit/Shared/ShareSheetCallbackID.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessiosformsWKShareSheeth">trunk/Source/WebKit/UIProcess/ios/forms/WKShareSheet.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessiosformsWKShareSheetmm">trunk/Source/WebKit/UIProcess/ios/forms/WKShareSheet.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/LayoutTests/ChangeLog 2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2018-08-29  Olivia Barnett  <obarnett@apple.com>
+
+        Implement the Web Share API
+        https://bugs.webkit.org/show_bug.cgi?id=171100
+        <rdar://problem/31751734>
+
+        Reviewed by Tim Horton.
+
+        * fast/dom/navigator-detached-no-crash-expected.txt:
+        Updated expected results.
+
</ins><span class="cx"> 2018-08-29  Ryan Haddad  <ryanhaddad@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Layout Test js/error-should-not-strong-reference-global-object.html is flaky on macOS
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomnavigatordetachednocrashexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/navigator-detached-no-crash-expected.txt (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/navigator-detached-no-crash-expected.txt      2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/LayoutTests/fast/dom/navigator-detached-no-crash-expected.txt 2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -1,4 +1,5 @@
</span><span class="cx"> CONSOLE MESSAGE: Unhandled Promise Rejection: TypeError: Not enough arguments
</span><ins>+CONSOLE MESSAGE: Unhandled Promise Rejection: TypeError: Not enough arguments
</ins><span class="cx"> This tests that the navigator object of a deleted frame is disconnected properly. Accessing fields or methods shouldn't crash the browser. 
</span><span class="cx">  Check Navigator
</span><span class="cx"> navigator.appCodeName is OK
</span><span class="lines">@@ -20,6 +21,8 @@
</span><span class="cx"> navigator.requestMediaKeySystemAccess() is OK
</span><span class="cx"> navigator.sendBeacon() threw err TypeError: Not enough arguments
</span><span class="cx"> navigator.serviceWorker is OK
</span><ins>+navigator.share() is OK
+navigator.standalone is OK
</ins><span class="cx"> navigator.userAgent is OK
</span><span class="cx"> navigator.vendor is OK
</span><span class="cx"> navigator.vendorSub is OK
</span><span class="lines">@@ -43,6 +46,8 @@
</span><span class="cx"> navigator.requestMediaKeySystemAccess() is OK
</span><span class="cx"> navigator.sendBeacon() threw err TypeError: Not enough arguments
</span><span class="cx"> navigator.serviceWorker is OK
</span><ins>+navigator.share() is OK
+navigator.standalone is OK
</ins><span class="cx"> navigator.userAgent is OK
</span><span class="cx"> navigator.vendor is OK
</span><span class="cx"> navigator.vendorSub is OK
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventsiosshareexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/events/ios/share-expected.txt (0 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/ios/share-expected.txt                             (rev 0)
+++ trunk/LayoutTests/fast/events/ios/share-expected.txt        2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -0,0 +1,2 @@
</span><ins>+PASS: Share sheet invoked.
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfasteventsiossharehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/events/ios/share.html (0 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/ios/share.html                             (rev 0)
+++ trunk/LayoutTests/fast/events/ios/share.html        2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
+
+<html>
+<meta name="viewport" content="initial-scale=5, width=device-width">
+<head>
+
+    <script src="../../../resources/ui-helper.js"></script>
+    <script>
+        
+        if (window.testRunner) {
+            testRunner.dumpAsText();
+            testRunner.waitUntilDone();
+        }
+    
+        let write = (message) => output.innerHTML += (message + "<br>");
+
+        async function runTest()
+        {
+            document.getElementById("target").addEventListener("click", async () => {
+                navigator.share({ title: "Example Page", url: "url", text: "text" }).then((result) => {
+                    write("PASS: Share sheet invoked.");
+                    testRunner.notifyDone();
+                });
+                UIHelper.invokeShareSheetWithResolution(true);
+            });
+            await UIHelper.activateAt(50, 50);
+        }
+
+    </script>
+    <style>
+        #target {
+            height: 100px;
+            width: 100px;
+            background-color: silver;
+        }
+    </style>
+</head>
+<body onload="runTest()">
+<pre id="output"></pre>
+<button id="target">
+</button>
+
+</body>
+</html>
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog 2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/LayoutTests/imported/w3c/ChangeLog    2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2018-08-29  Olivia Barnett  <obarnett@apple.com>
+
+        Implement the Web Share API
+        https://bugs.webkit.org/show_bug.cgi?id=171100
+        <rdar://problem/31751734>
+
+        Reviewed by Tim Horton.
+
+        * web-platform-tests/web-share/idlharness.https-expected.txt:
+        * web-platform-tests/web-share/share-empty.https-expected.txt:
+        * web-platform-tests/web-share/share-securecontext.http-expected.txt:
+        * web-platform-tests/web-share/share-url-invalid.https-expected.txt:
+        * web-platform-tests/web-share/share-without-user-gesture.https-expected.txt:
+        Updated expected results.
+
</ins><span class="cx"> 2018-08-29  Youenn Fablet  <youenn@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Remove WebRTC legacy API implementation
</span></span></pre></div>
<a id="trunkLayoutTestsplatformioswk2importedw3cwebplatformtestswebshareidlharnesshttpsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/web-share/idlharness.https-expected.txt (0 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/web-share/idlharness.https-expected.txt                               (rev 0)
+++ trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/web-share/idlharness.https-expected.txt  2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+
+PASS Test driver 
+PASS Navigator interface: operation share(ShareData) 
+PASS Unscopable handled correctly for share(ShareData) on Navigator 
+PASS Navigator interface: navigator must inherit property "share(ShareData)" with the proper type 
+PASS Navigator interface: calling share(ShareData) on navigator with too few arguments must throw TypeError 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformioswk2importedw3cwebplatformtestswebshareshareemptyhttpsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/web-share/share-empty.https-expected.txt (0 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/web-share/share-empty.https-expected.txt                              (rev 0)
+++ trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/web-share/share-empty.https-expected.txt 2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+
+PASS share with no arguments (same as empty dictionary) 
+PASS share with an empty dictionary 
+PASS share with a undefined argument (same as empty dictionary) 
+PASS share with a null argument (same as empty dictionary) 
+PASS share with a dictionary containing only surplus fields 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformioswk2importedw3cwebplatformtestswebsharesharesecurecontexthttpexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/web-share/share-securecontext.http-expected.txt (0 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/web-share/share-securecontext.http-expected.txt                               (rev 0)
+++ trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/web-share/share-securecontext.http-expected.txt  2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+
+FAIL navigator.share must be undefined in non-secure context assert_false: navigator has attribute 'share'. expected false got true
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformioswk2importedw3cwebplatformtestswebshareshareurlinvalidhttpsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/web-share/share-url-invalid.https-expected.txt (0 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/web-share/share-url-invalid.https-expected.txt                                (rev 0)
+++ trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/web-share/share-url-invalid.https-expected.txt   2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+
+PASS share with an invalid URL 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformioswk2importedw3cwebplatformtestswebsharesharewithoutusergesturehttpsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/web-share/share-without-user-gesture.https-expected.txt (0 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/web-share/share-without-user-gesture.https-expected.txt                               (rev 0)
+++ trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/web-share/share-without-user-gesture.https-expected.txt  2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+
+PASS share without a user gesture 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsresourcesuihelperjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/resources/ui-helper.js (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/resources/ui-helper.js 2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/LayoutTests/resources/ui-helper.js    2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -262,6 +262,12 @@
</span><span class="cx">         return new Promise(resolve => testRunner.runUIScript(setValueScript, resolve));
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    static invokeShareSheetWithResolution(resolved)
+    {
+        const resolveShareSheet = `(() => uiController.invokeShareSheetWithResolution(${resolved}))()`;
+        return new Promise(resolve => testRunner.runUIScript(resolveShareSheet, resolve));
+    }
+
</ins><span class="cx">     static textContentType()
</span><span class="cx">     {
</span><span class="cx">         return new Promise(resolve => {
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt      2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebCore/CMakeLists.txt 2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -811,6 +811,7 @@
</span><span class="cx">     page/NavigatorLanguage.idl
</span><span class="cx">     page/NavigatorOnLine.idl
</span><span class="cx">     page/NavigatorServiceWorker.idl
</span><ins>+    page/NavigatorShare.idl
</ins><span class="cx">     page/Performance.idl
</span><span class="cx">     page/PerformanceEntry.idl
</span><span class="cx">     page/PerformanceMark.idl
</span><span class="lines">@@ -825,6 +826,7 @@
</span><span class="cx">     page/RemoteDOMWindow.idl
</span><span class="cx">     page/Screen.idl
</span><span class="cx">     page/ScrollToOptions.idl
</span><ins>+    page/ShareData.idl
</ins><span class="cx">     page/VisualViewport.idl
</span><span class="cx">     page/WebKitPoint.idl
</span><span class="cx">     page/WindowEventHandlers.idl
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebCore/ChangeLog      2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -1,3 +1,50 @@
</span><ins>+2018-08-29  Olivia Barnett  <obarnett@apple.com>
+
+        Implement the Web Share API
+        https://bugs.webkit.org/show_bug.cgi?id=171100
+        <rdar://problem/31751734>
+
+        Reviewed by Tim Horton.
+
+        Added one test in fast/events/ios called share.html; adjusted expectations for existing tests.
+
+        * DerivedSources.make:
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * features.json:
+        * loader/EmptyClients.cpp:
+        (WebCore::EmptyChromeClient::showShareSheet):
+        * loader/EmptyClients.h:
+        Added empty showShareSheet function.
+
+        * page/Chrome.cpp:
+        (WebCore::Chrome::showShareSheet):
+        * page/Chrome.h:
+        Added call to showShareSheet on client.
+
+        * page/ChromeClient.h:
+        Virtual showShareSheet function.
+
+        * page/Navigator.cpp:
+        (WebCore::Navigator::share):
+        * page/Navigator.h:
+        Share function that returns a promise and invokes the share sheet.
+
+        * page/Navigator.idl:
+        Implements NavigatorShare
+
+        * page/NavigatorShare.idl: Added.
+        Added definition of share function returning a promise.
+
+        * page/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::setWebShareEnabled):
+        (WebCore::RuntimeEnabledFeatures::webShareEnabled const):
+        Added RuntimeEnabledFeature switch.
+
+        * page/ShareData.h: Added.
+        * page/ShareData.idl: Added.
+        Definition of ShareData struct.
+
</ins><span class="cx"> 2018-08-29  Daniel Bates  <dabates@apple.com>
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r226138): WebCore::subdivide() may return an empty vector; Web process can crash when performing find in Epiphany
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.make (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.make 2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebCore/DerivedSources.make    2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -774,6 +774,8 @@
</span><span class="cx">     $(WebCore)/page/NavigatorID.idl \
</span><span class="cx">     $(WebCore)/page/NavigatorLanguage.idl \
</span><span class="cx">     $(WebCore)/page/NavigatorOnLine.idl \
</span><ins>+    $(WebCore)/page/NavigatorShare.idl \
+    $(WebCore)/page/ShareData.idl \
</ins><span class="cx">     $(WebCore)/page/NavigatorServiceWorker.idl \
</span><span class="cx">     $(WebCore)/page/Performance.idl \
</span><span class="cx">     $(WebCore)/page/PerformanceEntry.idl \
</span></span></pre></div>
<a id="trunkSourceWebCoreSourcestxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Sources.txt (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Sources.txt 2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebCore/Sources.txt    2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -2782,6 +2782,8 @@
</span><span class="cx"> JSNavigatorMediaCapabilities.cpp
</span><span class="cx"> JSNavigatorMediaDevices.cpp
</span><span class="cx"> JSNavigatorOnLine.cpp
</span><ins>+JSNavigatorShare.cpp
+JSShareData.cpp
</ins><span class="cx"> JSNavigatorServiceWorker.cpp
</span><span class="cx"> JSNavigatorWebDriver.cpp
</span><span class="cx"> JSNavigatorWebVR.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj   2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj      2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -637,6 +637,7 @@
</span><span class="cx">          1CAF34830A6C405200ABE06E /* WebScriptObjectPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CAF34800A6C405200ABE06E /* WebScriptObjectPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          1CCDF5BE1990332400BCEBAD /* SVGToOTFFontConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CCDF5BC1990332400BCEBAD /* SVGToOTFFontConversion.h */; };
</span><span class="cx">          1CFAE3230A6D6A3F0032593D /* libobjc.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1CFAE3220A6D6A3F0032593D /* libobjc.dylib */; };
</span><ins>+               1D9F0FC12122029B005D8FD4 /* ShareData.h in Headers */ = {isa = PBXBuildFile; fileRef = 1DC55400211BA8C8004B780E /* ShareData.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">           1F36EA9C1E21BA1700621E25 /* WebBackgroundTaskController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F36EA9A1E21BA1700621E25 /* WebBackgroundTaskController.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          1F3C3BEB135CAF3C00B8C1AC /* MediaControls.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F3C3BE9135CAF3C00B8C1AC /* MediaControls.h */; };
</span><span class="cx">          1F72BF0B187FD45C0009BCB3 /* TileControllerMemoryHandlerIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F72BF09187FD4270009BCB3 /* TileControllerMemoryHandlerIOS.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -6306,6 +6307,9 @@
</span><span class="cx">          1CDD45E50BA9C84600F90147 /* WebCore.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = WebCore.xcconfig; sourceTree = "<group>"; };
</span><span class="cx">          1CDD45E60BA9C84600F90147 /* Base.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = "<group>"; };
</span><span class="cx">          1CFAE3220A6D6A3F0032593D /* libobjc.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libobjc.dylib; path = /usr/lib/libobjc.dylib; sourceTree = "<absolute>"; };
</span><ins>+               1DC553FD211BA12A004B780E /* NavigatorShare.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NavigatorShare.idl; sourceTree = "<group>"; };
+               1DC553FF211BA841004B780E /* ShareData.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ShareData.idl; sourceTree = "<group>"; };
+               1DC55400211BA8C8004B780E /* ShareData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShareData.h; sourceTree = "<group>"; };
</ins><span class="cx">           1F36EA9A1E21BA1700621E25 /* WebBackgroundTaskController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebBackgroundTaskController.h; sourceTree = "<group>"; };
</span><span class="cx">          1F36EA9B1E21BA1700621E25 /* WebBackgroundTaskController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebBackgroundTaskController.mm; sourceTree = "<group>"; };
</span><span class="cx">          1F3C3BE8135CAF3C00B8C1AC /* MediaControls.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaControls.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -19278,6 +19282,7 @@
</span><span class="cx">                          7C5BEA3B1E9EE77100CC517B /* NavigatorLanguage.idl */,
</span><span class="cx">                          7C5BEA3C1E9EE77100CC517B /* NavigatorOnLine.idl */,
</span><span class="cx">                          5182C24B1F313AE00059BA7C /* NavigatorServiceWorker.idl */,
</span><ins>+                               1DC553FD211BA12A004B780E /* NavigatorShare.idl */,
</ins><span class="cx">                           00146288103CD1DE000B20DB /* OriginAccessEntry.cpp */,
</span><span class="cx">                          00146289103CD1DE000B20DB /* OriginAccessEntry.h */,
</span><span class="cx">                          65FEA86809833ADE00BED4AB /* Page.cpp */,
</span><span class="lines">@@ -19368,6 +19373,8 @@
</span><span class="cx">                          7CC6609B1F93057900D500E9 /* SettingsBase.cpp */,
</span><span class="cx">                          7CC660991F93057800D500E9 /* SettingsBase.h */,
</span><span class="cx">                          7C6EFEEA1F946A2E00FFAD41 /* SettingsDefaultValues.h */,
</span><ins>+                               1DC55400211BA8C8004B780E /* ShareData.h */,
+                               1DC553FF211BA841004B780E /* ShareData.idl */,
</ins><span class="cx">                           5C688AA21D38126F000B54FA /* SocketProvider.cpp */,
</span><span class="cx">                          5C7C88D71D0F1F2B009D2F6D /* SocketProvider.h */,
</span><span class="cx">                          626CDE0C1140424C001E5A68 /* SpatialNavigation.cpp */,
</span><span class="lines">@@ -30100,6 +30107,7 @@
</span><span class="cx">                          FD45A95B175D41EE00C21EC8 /* ShapeInterval.h in Headers */,
</span><span class="cx">                          FD45A952175D3F3E00C21EC8 /* ShapeOutsideInfo.h in Headers */,
</span><span class="cx">                          FD1AF1501656F15100C6D4F7 /* ShapeValue.h in Headers */,
</span><ins>+                               1D9F0FC12122029B005D8FD4 /* ShareData.h in Headers */,
</ins><span class="cx">                           1A4A954E0B4EDCCB002D8C3C /* SharedBuffer.h in Headers */,
</span><span class="cx">                          834DFAD01F7DAE5D00C2725B /* SharedStringHash.h in Headers */,
</span><span class="cx">                          93309EA3099EB78C0056E581 /* SharedTimer.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCorefeaturesjson"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/features.json (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/features.json       2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebCore/features.json  2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -1230,7 +1230,7 @@
</span><span class="cx">     {
</span><span class="cx">         "name": "Web Share",
</span><span class="cx">         "status": {
</span><del>-            "status": "Under Consideration"
</del><ins>+            "status": "In Development"
</ins><span class="cx">         },
</span><span class="cx">         "url": "https://github.com/WICG/web-share/blob/master/docs/interface.md",
</span><span class="cx">         "webkit-url": "https://bugs.webkit.org/show_bug.cgi?id=171100",
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderEmptyClientscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/EmptyClients.cpp (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/EmptyClients.cpp     2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebCore/loader/EmptyClients.cpp        2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -436,6 +436,10 @@
</span><span class="cx"> void EmptyChromeClient::runOpenPanel(Frame&, FileChooser&)
</span><span class="cx"> {
</span><span class="cx"> }
</span><ins>+    
+void EmptyChromeClient::showShareSheet(ShareDataWithParsedURL&, CompletionHandler<void(bool)>&&)
+{
+}
</ins><span class="cx"> 
</span><span class="cx"> PAL::SessionID EmptyFrameLoaderClient::sessionID() const
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderEmptyClientsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/EmptyClients.h (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/EmptyClients.h       2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebCore/loader/EmptyClients.h  2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -137,6 +137,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     void runOpenPanel(Frame&, FileChooser&) final;
</span><ins>+    void showShareSheet(ShareDataWithParsedURL&, CompletionHandler<void(bool)>&&) final;
</ins><span class="cx">     void loadIconForFiles(const Vector<String>&, FileIconLoader&) final { }
</span><span class="cx"> 
</span><span class="cx">     void elementDidFocus(Element&) final { }
</span></span></pre></div>
<a id="trunkSourceWebCorepageChromecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Chrome.cpp (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Chrome.cpp     2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebCore/page/Chrome.cpp        2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -46,6 +46,7 @@
</span><span class="cx"> #include "RenderObject.h"
</span><span class="cx"> #include "ResourceHandle.h"
</span><span class="cx"> #include "Settings.h"
</span><ins>+#include "ShareData.h"
</ins><span class="cx"> #include "StorageNamespace.h"
</span><span class="cx"> #include "WindowFeatures.h"
</span><span class="cx"> #include <JavaScriptCore/VM.h>
</span><span class="lines">@@ -449,6 +450,11 @@
</span><span class="cx">     m_client.runOpenPanel(frame, fileChooser);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void Chrome::showShareSheet(ShareDataWithParsedURL& shareData, CompletionHandler<void(bool)>&& callback)
+{
+    m_client.showShareSheet(shareData, WTFMove(callback));
+}
+
</ins><span class="cx"> void Chrome::loadIconForFiles(const Vector<String>& filenames, FileIconLoader& loader)
</span><span class="cx"> {
</span><span class="cx">     m_client.loadIconForFiles(filenames, loader);
</span></span></pre></div>
<a id="trunkSourceWebCorepageChromeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Chrome.h (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Chrome.h       2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebCore/page/Chrome.h  2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -59,6 +59,7 @@
</span><span class="cx"> class SearchPopupMenu;
</span><span class="cx"> 
</span><span class="cx"> struct DateTimeChooserParameters;
</span><ins>+struct ShareDataWithParsedURL;
</ins><span class="cx"> struct ViewportArguments;
</span><span class="cx"> struct WindowFeatures;
</span><span class="cx">     
</span><span class="lines">@@ -159,6 +160,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     void runOpenPanel(Frame&, FileChooser&);
</span><ins>+    void showShareSheet(ShareDataWithParsedURL&, CompletionHandler<void(bool)>&&);
</ins><span class="cx">     void loadIconForFiles(const Vector<String>&, FileIconLoader&);
</span><span class="cx"> 
</span><span class="cx">     void dispatchDisabledAdaptationsDidChange(const OptionSet<DisabledAdaptations>&) const;
</span></span></pre></div>
<a id="trunkSourceWebCorepageChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/ChromeClient.h (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/ChromeClient.h 2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebCore/page/ChromeClient.h    2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -101,6 +101,7 @@
</span><span class="cx"> 
</span><span class="cx"> struct DateTimeChooserParameters;
</span><span class="cx"> struct GraphicsDeviceAdapter;
</span><ins>+struct ShareDataWithParsedURL;
</ins><span class="cx"> struct ViewportArguments;
</span><span class="cx"> struct WindowFeatures;
</span><span class="cx"> 
</span><span class="lines">@@ -282,6 +283,8 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     virtual void runOpenPanel(Frame&, FileChooser&) = 0;
</span><ins>+    virtual void showShareSheet(ShareDataWithParsedURL&, WTF::CompletionHandler<void(bool)>&& callback) { callback(false); }
+    
</ins><span class="cx">     // Asynchronous request to load an icon for specified filenames.
</span><span class="cx">     virtual void loadIconForFiles(const Vector<String>&, FileIconLoader&) = 0;
</span><span class="cx">         
</span></span></pre></div>
<a id="trunkSourceWebCorepageNavigatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Navigator.cpp (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Navigator.cpp  2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebCore/page/Navigator.cpp     2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -23,6 +23,7 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "Navigator.h"
</span><span class="cx"> 
</span><ins>+#include "Chrome.h"
</ins><span class="cx"> #include "CookieJar.h"
</span><span class="cx"> #include "DOMMimeTypeArray.h"
</span><span class="cx"> #include "DOMPluginArray.h"
</span><span class="lines">@@ -31,6 +32,7 @@
</span><span class="cx"> #include "FrameLoader.h"
</span><span class="cx"> #include "FrameLoaderClient.h"
</span><span class="cx"> #include "Geolocation.h"
</span><ins>+#include "JSDOMPromiseDeferred.h"
</ins><span class="cx"> #include "LoaderStrategy.h"
</span><span class="cx"> #include "Page.h"
</span><span class="cx"> #include "PlatformStrategies.h"
</span><span class="lines">@@ -40,6 +42,7 @@
</span><span class="cx"> #include "Settings.h"
</span><span class="cx"> #include <wtf/Language.h>
</span><span class="cx"> #include <wtf/StdLibExtras.h>
</span><ins>+#include <wtf/WeakPtr.h>
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -94,6 +97,43 @@
</span><span class="cx">     return platformStrategies()->loaderStrategy()->isOnLine();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void Navigator::share(ScriptExecutionContext& context, ShareData data, Ref<DeferredPromise>&& promise)
+{
+    if (!m_frame->page()) {
+        promise->reject(TypeError);
+        return;
+    }
+    
+    if (data.title.isEmpty() && data.url.isEmpty() && data.text.isEmpty()) {
+        promise->reject(TypeError);
+        return;
+    }
+    
+    URL url = context.completeURL(data.url);
+    if (!url.isValid()) {
+        promise->reject(TypeError);
+        return;
+    }
+    
+    if (!UserGestureIndicator::processingUserGesture()) {
+        promise->reject(NotAllowedError);
+        return;
+    }
+    
+    ShareDataWithParsedURL shareData = {
+        data,
+        url,
+    };
+
+    m_frame->page()->chrome().showShareSheet(shareData, [promise = WTFMove(promise)] (bool completed) {
+        if (completed) {
+            promise->resolve();
+            return;
+        }
+        promise->reject(Exception { AbortError, "Abort due to cancellation of share."_s });
+    });
+}
+
</ins><span class="cx"> DOMPluginArray& Navigator::plugins()
</span><span class="cx"> {
</span><span class="cx">     if (!m_plugins)
</span></span></pre></div>
<a id="trunkSourceWebCorepageNavigatorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Navigator.h (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Navigator.h    2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebCore/page/Navigator.h       2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -20,8 +20,10 @@
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><span class="cx"> #include "DOMWindowProperty.h"
</span><ins>+#include "JSDOMPromiseDeferred.h"
</ins><span class="cx"> #include "NavigatorBase.h"
</span><span class="cx"> #include "ScriptWrappable.h"
</span><ins>+#include "ShareData.h"
</ins><span class="cx"> #include "Supplementable.h"
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -42,6 +44,7 @@
</span><span class="cx">     const String& userAgent() const final;
</span><span class="cx">     void userAgentChanged();
</span><span class="cx">     bool onLine() const final;
</span><ins>+    void share(ScriptExecutionContext&, ShareData, Ref<DeferredPromise>&&);
</ins><span class="cx">     
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     bool standalone() const;
</span></span></pre></div>
<a id="trunkSourceWebCorepageNavigatoridl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Navigator.idl (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Navigator.idl  2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebCore/page/Navigator.idl     2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -35,4 +35,4 @@
</span><span class="cx"> Navigator implements NavigatorLanguage;
</span><span class="cx"> Navigator implements NavigatorOnLine;
</span><span class="cx"> Navigator implements NavigatorServiceWorker;
</span><del>-
</del><ins>+Navigator implements NavigatorShare;
</ins></span></pre></div>
<a id="trunkSourceWebCorepageNavigatorShareidl"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/page/NavigatorShare.idl (0 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/NavigatorShare.idl                             (rev 0)
+++ trunk/Source/WebCore/page/NavigatorShare.idl        2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+/*
+* Copyright (C) 2018 Apple Inc. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+* 1. Redistributions of source code must retain the above copyright
+*    notice, this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright
+*    notice, this list of conditions and the following disclaimer in the
+*    documentation and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+* PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+[
+    NoInterfaceObject,
+    EnabledAtRuntime=WebShare
+] interface NavigatorShare {
+    [CallWith=ScriptExecutionContext, SecureContext] Promise<void> share(optional ShareData shareData);
+};
</ins></span></pre></div>
<a id="trunkSourceWebCorepageRuntimeEnabledFeaturesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/RuntimeEnabledFeatures.h (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/RuntimeEnabledFeatures.h       2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebCore/page/RuntimeEnabledFeatures.h  2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -86,6 +86,9 @@
</span><span class="cx"> 
</span><span class="cx">     void setCustomPasteboardDataEnabled(bool isEnabled) { m_isCustomPasteboardDataEnabled = isEnabled; }
</span><span class="cx">     bool customPasteboardDataEnabled() const { return m_isCustomPasteboardDataEnabled; }
</span><ins>+    
+    void setWebShareEnabled(bool isEnabled) { m_isWebShareEnabled = isEnabled; }
+    bool webShareEnabled() const { return m_isWebShareEnabled; }
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(ATTACHMENT_ELEMENT)
</span><span class="cx">     void setAttachmentElementEnabled(bool areEnabled) { m_isAttachmentElementEnabled = areEnabled; }
</span><span class="lines">@@ -304,6 +307,7 @@
</span><span class="cx">     bool m_isDirectoryUploadEnabled { false };
</span><span class="cx">     bool m_areDataTransferItemsEnabled { false };
</span><span class="cx">     bool m_isCustomPasteboardDataEnabled { false };
</span><ins>+    bool m_isWebShareEnabled { false };
</ins><span class="cx">     bool m_inputEventsEnabled { true };
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(ATTACHMENT_ELEMENT)
</span></span></pre></div>
<a id="trunkSourceWebCorepageShareDatah"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/page/ShareData.h (0 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/ShareData.h                            (rev 0)
+++ trunk/Source/WebCore/page/ShareData.h       2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+#include "URL.h"
+
+namespace WebCore {
+    
+struct ShareData {
+    String title;
+    String text;
+    String url;
+};
+    
+struct ShareDataWithParsedURL {
+    ShareData shareData;
+    URL url;
+};
+    
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorepageShareDataidl"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/page/ShareData.idl (0 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/ShareData.idl                          (rev 0)
+++ trunk/Source/WebCore/page/ShareData.idl     2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+/*
+* Copyright (C) 2018 Apple Inc. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+* 1. Redistributions of source code must retain the above copyright
+*    notice, this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright
+*    notice, this list of conditions and the following disclaimer in the
+*    documentation and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+* PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+dictionary ShareData {
+    USVString title;
+    USVString text;
+    USVString url;
+};
</ins></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebKit/ChangeLog       2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -1,3 +1,95 @@
</span><ins>+2018-08-29  Olivia Barnett  <obarnett@apple.com>
+
+        Implement the Web Share API
+        https://bugs.webkit.org/show_bug.cgi?id=171100
+        <rdar://problem/31751734>
+
+        Reviewed by Tim Horton.
+
+        * Platform/spi/ios/UIKitSPI.h:
+        Added NSURL _title property as in the WebCore UIKitSPI.
+
+        * Scripts/webkit/messages.py:
+        ShareDataWithParsedURL special case for header for type.
+        
+        * Shared/ShareSheetCallbackID.h:
+        Added a typedef for a share sheet callback id.       
+
+        * Shared/WebCoreArgumentCoders.cpp:
+        (IPC::ArgumentCoder<ShareData>::encode):
+        (IPC::ArgumentCoder<ShareData>::decode):
+        (IPC::ArgumentCoder<ShareDataWithParsedURL>::encode):
+        (IPC::ArgumentCoder<ShareDataWithParsedURL>::decode):
+        * Shared/WebCoreArgumentCoders.h:
+        Added encoding and decoding functionality for new structs.
+
+        * Shared/WebPreferences.yaml:
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesSetWebShareEnabled):
+        (WKPreferencesGetWebShareEnabled):
+        * UIProcess/API/C/WKPreferencesRefPrivate.h:
+        Added switch for RuntimeEnabledFeature.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
+        Added hook for share sheet testing.
+
+        * UIProcess/PageClient.h:
+        (WebKit::PageClient::showShareSheet):
+        Page client call to invoke share sheet.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::showShareSheet):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        Web page proxy handling of call to invoke share sheet.
+        Creates completion handler to send to WKShareSheet.mm
+        Completion handler sends message to WebPage with message id.
+
+        * UIProcess/ios/PageClientImplIOS.h:
+        * UIProcess/ios/PageClientImplIOS.mm:
+        (WebKit::PageClientImpl::showShareSheet):
+        Page client implementation call to invoke share sheet. 
+
+        * UIProcess/ios/WKContentViewInteraction.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView cleanupInteraction]):
+        (-[WKContentView _showShareSheet:completionHandler:]):
+        (-[WKContentView shareSheetDidDismiss:]):
+        (-[WKContentView invokeShareSheetWithResolution:resolved):
+        Call to WKShareSheet to invoke the share sheet and callback.
+        Hook for share sheet resolution testing.
+
+        * UIProcess/ios/forms/WKShareSheet.h: Added.
+        * UIProcess/ios/forms/WKShareSheet.mm: Added.
+        (-[WKShareSheet initWithView:]):
+        (-[WKShareSheet presentWithParameters:completionHandler:]):
+        (-[WKShareSheet _dispatchDidDismiss]):
+        (-[WKShareSheet _cancel]):
+        (-[WKShareSheet dismiss]):
+        (-[WKShareSheet _dismissDisplayAnimated:]):
+        (-[WKShareSheet _presentFullscreenViewController:animated:]):
+        (-[WKShareSheet invokeShareSheetWithResolution:resolved:]):
+        Completion handler call and creation of share sheet with parameters.
+        Hook that force resolves the share sheet completion handler for testing. 
+
+        * WebKit.xcodeproj/project.pbxproj:
+
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::showShareSheet):
+        Call to page to invoke share sheet.
+
+        * WebProcess/WebCoreSupport/WebChromeClient.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::nextShareSheetContextId):
+        (WebKit::WebPage::showShareSheet):
+        (WebKit::WebPage::showShareSheetResponse):
+        WebPage calls proxy and saves context id for promise.        
+
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in:
+        Callback for completed response.
+
</ins><span class="cx"> 2018-08-29  Chris Dumez  <cdumez@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Crash under WebKit: WTF::Function<void ()>::CallableWrapper<WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords(WTF::CompletionHandler<void ()>&&)::$_1>::call()
</span></span></pre></div>
<a id="trunkSourceWebKitPlatformspiiosUIKitSPIh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h  2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h     2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -418,12 +418,17 @@
</span><span class="cx"> @property (readonly) NSString *_hostApplicationBundleIdentifier;
</span><span class="cx"> @end
</span><span class="cx"> 
</span><ins>+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
+@interface NSURL ()
+@property (nonatomic, copy, setter=_setTitle:) NSString *_title;
+@end
+#endif
+
</ins><span class="cx"> @protocol UIViewControllerContextTransitioningEx <UIViewControllerContextTransitioning>
</span><span class="cx"> - (void)__runAlongsideAnimations;
</span><span class="cx"> - (void)_interactivityDidChange:(BOOL)isInteractive;
</span><span class="cx"> @property (nonatomic, assign, setter=_setAllowUserInteraction:, getter=_allowUserInteraction) BOOL _allowUserInteraction;
</span><span class="cx"> @property (nonatomic, assign, setter=_setPercentOffset:) CGFloat _percentOffset;
</span><del>-@property (nonatomic, retain, setter=_setContainerViews:) NSArray *_containerViews;
</del><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> @interface _UIViewControllerTransitionContext : NSObject <UIViewControllerContextTransitioningEx>
</span></span></pre></div>
<a id="trunkSourceWebKitScriptswebkitmessagespy"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Scripts/webkit/messages.py (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/messages.py   2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebKit/Scripts/webkit/messages.py      2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -380,6 +380,7 @@
</span><span class="cx">         'WebCore::AutoplayEventFlags': ['<WebCore/AutoplayEvent.h>'],
</span><span class="cx">         'WebCore::ExceptionDetails': ['<WebCore/JSDOMExceptionHandling.h>'],
</span><span class="cx">         'WebCore::FileChooserSettings': ['<WebCore/FileChooser.h>'],
</span><ins>+        'WebCore::ShareDataWithParsedURL': ['<WebCore/ShareData.h>'],
</ins><span class="cx">         'WebCore::FrameLoadType': ['<WebCore/FrameLoaderTypes.h>'],
</span><span class="cx">         'WebCore::GrammarDetail': ['<WebCore/TextCheckerClient.h>'],
</span><span class="cx">         'WebCore::HasInsecureContent': ['<WebCore/FrameLoaderTypes.h>'],
</span></span></pre></div>
<a id="trunkSourceWebKitSharedShareSheetCallbackIDh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit/Shared/ShareSheetCallbackID.h (0 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/ShareSheetCallbackID.h                                (rev 0)
+++ trunk/Source/WebKit/Shared/ShareSheetCallbackID.h   2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+typedef uint64_t ShareSheetCallbackID;
+
</ins></span></pre></div>
<a id="trunkSourceWebKitSharedWebCoreArgumentCoderscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp     2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp        2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -71,6 +71,7 @@
</span><span class="cx"> #include <WebCore/ServiceWorkerClientData.h>
</span><span class="cx"> #include <WebCore/ServiceWorkerClientIdentifier.h>
</span><span class="cx"> #include <WebCore/ServiceWorkerData.h>
</span><ins>+#include <WebCore/ShareData.h>
</ins><span class="cx"> #include <WebCore/TextCheckerClient.h>
</span><span class="cx"> #include <WebCore/TextIndicator.h>
</span><span class="cx"> #include <WebCore/TimingFunction.h>
</span><span class="lines">@@ -1916,8 +1917,40 @@
</span><span class="cx"> 
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><ins>+    
+void ArgumentCoder<ShareData>::encode(Encoder& encoder, const ShareData& settings)
+{
+    encoder << settings.title;
+    encoder << settings.text;
+    encoder << settings.url;
+}
</ins><span class="cx"> 
</span><ins>+bool ArgumentCoder<ShareData>::decode(Decoder& decoder, ShareData& settings)
+{
+    if (!decoder.decode(settings.title))
+        return false;
+    if (!decoder.decode(settings.text))
+        return false;
+    if (!decoder.decode(settings.url))
+        return false;
+    return true;
+}
+    
+void ArgumentCoder<ShareDataWithParsedURL>::encode(Encoder& encoder, const ShareDataWithParsedURL& settings)
+{
+    encoder << settings.shareData;
+    encoder << settings.url;
+}
</ins><span class="cx"> 
</span><ins>+bool ArgumentCoder<ShareDataWithParsedURL>::decode(Decoder& decoder, ShareDataWithParsedURL& settings)
+{
+    if (!decoder.decode(settings.shareData))
+        return false;
+    if (!decoder.decode(settings.url))
+        return false;
+    return true;
+}
+
</ins><span class="cx"> void ArgumentCoder<GrammarDetail>::encode(Encoder& encoder, const GrammarDetail& detail)
</span><span class="cx"> {
</span><span class="cx">     encoder << detail.location;
</span></span></pre></div>
<a id="trunkSourceWebKitSharedWebCoreArgumentCodersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h       2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h  2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -102,6 +102,8 @@
</span><span class="cx"> struct EventTrackingRegions;
</span><span class="cx"> struct ExceptionDetails;
</span><span class="cx"> struct FileChooserSettings;
</span><ins>+struct ShareData;
+struct ShareDataWithParsedURL;
</ins><span class="cx"> struct Length;
</span><span class="cx"> struct GrammarDetail;
</span><span class="cx"> struct MimeClassInfo;
</span><span class="lines">@@ -474,6 +476,16 @@
</span><span class="cx">     static void encode(Encoder&, const WebCore::FileChooserSettings&);
</span><span class="cx">     static bool decode(Decoder&, WebCore::FileChooserSettings&);
</span><span class="cx"> };
</span><ins>+    
+template<> struct ArgumentCoder<WebCore::ShareData> {
+    static void encode(Encoder&, const WebCore::ShareData&);
+    static bool decode(Decoder&, WebCore::ShareData&);
+};
+    
+template<> struct ArgumentCoder<WebCore::ShareDataWithParsedURL> {
+    static void encode(Encoder&, const WebCore::ShareDataWithParsedURL&);
+    static bool decode(Decoder&, WebCore::ShareDataWithParsedURL&);
+};
</ins><span class="cx"> 
</span><span class="cx"> template<> struct ArgumentCoder<WebCore::GrammarDetail> {
</span><span class="cx">     static void encode(Encoder&, const WebCore::GrammarDetail&);
</span></span></pre></div>
<a id="trunkSourceWebKitSharedWebPreferencesyaml"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/WebPreferences.yaml (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/WebPreferences.yaml   2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebKit/Shared/WebPreferences.yaml      2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -766,6 +766,13 @@
</span><span class="cx">   humanReadableDescription: "Enable custom clipboard types and better security model for clipboard API."
</span><span class="cx">   webcoreBinding: RuntimeEnabledFeatures
</span><span class="cx"> 
</span><ins>+WebShareEnabled:
+  type: bool
+  defaultValue: DEFAULT_WEB_SHARE_ENABLED
+  humanReadableName: "Web Share"
+  humanReadableDescription: "Enable support for share sheet via Web Share API"
+  webcoreBinding: RuntimeEnabledFeatures
+
</ins><span class="cx"> ViewportFitEnabled:
</span><span class="cx">   type: bool
</span><span class="cx">   defaultValue: true
</span></span></pre></div>
<a id="trunkSourceWebKitSharedWebPreferencesDefaultValuesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h 2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h    2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -65,6 +65,7 @@
</span><span class="cx"> #define DEFAULT_TEXT_AREAS_ARE_RESIZABLE false
</span><span class="cx"> #define DEFAULT_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY false
</span><span class="cx"> #define DEFAULT_SHOULD_RESPECT_IMAGE_ORIENTATION true
</span><ins>+#define DEFAULT_WEB_SHARE_ENABLED true
</ins><span class="cx"> #define DEFAULT_PASSWORD_ECHO_ENABLED true
</span><span class="cx"> #define DEFAULT_ALLOWS_INLINE_MEDIA_PLAYBACK false
</span><span class="cx"> #define DEFAULT_ALLOWS_INLINE_MEDIA_PLAYBACK_AFTER_FULLSCREEN true
</span><span class="lines">@@ -84,6 +85,7 @@
</span><span class="cx"> #define DEFAULT_TEXT_AREAS_ARE_RESIZABLE true
</span><span class="cx"> #define DEFAULT_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY true
</span><span class="cx"> #define DEFAULT_SHOULD_RESPECT_IMAGE_ORIENTATION false
</span><ins>+#define DEFAULT_WEB_SHARE_ENABLED false
</ins><span class="cx"> #define DEFAULT_PASSWORD_ECHO_ENABLED false
</span><span class="cx"> #define DEFAULT_ALLOWS_INLINE_MEDIA_PLAYBACK true
</span><span class="cx"> #define DEFAULT_ALLOWS_INLINE_MEDIA_PLAYBACK_AFTER_FULLSCREEN false
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPICWKPreferencescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp    2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp       2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -1728,6 +1728,16 @@
</span><span class="cx">     return toImpl(preferencesRef)->customPasteboardDataEnabled();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WKPreferencesSetWebShareEnabled(WKPreferencesRef preferencesRef, bool flag)
+{
+    toImpl(preferencesRef)->setWebShareEnabled(flag);
+}
+
+bool WKPreferencesGetWebShareEnabled(WKPreferencesRef preferencesRef)
+{
+    return toImpl(preferencesRef)->webShareEnabled();
+}
+
</ins><span class="cx"> void WKPreferencesSetDownloadAttributeEnabled(WKPreferencesRef preferencesRef, bool flag)
</span><span class="cx"> {
</span><span class="cx">     toImpl(preferencesRef)->setDownloadAttributeEnabled(flag);
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPICWKPreferencesRefPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h    2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h       2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -496,6 +496,10 @@
</span><span class="cx"> // Defaults to false
</span><span class="cx"> WK_EXPORT void WKPreferencesSetCustomPasteboardDataEnabled(WKPreferencesRef, bool flag);
</span><span class="cx"> WK_EXPORT bool WKPreferencesGetCustomPasteboardDataEnabled(WKPreferencesRef);
</span><ins>+    
+// Defaults to false, true for iOS
+WK_EXPORT void WKPreferencesSetWebShareEnabled(WKPreferencesRef, bool flag);
+WK_EXPORT bool WKPreferencesGetWebShareEnabled(WKPreferencesRef);
</ins><span class="cx"> 
</span><span class="cx"> // Defaults to false
</span><span class="cx"> WK_EXPORT void WKPreferencesSetUserTimingEnabled(WKPreferencesRef, bool flag);
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPICocoaWKWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm     2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm        2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -5933,6 +5933,11 @@
</span><span class="cx">     [_contentView setTimePickerValueToHour:hour minute:minute];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)_invokeShareSheetWithResolution:(BOOL)resolved
+{
+    [_contentView invokeShareSheetWithResolution:resolved];
+}
+
</ins><span class="cx"> - (void)selectFormAccessoryPickerRow:(int)rowIndex
</span><span class="cx"> {
</span><span class="cx">     [_contentView selectFormAccessoryPickerRow:rowIndex];
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPICocoaWKWebViewPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h       2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h  2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -382,6 +382,8 @@
</span><span class="cx"> @property (nonatomic, readonly) NSString *formInputLabel WK_API_AVAILABLE(ios(WK_IOS_TBA));
</span><span class="cx"> - (void)setTimePickerValueToHour:(NSInteger)hour minute:(NSInteger)minute WK_API_AVAILABLE(ios(WK_IOS_TBA));
</span><span class="cx"> 
</span><ins>+- (void)_invokeShareSheetWithResolution:(BOOL)resolved WK_API_AVAILABLE(ios(WK_IOS_TBA));
+
</ins><span class="cx"> - (void)applyAutocorrection:(NSString *)newString toString:(NSString *)oldString withCompletionHandler:(void (^)(void))completionHandler WK_API_AVAILABLE(ios(11.0));
</span><span class="cx"> 
</span><span class="cx"> - (void)didStartFormControlInteraction WK_API_AVAILABLE(ios(10.3));
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessPageClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/PageClient.h (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/PageClient.h       2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebKit/UIProcess/PageClient.h  2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -80,6 +80,7 @@
</span><span class="cx"> struct Highlight;
</span><span class="cx"> struct TextIndicatorData;
</span><span class="cx"> struct ViewportAttributes;
</span><ins>+struct ShareDataWithParsedURL;
</ins><span class="cx"> 
</span><span class="cx"> template <typename> class RectEdges;
</span><span class="cx"> using FloatBoxExtent = RectEdges<float>;
</span><span class="lines">@@ -201,6 +202,7 @@
</span><span class="cx">     virtual void handleDownloadRequest(DownloadProxy*) = 0;
</span><span class="cx"> 
</span><span class="cx">     virtual bool handleRunOpenPanel(WebPageProxy*, WebFrameProxy*, API::OpenPanelParameters*, WebOpenPanelResultListenerProxy*) { return false; }
</span><ins>+    virtual bool showShareSheet(const WebCore::ShareDataWithParsedURL&, WTF::CompletionHandler<void (bool)>&&) { return false; }
</ins><span class="cx"> 
</span><span class="cx">     virtual void didChangeContentSize(const WebCore::IntSize&) = 0;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp   2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp      2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -77,6 +77,7 @@
</span><span class="cx"> #include "PluginProcessManager.h"
</span><span class="cx"> #include "PrintInfo.h"
</span><span class="cx"> #include "SafeBrowsingResult.h"
</span><ins>+#include "ShareSheetCallbackID.h"
</ins><span class="cx"> #include "TextChecker.h"
</span><span class="cx"> #include "TextCheckerState.h"
</span><span class="cx"> #include "UIMessagePortChannelProvider.h"
</span><span class="lines">@@ -145,6 +146,7 @@
</span><span class="cx"> #include <WebCore/ResourceLoadStatistics.h>
</span><span class="cx"> #include <WebCore/SSLKeyGenerator.h>
</span><span class="cx"> #include <WebCore/SerializedCryptoKeyWrap.h>
</span><ins>+#include <WebCore/ShareData.h>
</ins><span class="cx"> #include <WebCore/SharedBuffer.h>
</span><span class="cx"> #include <WebCore/ShouldSkipSafeBrowsingCheck.h>
</span><span class="cx"> #include <WebCore/ShouldTreatAsContinuingLoad.h>
</span><span class="lines">@@ -4585,6 +4587,15 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebPageProxy::showShareSheet(const ShareDataWithParsedURL& shareData, ShareSheetCallbackID callbackID)
+{
+    CompletionHandler<void(bool)> completionHandler = [this, protectedThis = makeRef(*this), callbackID] (bool access) {
+        m_process->send(Messages::WebPage::DidCompleteShareSheet(access, callbackID), m_pageID);
+    };
+    
+    m_pageClient.showShareSheet(shareData, WTFMove(completionHandler));
+}
+    
</ins><span class="cx"> void WebPageProxy::printFrame(uint64_t frameID)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!m_isPerformingDOMPrintOperation);
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebPageProxy.h     2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h        2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -43,6 +43,7 @@
</span><span class="cx"> #include "ProcessTerminationReason.h"
</span><span class="cx"> #include "ProcessThrottler.h"
</span><span class="cx"> #include "SandboxExtension.h"
</span><ins>+#include "ShareSheetCallbackID.h"
</ins><span class="cx"> #include "ShareableBitmap.h"
</span><span class="cx"> #include "SuspendedPageProxy.h"
</span><span class="cx"> #include "SystemPreviewController.h"
</span><span class="lines">@@ -187,6 +188,7 @@
</span><span class="cx"> struct GlobalWindowIdentifier;
</span><span class="cx"> struct MediaStreamRequest;
</span><span class="cx"> struct SecurityOriginData;
</span><ins>+struct ShareData;
</ins><span class="cx"> struct TextAlternativeWithRange;
</span><span class="cx"> struct TextCheckingResult;
</span><span class="cx"> struct ViewportAttributes;
</span><span class="lines">@@ -1468,6 +1470,7 @@
</span><span class="cx">     void didChangeViewportProperties(const WebCore::ViewportAttributes&);
</span><span class="cx">     void pageDidScroll();
</span><span class="cx">     void runOpenPanel(uint64_t frameID, const WebCore::SecurityOriginData&, const WebCore::FileChooserSettings&);
</span><ins>+    void showShareSheet(const WebCore::ShareDataWithParsedURL&, ShareSheetCallbackID);
</ins><span class="cx">     void printFrame(uint64_t frameID);
</span><span class="cx">     void exceededDatabaseQuota(uint64_t frameID, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage, Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply&&);
</span><span class="cx">     void reachedApplicationCacheOriginQuota(const String& originIdentifier, uint64_t currentQuota, uint64_t totalBytesNeeded, Messages::WebPageProxy::ReachedApplicationCacheOriginQuota::DelayedReply&&);
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebPageProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in   2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in      2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -76,6 +76,7 @@
</span><span class="cx">     RunBeforeUnloadConfirmPanel(uint64_t frameID, struct WebCore::SecurityOriginData frameSecurityOrigin, String message) -> (bool shouldClose) Delayed
</span><span class="cx">     PageDidScroll()
</span><span class="cx">     RunOpenPanel(uint64_t frameID, struct WebCore::SecurityOriginData frameSecurityOrigin, struct WebCore::FileChooserSettings parameters)
</span><ins>+    ShowShareSheet(struct WebCore::ShareDataWithParsedURL shareData, uint64_t callbackID)
</ins><span class="cx">     PrintFrame(uint64_t frameID) -> ()
</span><span class="cx">     RunModal()
</span><span class="cx">     NotifyScrollerThumbIsVisibleInRect(WebCore::IntRect scrollerThumb)
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessiosPageClientImplIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h    2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h       2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -144,6 +144,8 @@
</span><span class="cx">     void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect& elementRect, WebCore::RouteSharingPolicy, const String&) override;
</span><span class="cx"> 
</span><span class="cx">     bool handleRunOpenPanel(WebPageProxy*, WebFrameProxy*, API::OpenPanelParameters*, WebOpenPanelResultListenerProxy*) override;
</span><ins>+    bool showShareSheet(const WebCore::ShareDataWithParsedURL&, WTF::CompletionHandler<void(bool)>&&) override;
+    
</ins><span class="cx">     void disableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID) override;
</span><span class="cx">     double minimumZoomScale() const override;
</span><span class="cx">     WebCore::FloatRect documentRect() const override;
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessiosPageClientImplIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm   2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm      2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -54,6 +54,7 @@
</span><span class="cx"> #import <WebCore/NotImplemented.h>
</span><span class="cx"> #import <WebCore/PlatformScreen.h>
</span><span class="cx"> #import <WebCore/PromisedAttachmentInfo.h>
</span><ins>+#import <WebCore/ShareData.h>
</ins><span class="cx"> #import <WebCore/SharedBuffer.h>
</span><span class="cx"> #import <WebCore/TextIndicator.h>
</span><span class="cx"> #import <WebCore/ValidationBubble.h>
</span><span class="lines">@@ -569,6 +570,12 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool PageClientImpl::showShareSheet(const ShareDataWithParsedURL& shareData, WTF::CompletionHandler<void(bool)>&& completionHandler)
+{
+    [m_contentView _showShareSheet:shareData completionHandler:WTFMove(completionHandler)];
+    return true;
+}
+
</ins><span class="cx"> void PageClientImpl::showInspectorHighlight(const WebCore::Highlight& highlight)
</span><span class="cx"> {
</span><span class="cx">     [m_contentView _showInspectorHighlight:highlight];
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessiosWKContentViewInteractionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h     2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h        2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -38,6 +38,7 @@
</span><span class="cx"> #import "WKFileUploadPanel.h"
</span><span class="cx"> #import "WKFormPeripheral.h"
</span><span class="cx"> #import "WKKeyboardScrollingAnimator.h"
</span><ins>+#import "WKShareSheet.h"
</ins><span class="cx"> #import "WKSyntheticClickTapGestureRecognizer.h"
</span><span class="cx"> #import <UIKit/UIView.h>
</span><span class="cx"> #import <WebCore/Color.h>
</span><span class="lines">@@ -62,6 +63,7 @@
</span><span class="cx"> class IntSize;
</span><span class="cx"> class SelectionRect;
</span><span class="cx"> struct PromisedAttachmentInfo;
</span><ins>+struct ShareDataWithParsedURL;
</ins><span class="cx"> enum class RouteSharingPolicy;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -174,6 +176,7 @@
</span><span class="cx"> #endif
</span><span class="cx">     RetainPtr<WKFormInputSession> _formInputSession;
</span><span class="cx">     RetainPtr<WKFileUploadPanel> _fileUploadPanel;
</span><ins>+    RetainPtr<WKShareSheet> _shareSheet;
</ins><span class="cx">     RetainPtr<UIGestureRecognizer> _previewGestureRecognizer;
</span><span class="cx">     RetainPtr<UIGestureRecognizer> _previewSecondaryGestureRecognizer;
</span><span class="cx">     Vector<bool> _focusStateStack;
</span><span class="lines">@@ -262,7 +265,7 @@
</span><span class="cx"> 
</span><span class="cx"> @end
</span><span class="cx"> 
</span><del>-@interface WKContentView (WKInteraction) <UIGestureRecognizerDelegate, UITextAutoscrolling, UITextInputMultiDocument, UITextInputPrivate, UIWebFormAccessoryDelegate, UIWebTouchEventsGestureRecognizerDelegate, UIWKInteractionViewProtocol, WKActionSheetAssistantDelegate, WKFileUploadPanelDelegate, WKKeyboardScrollable
</del><ins>+@interface WKContentView (WKInteraction) <UIGestureRecognizerDelegate, UITextAutoscrolling, UITextInputMultiDocument, UITextInputPrivate, UIWebFormAccessoryDelegate, UIWebTouchEventsGestureRecognizerDelegate, UIWKInteractionViewProtocol, WKActionSheetAssistantDelegate, WKFileUploadPanelDelegate, WKShareSheetDelegate, WKKeyboardScrollable
</ins><span class="cx"> #if ENABLE(DATA_INTERACTION)
</span><span class="cx">     , UIDragInteractionDelegate, UIDropInteractionDelegate
</span><span class="cx"> #endif
</span><span class="lines">@@ -317,6 +320,7 @@
</span><span class="cx"> - (void)_overflowScrollingDidEnd;
</span><span class="cx"> - (void)_showPlaybackTargetPicker:(BOOL)hasVideo fromRect:(const WebCore::IntRect&)elementRect routeSharingPolicy:(WebCore::RouteSharingPolicy)policy routingContextUID:(NSString *)contextUID;
</span><span class="cx"> - (void)_showRunOpenPanel:(API::OpenPanelParameters*)parameters resultListener:(WebKit::WebOpenPanelResultListenerProxy*)listener;
</span><ins>+- (void)_showShareSheet:(const WebCore::ShareDataWithParsedURL&)shareData completionHandler:(WTF::CompletionHandler<void(bool)>&&)completionHandler;
</ins><span class="cx"> - (void)accessoryDone;
</span><span class="cx"> - (void)_didHandleKeyEvent:(::WebEvent *)event eventWasHandled:(BOOL)eventWasHandled;
</span><span class="cx"> - (Vector<WebKit::OptionItem>&) assistedNodeSelectOptions;
</span><span class="lines">@@ -359,6 +363,7 @@
</span><span class="cx"> - (void)_simulateTextEntered:(NSString *)text;
</span><span class="cx"> - (void)selectFormAccessoryPickerRow:(NSInteger)rowIndex;
</span><span class="cx"> - (void)setTimePickerValueToHour:(NSInteger)hour minute:(NSInteger)minute;
</span><ins>+- (void)invokeShareSheetWithResolution:(BOOL)resolved;
</ins><span class="cx"> - (NSDictionary *)_contentsOfUserInterfaceItem:(NSString *)userInterfaceItem;
</span><span class="cx"> 
</span><span class="cx"> @property (nonatomic, readonly) NSString *textContentTypeForTesting;
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessiosWKContentViewInteractionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm    2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm       2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -84,6 +84,7 @@
</span><span class="cx"> #import <WebCore/PromisedAttachmentInfo.h>
</span><span class="cx"> #import <WebCore/RuntimeApplicationChecks.h>
</span><span class="cx"> #import <WebCore/Scrollbar.h>
</span><ins>+#import <WebCore/ShareData.h>
</ins><span class="cx"> #import <WebCore/TextIndicator.h>
</span><span class="cx"> #import <WebCore/VisibleSelection.h>
</span><span class="cx"> #import <WebCore/WebCoreNSURLExtras.h>
</span><span class="lines">@@ -779,6 +780,12 @@
</span><span class="cx">         _fileUploadPanel = nil;
</span><span class="cx">     }
</span><span class="cx">     
</span><ins>+    if (_shareSheet) {
+        [_shareSheet setDelegate:nil];
+        [_shareSheet dismiss];
+        _shareSheet = nil;
+    }
+    
</ins><span class="cx">     _inputViewUpdateDeferrer = nullptr;
</span><span class="cx">     _assistedNodeInformation = { };
</span><span class="cx">     
</span><span class="lines">@@ -4693,6 +4700,18 @@
</span><span class="cx">     [_fileUploadPanel presentWithParameters:parameters resultListener:listener];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)_showShareSheet:(const ShareDataWithParsedURL&)data completionHandler:(CompletionHandler<void(bool)>&&)completionHandler
+{
+    ASSERT(!_shareSheet);
+    if (_shareSheet)
+        return;
+    
+    _shareSheet = adoptNS([[WKShareSheet alloc] initWithView:self]);
+    [_shareSheet setDelegate:self];
+    
+    [_shareSheet presentWithParameters:data completionHandler:WTFMove(completionHandler)];
+}
+
</ins><span class="cx"> - (void)fileUploadPanelDidDismiss:(WKFileUploadPanel *)fileUploadPanel
</span><span class="cx"> {
</span><span class="cx">     ASSERT(_fileUploadPanel.get() == fileUploadPanel);
</span><span class="lines">@@ -4701,6 +4720,14 @@
</span><span class="cx">     _fileUploadPanel = nil;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)shareSheetDidDismiss:(WKShareSheet *)shareSheet
+{
+    ASSERT(_shareSheet == shareSheet);
+    
+    [_shareSheet setDelegate:nil];
+    _shareSheet = nil;
+}
+
</ins><span class="cx"> #pragma mark - UITextInputMultiDocument
</span><span class="cx"> 
</span><span class="cx"> - (void)_restoreFocusWithToken:(id <NSCopying, NSSecureCoding>)token
</span><span class="lines">@@ -5858,6 +5885,11 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)invokeShareSheetWithResolution:(BOOL)resolved
+{
+    [_shareSheet invokeShareSheetWithResolution:resolved];
+}
+
</ins><span class="cx"> - (NSDictionary *)_contentsOfUserInterfaceItem:(NSString *)userInterfaceItem
</span><span class="cx"> {
</span><span class="cx">     if ([userInterfaceItem isEqualToString:@"actionSheet"])
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessiosformsWKShareSheeth"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit/UIProcess/ios/forms/WKShareSheet.h (0 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/ios/forms/WKShareSheet.h                           (rev 0)
+++ trunk/Source/WebKit/UIProcess/ios/forms/WKShareSheet.h      2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if PLATFORM(IOS)
+
+#import <UIKit/UIKit.h>
+#import <WebCore/ShareData.h>
+#import <wtf/BlockPtr.h>
+#import <wtf/Forward.h>
+#import <wtf/Vector.h>
+#import <wtf/WeakObjCPtr.h>
+#import <wtf/text/WTFString.h>
+
+@class WKContentView;
+@protocol WKShareSheetDelegate;
+
+@interface WKShareSheet : UIViewController
+- (instancetype)initWithView:(WKContentView *)view;
+
+- (void)presentWithParameters:(const WebCore::ShareDataWithParsedURL&)data completionHandler:(WTF::CompletionHandler<void(bool)>&&)completionHandler;
+- (void)dismiss;
+- (void)invokeShareSheetWithResolution:(BOOL)resolved;
+
+@property (nonatomic, weak) id <WKShareSheetDelegate> delegate;
+@end
+
+@protocol WKShareSheetDelegate <NSObject>
+@optional
+- (void)shareSheetDidDismiss:(WKShareSheet *)shareSheet;
+@end
+
+#endif // PLATFORM(IOS)
</ins></span></pre></div>
<a id="trunkSourceWebKitUIProcessiosformsWKShareSheetmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit/UIProcess/ios/forms/WKShareSheet.mm (0 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/ios/forms/WKShareSheet.mm                          (rev 0)
+++ trunk/Source/WebKit/UIProcess/ios/forms/WKShareSheet.mm     2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -0,0 +1,130 @@
</span><ins>+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "WKShareSheet.h"
+
+#if PLATFORM(IOS)
+
+#import "UIKitSPI.h"
+#import "WKContentViewInteraction.h"
+#import "WebPageProxy.h"
+#import <WebCore/ShareData.h>
+#import <wtf/RetainPtr.h>
+#import <wtf/WeakObjCPtr.h>
+
+using namespace WebKit;
+
+@implementation WKShareSheet {
+    WeakObjCPtr<WKContentView> _view;
+
+    RetainPtr<UIActivityViewController> _shareSheetViewController;
+    RetainPtr<UIViewController> _presentationViewController;
+    BOOL _shouldDismissWithAnimation;
+}
+
+- (instancetype)initWithView:(WKContentView *)view
+{
+    if (!(self = [super init]))
+        return nil;
+    _view = view;
+    _shouldDismissWithAnimation = YES;
+    return self;
+}
+
+- (void)presentWithParameters:(const WebCore::ShareDataWithParsedURL &)data completionHandler:(WTF::CompletionHandler<void(bool)>&&)completionHandler
+{
+    auto shareDataArray = adoptNS([[NSMutableArray alloc] init]);
+    
+    if (!data.shareData.text.isEmpty())
+        [shareDataArray addObject:(NSString *)data.shareData.text];
+    
+    if (!data.url.isNull()) {
+        NSURL *url = (NSURL *)data.url;
+        if (!data.shareData.title.isEmpty())
+            url._title = data.shareData.title;
+        [shareDataArray addObject:url];
+    }
+    
+    if (!data.shareData.title.isEmpty() && ![shareDataArray count])
+        [shareDataArray addObject:(NSString *)data.shareData.title];
+    
+    auto shareSheetController = adoptNS([[UIActivityViewController alloc] initWithActivityItems:shareDataArray.get() applicationActivities:nil]);
+
+    auto completionHandlerBlock = BlockPtr<void((NSString *, BOOL completed, NSArray *, NSError *))>::fromCallable([completionHandler = WTFMove(completionHandler), shareSheet = self](NSString *, BOOL completed, NSArray *, NSError *) mutable {
+        completionHandler(completed);
+        [shareSheet dismiss];
+    });
+    
+    shareSheetController.get().completionWithItemsHandler = completionHandlerBlock.get();
+    _shareSheetViewController = WTFMove(shareSheetController);
+    [self _presentFullscreenViewController:_shareSheetViewController.get() animated:YES];
+}
+
+- (void)_dispatchDidDismiss
+{
+    if ([_delegate respondsToSelector:@selector(shareSheetDidDismiss:)])
+        [_delegate shareSheetDidDismiss:self];
+}
+
+- (void)_cancel
+{
+    [self _dispatchDidDismiss];
+}
+
+- (void)dismiss
+{
+    [[UIViewController _viewControllerForFullScreenPresentationFromView:_view.getAutoreleased()] dismissViewControllerAnimated:_shouldDismissWithAnimation completion:nil];
+    _presentationViewController = nil;
+    
+    [self _cancel];
+}
+
+- (void)_dismissDisplayAnimated:(BOOL)animated
+{
+    if (_presentationViewController) {
+        UIViewController *currentPresentedViewController = [_presentationViewController presentedViewController];
+        if (currentPresentedViewController == self) {
+            [currentPresentedViewController dismissViewControllerAnimated:animated completion:^{
+                _presentationViewController = nil;
+            }];
+        }
+    }
+}
+
+- (void)_presentFullscreenViewController:(UIViewController *)viewController animated:(BOOL)animated
+{
+    _presentationViewController = [UIViewController _viewControllerForFullScreenPresentationFromView:_view.getAutoreleased()];
+    [_presentationViewController presentViewController:viewController animated:animated completion:nil];
+}
+
+- (void)invokeShareSheetWithResolution:(BOOL)resolved
+{
+    _shouldDismissWithAnimation = NO;
+    _shareSheetViewController.get().completionWithItemsHandler(nil, resolved, nil, nil);
+}
+
+@end
+#endif // PLATFORM(IOS)
</ins></span></pre></div>
<a id="trunkSourceWebKitWebKitxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj     2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj        2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -439,6 +439,9 @@
</span><span class="cx">          1CA8B946127C882A00576C2B /* WebInspectorProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CA8B944127C882A00576C2B /* WebInspectorProxyMessages.h */; };
</span><span class="cx">          1CBBE4A019B66C53006B7D81 /* WebInspectorUIMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1CBBE49E19B66C53006B7D81 /* WebInspectorUIMessageReceiver.cpp */; };
</span><span class="cx">          1CBBE4A119B66C53006B7D81 /* WebInspectorUIMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CBBE49F19B66C53006B7D81 /* WebInspectorUIMessages.h */; };
</span><ins>+               1D67B339212E1F6100FAA786 /* ShareSheetCallbackID.h in Headers */ = {isa = PBXBuildFile; fileRef = 1D67B338212E1F6100FAA786 /* ShareSheetCallbackID.h */; };
+               1DB01943211CF002009FB3E8 /* WKShareSheet.h in Headers */ = {isa = PBXBuildFile; fileRef = 1DE0D095211CC21300439B5F /* WKShareSheet.h */; };
+               1DB01944211CF005009FB3E8 /* WKShareSheet.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1DBBB061211CC3CB00502ECC /* WKShareSheet.mm */; };
</ins><span class="cx">           1F335BC0185B84F0001A201A /* WKWebProcessPlugInLoadDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F335BBF185B84D8001A201A /* WKWebProcessPlugInLoadDelegate.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          1F604BAA1889FBB800EE0395 /* _WKRenderingProgressEventsInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F604BA71889FA7400EE0395 /* _WKRenderingProgressEventsInternal.h */; };
</span><span class="cx">          1F7506B11859163700EC0FF7 /* WKWebProcessPlugInFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F0181691858DC1500F92884 /* WKWebProcessPlugInFrame.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -2643,6 +2646,9 @@
</span><span class="cx">          1CBBE49E19B66C53006B7D81 /* WebInspectorUIMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebInspectorUIMessageReceiver.cpp; sourceTree = "<group>"; };
</span><span class="cx">          1CBBE49F19B66C53006B7D81 /* WebInspectorUIMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebInspectorUIMessages.h; sourceTree = "<group>"; };
</span><span class="cx">          1CC417C912C00CCA002BE67B /* TextCheckerCompletion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextCheckerCompletion.h; sourceTree = "<group>"; };
</span><ins>+               1D67B338212E1F6100FAA786 /* ShareSheetCallbackID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShareSheetCallbackID.h; sourceTree = "<group>"; };
+               1DBBB061211CC3CB00502ECC /* WKShareSheet.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WKShareSheet.mm; path = ios/forms/WKShareSheet.mm; sourceTree = "<group>"; };
+               1DE0D095211CC21300439B5F /* WKShareSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKShareSheet.h; path = ios/forms/WKShareSheet.h; sourceTree = "<group>"; };
</ins><span class="cx">           1F0181691858DC1500F92884 /* WKWebProcessPlugInFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebProcessPlugInFrame.h; sourceTree = "<group>"; };
</span><span class="cx">          1F01816A1858DC1500F92884 /* WKWebProcessPlugInFrame.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebProcessPlugInFrame.mm; sourceTree = "<group>"; };
</span><span class="cx">          1F01816B1858DC1500F92884 /* WKWebProcessPlugInFrameInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebProcessPlugInFrameInternal.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -5241,6 +5247,7 @@
</span><span class="cx">                          8313F7E71F7DAE0300B944EB /* SharedStringHashTable.h */,
</span><span class="cx">                          83F9644B1FA0F76200C47750 /* SharedStringHashTableReadOnly.cpp */,
</span><span class="cx">                          83F9644C1FA0F76300C47750 /* SharedStringHashTableReadOnly.h */,
</span><ins>+                               1D67B338212E1F6100FAA786 /* ShareSheetCallbackID.h */,
</ins><span class="cx">                           5272B2881406985D0096A5D0 /* StatisticsData.cpp */,
</span><span class="cx">                          5272B2891406985D0096A5D0 /* StatisticsData.h */,
</span><span class="cx">                          1A5E4DA312D3BD3D0099A2BB /* TextCheckerState.h */,
</span><span class="lines">@@ -8713,6 +8720,8 @@
</span><span class="cx">                          F4D5F51C206087A10038BBA8 /* WKQuickboardListViewController.mm */,
</span><span class="cx">                          F4F59AD42065A5CA006CAA46 /* WKSelectMenuListViewController.h */,
</span><span class="cx">                          F4F59AD32065A5C9006CAA46 /* WKSelectMenuListViewController.mm */,
</span><ins>+                               1DE0D095211CC21300439B5F /* WKShareSheet.h */,
+                               1DBBB061211CC3CB00502ECC /* WKShareSheet.mm */,
</ins><span class="cx">                           F4D5F519206087A00038BBA8 /* WKTextInputListViewController.h */,
</span><span class="cx">                          F4D5F51A206087A10038BBA8 /* WKTextInputListViewController.mm */,
</span><span class="cx">                          2EB6FBFF203021960017E619 /* WKTimePickerViewController.h */,
</span><span class="lines">@@ -9395,6 +9404,7 @@
</span><span class="cx">                          8313F7EC1F7DAE0800B944EB /* SharedStringHashStore.h in Headers */,
</span><span class="cx">                          8313F7EE1F7DAE0800B944EB /* SharedStringHashTable.h in Headers */,
</span><span class="cx">                          83F9644E1FA0F76E00C47750 /* SharedStringHashTableReadOnly.h in Headers */,
</span><ins>+                               1D67B339212E1F6100FAA786 /* ShareSheetCallbackID.h in Headers */,
</ins><span class="cx">                           995226D6207D184600F78420 /* SimulatedInputDispatcher.h in Headers */,
</span><span class="cx">                          2DAF06D618BD1A470081CEB1 /* SmartMagnificationController.h in Headers */,
</span><span class="cx">                          2DE6943E18BD2A68005C15E5 /* SmartMagnificationControllerMessages.h in Headers */,
</span><span class="lines">@@ -9933,6 +9943,7 @@
</span><span class="cx">                          BC407604124FF0270068F20A /* WKSerializedScriptValue.h in Headers */,
</span><span class="cx">                          1ADE46B31954EC61000F7985 /* WKSessionStateRef.h in Headers */,
</span><span class="cx">                          BCDDB32B124EC2AB0048D13C /* WKSharedAPICast.h in Headers */,
</span><ins>+                               1DB01943211CF002009FB3E8 /* WKShareSheet.h in Headers */,
</ins><span class="cx">                           513E462D1AD837560016234A /* WKSharingServicePickerDelegate.h in Headers */,
</span><span class="cx">                          93F549B41E3174B7000E7239 /* WKSnapshotConfiguration.h in Headers */,
</span><span class="cx">                          BC407606124FF0270068F20A /* WKString.h in Headers */,
</span><span class="lines">@@ -11389,6 +11400,8 @@
</span><span class="cx">                          51CD1C5D1B3493AF00142CA5 /* WKSecurityOriginRef.cpp in Sources */,
</span><span class="cx">                          BC407603124FF0270068F20A /* WKSerializedScriptValue.cpp in Sources */,
</span><span class="cx">                          1ADE46B21954EC61000F7985 /* WKSessionStateRef.cpp in Sources */,
</span><ins>+                               1DB01944211CF005009FB3E8 /* WKShareSheet.mm in Sources */,
+                               513E462E1AD837560016234A /* WKSharingServicePickerDelegate.mm in Sources */,
</ins><span class="cx">                           93F549B61E3174DA000E7239 /* WKSnapshotConfiguration.mm in Sources */,
</span><span class="cx">                          BC407605124FF0270068F20A /* WKString.cpp in Sources */,
</span><span class="cx">                          BC407619124FF0370068F20A /* WKStringCF.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebCoreSupportWebChromeClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp        2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp   2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -810,6 +810,11 @@
</span><span class="cx">     ASSERT(webFrame);
</span><span class="cx">     m_page.send(Messages::WebPageProxy::RunOpenPanel(webFrame->frameID(), SecurityOriginData::fromFrame(&frame), fileChooser.settings()));
</span><span class="cx"> }
</span><ins>+    
+void WebChromeClient::showShareSheet(ShareDataWithParsedURL& shareData, CompletionHandler<void(bool)>&& callback)
+{
+    m_page.showShareSheet(shareData, WTFMove(callback));
+}
</ins><span class="cx"> 
</span><span class="cx"> void WebChromeClient::loadIconForFiles(const Vector<String>& filenames, FileIconLoader& loader)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebCoreSupportWebChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h  2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h     2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -187,6 +187,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     void runOpenPanel(WebCore::Frame&, WebCore::FileChooser&) final;
</span><ins>+    void showShareSheet(WebCore::ShareDataWithParsedURL&, WTF::CompletionHandler<void(bool)>&&) final;
</ins><span class="cx">     void loadIconForFiles(const Vector<String>&, WebCore::FileIconLoader&) final;
</span><span class="cx"> 
</span><span class="cx"> #if !PLATFORM(IOS)
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp       2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp  2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -61,6 +61,7 @@
</span><span class="cx"> #include "SessionState.h"
</span><span class="cx"> #include "SessionStateConversion.h"
</span><span class="cx"> #include "SessionTracker.h"
</span><ins>+#include "ShareSheetCallbackID.h"
</ins><span class="cx"> #include "ShareableBitmap.h"
</span><span class="cx"> #include "UserMediaPermissionRequestManager.h"
</span><span class="cx"> #include "ViewGestureGeometryCollector.h"
</span><span class="lines">@@ -6063,7 +6064,30 @@
</span><span class="cx">     callback(wasGranted);
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><ins>+    
+static ShareSheetCallbackID nextShareSheetCallbackID()
+{
+    static ShareSheetCallbackID nextCallbackID = 0;
+    return ++nextCallbackID;
+}
+    
+void WebPage::showShareSheet(ShareDataWithParsedURL& shareData, WTF::CompletionHandler<void(bool)>&& callback)
+{
+    ShareSheetCallbackID callbackID = nextShareSheetCallbackID();
+    auto addResult = m_shareSheetResponseCallbackMap.add(callbackID, WTFMove(callback));
+    ASSERT(addResult.isNewEntry);
+    if (addResult.iterator->value)
+        send(Messages::WebPageProxy::ShowShareSheet(WTFMove(shareData), callbackID));
+    else
+        callback(false);
+}
</ins><span class="cx"> 
</span><ins>+void WebPage::didCompleteShareSheet(bool wasGranted, ShareSheetCallbackID callbackID)
+{
+    auto callback = m_shareSheetResponseCallbackMap.take(callbackID);
+    callback(wasGranted);
+}
+
</ins><span class="cx"> #if ENABLE(ATTACHMENT_ELEMENT)
</span><span class="cx"> 
</span><span class="cx"> void WebPage::insertAttachment(const String& identifier, std::optional<uint64_t>&& fileSize, const String& fileName, const String& contentType, CallbackID callbackID)
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h 2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h    2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx"> #include "OptionalCallbackID.h"
</span><span class="cx"> #include "Plugin.h"
</span><span class="cx"> #include "SandboxExtension.h"
</span><ins>+#include "ShareSheetCallbackID.h"
</ins><span class="cx"> #include "SharedMemory.h"
</span><span class="cx"> #include "UserData.h"
</span><span class="cx"> #include "WebBackForwardListProxy.h"
</span><span class="lines">@@ -61,6 +62,7 @@
</span><span class="cx"> #include <WebCore/PageOverlay.h>
</span><span class="cx"> #include <WebCore/PluginData.h>
</span><span class="cx"> #include <WebCore/SecurityPolicyViolationEvent.h>
</span><ins>+#include <WebCore/ShareData.h>
</ins><span class="cx"> #include <WebCore/UserActivity.h>
</span><span class="cx"> #include <WebCore/UserContentTypes.h>
</span><span class="cx"> #include <WebCore/UserInterfaceLayoutDirection.h>
</span><span class="lines">@@ -1071,6 +1073,9 @@
</span><span class="cx">     void storageAccessResponse(bool wasGranted, uint64_t contextId);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    void showShareSheet(WebCore::ShareDataWithParsedURL&, WTF::CompletionHandler<void(bool)>&& callback);
+    void didCompleteShareSheet(bool wasCompleted, ShareSheetCallbackID contextId);
+    
</ins><span class="cx"> #if ENABLE(ATTACHMENT_ELEMENT)
</span><span class="cx">     void insertAttachment(const String& identifier, std::optional<uint64_t>&& fileSize, const String& fileName, const String& contentType, CallbackID);
</span><span class="cx">     void updateAttachmentAttributes(const String& identifier, std::optional<uint64_t>&& fileSize, const String& contentType, const String& fileName, CallbackID);
</span><span class="lines">@@ -1724,7 +1729,8 @@
</span><span class="cx">     HashMap<String, RefPtr<WebURLSchemeHandlerProxy>> m_schemeToURLSchemeHandlerProxyMap;
</span><span class="cx">     HashMap<uint64_t, WebURLSchemeHandlerProxy*> m_identifierToURLSchemeHandlerProxyMap;
</span><span class="cx"> 
</span><del>-    HashMap<uint64_t, WTF::Function<void (bool granted)>> m_storageAccessResponseCallbackMap;
</del><ins>+    HashMap<uint64_t, WTF::Function<void(bool granted)>> m_storageAccessResponseCallbackMap;
+    HashMap<ShareSheetCallbackID, WTF::Function<void(bool completed)>> m_shareSheetResponseCallbackMap;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(APPLICATION_MANIFEST)
</span><span class="cx">     HashMap<uint64_t, uint64_t> m_applicationManifestFetchCallbackMap;
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageWebPagemessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in       2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in  2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -290,6 +290,7 @@
</span><span class="cx"> #endif
</span><span class="cx">     DidChooseFilesForOpenPanel(Vector<String> fileURLs)
</span><span class="cx">     DidCancelForOpenPanel()
</span><ins>+    DidCompleteShareSheet(bool wasGranted, uint64_t callbackID)
</ins><span class="cx"> #if ENABLE(SANDBOX_EXTENSIONS)
</span><span class="cx">     ExtendSandboxForFilesFromOpenPanel(WebKit::SandboxExtension::HandleArray sandboxExtensions)
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKitLegacyiosChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/ios/ChangeLog (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/ios/ChangeLog  2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebKitLegacy/ios/ChangeLog     2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2018-08-29  Olivia Barnett  <obarnett@apple.com>
+
+        Implement the Web Share API
+        https://bugs.webkit.org/show_bug.cgi?id=171100
+        <rdar://problem/31751734>
+
+        Reviewed by Tim Horton.
+
+        * WebCoreSupport/WebChromeClientIOS.h:
+        * WebCoreSupport/WebChromeClientIOS.mm:
+        (WebChromeClientIOS::showShareSheet):
+        Empty declaration of showShareSheet.
+
</ins><span class="cx"> 2018-08-24  Ryosuke Niwa  <rniwa@webkit.org>
</span><span class="cx"> 
</span><span class="cx">         Pass in IsComposed flag to Event constructors
</span></span></pre></div>
<a id="trunkSourceWebKitLegacyiosWebCoreSupportWebChromeClientIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebChromeClientIOS.h (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebChromeClientIOS.h        2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebChromeClientIOS.h   2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -47,6 +47,7 @@
</span><span class="cx">     bool runJavaScriptPrompt(WebCore::Frame&, const WTF::String& message, const WTF::String& defaultValue, WTF::String& result) final;
</span><span class="cx"> 
</span><span class="cx">     void runOpenPanel(WebCore::Frame&, WebCore::FileChooser&) final;
</span><ins>+    void showShareSheet(WebCore::ShareDataWithParsedURL&, CompletionHandler<void(bool)>&&) final;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(TOUCH_EVENTS)
</span><span class="cx">     void didPreventDefaultForEvent() final;
</span></span></pre></div>
<a id="trunkSourceWebKitLegacyiosWebCoreSupportWebChromeClientIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebChromeClientIOS.mm (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebChromeClientIOS.mm       2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebChromeClientIOS.mm  2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -157,6 +157,10 @@
</span><span class="cx">     [listener release];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebChromeClientIOS::showShareSheet(ShareDataWithParsedURL&, CompletionHandler<void(bool)>&&)
+{
+}
+
</ins><span class="cx"> #if ENABLE(IOS_TOUCH_EVENTS)
</span><span class="cx"> 
</span><span class="cx"> void WebChromeClientIOS::didPreventDefaultForEvent()
</span></span></pre></div>
<a id="trunkSourceWebKitLegacymacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/mac/ChangeLog  2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog     2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2018-08-29  Olivia Barnett  <obarnett@apple.com>
+
+        Implement the Web Share API
+        https://bugs.webkit.org/show_bug.cgi?id=171100
+        <rdar://problem/31751734>
+
+        Reviewed by Tim Horton.
+
+        * WebCoreSupport/WebChromeClient.h:
+        * WebCoreSupport/WebChromeClient.mm:
+        (WebChromeClient::showShareSheet):
+        Empty declaration of showShareSheet.
+
</ins><span class="cx"> 2018-08-29  Youenn Fablet  <youenn@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Remove WebRTC legacy API implementation
</span></span></pre></div>
<a id="trunkSourceWebKitLegacymacWebCoreSupportWebChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h   2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h      2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -126,6 +126,8 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     void runOpenPanel(WebCore::Frame&, WebCore::FileChooser&) override;
</span><ins>+    void showShareSheet(WebCore::ShareDataWithParsedURL&, CompletionHandler<void(bool)>&&) override;
+
</ins><span class="cx">     void loadIconForFiles(const Vector<String>&, WebCore::FileIconLoader&) final;
</span><span class="cx">     RefPtr<WebCore::Icon> createIconForFiles(const Vector<String>& filenames) override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitLegacymacWebCoreSupportWebChromeClientmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm  2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm     2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -776,6 +776,10 @@
</span><span class="cx">     END_BLOCK_OBJC_EXCEPTIONS;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebChromeClient::showShareSheet(ShareDataWithParsedURL&, CompletionHandler<void(bool)>&&)
+{
+}
+
</ins><span class="cx"> void WebChromeClient::loadIconForFiles(const Vector<String>& filenames, FileIconLoader& iconLoader)
</span><span class="cx"> {
</span><span class="cx">     iconLoader.iconLoaded(createIconForFiles(filenames));
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeiosUIScriptControllerIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm  2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm     2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -159,6 +159,10 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void UIScriptController::invokeShareSheetWithResolution(bool)
+{
+}
+
</ins><span class="cx"> void UIScriptController::selectFormAccessoryPickerRow(long rowIndex)
</span><span class="cx"> {
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkToolsTestRunnerSharedUIScriptContextBindingsUIScriptControlleridl"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl     2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl        2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -193,6 +193,9 @@
</span><span class="cx"> 
</span><span class="cx">     void setTimePickerValue(long hour, long minute);
</span><span class="cx"> 
</span><ins>+    // Share sheet
+    void invokeShareSheetWithResolution(boolean resolved);
+
</ins><span class="cx">     // <datalist>
</span><span class="cx">     readonly attribute boolean isShowingDataListSuggestions;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsTestRunnerSharedUIScriptContextUIScriptControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp      2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp 2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -294,6 +294,10 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void UIScriptController::invokeShareSheetWithResolution(bool)
+{
+}
+
</ins><span class="cx"> void UIScriptController::selectFormAccessoryPickerRow(long)
</span><span class="cx"> {
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkToolsTestRunnerSharedUIScriptContextUIScriptControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h        2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h   2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -101,6 +101,8 @@
</span><span class="cx">     JSRetainPtr<JSStringRef> formInputLabel() const;
</span><span class="cx">     void setTimePickerValue(long hour, long minute);
</span><span class="cx"> 
</span><ins>+    void invokeShareSheetWithResolution(bool resolved);
+
</ins><span class="cx">     bool isShowingDataListSuggestions() const;
</span><span class="cx"> 
</span><span class="cx">     JSObjectRef contentsOfUserInterfaceItem(JSStringRef) const;
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunneriosUIScriptControllerIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm (235488 => 235489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm        2018-08-30 00:04:30 UTC (rev 235488)
+++ trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm   2018-08-30 00:20:26 UTC (rev 235489)
</span><span class="lines">@@ -409,6 +409,12 @@
</span><span class="cx">     TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView();
</span><span class="cx">     [webView setTimePickerValueToHour:hour minute:minute];
</span><span class="cx"> }
</span><ins>+
+void UIScriptController::invokeShareSheetWithResolution(bool resolved)
+{
+    TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView();
+    [webView _invokeShareSheetWithResolution:resolved];
+}
</ins><span class="cx">     
</span><span class="cx"> JSObjectRef UIScriptController::contentsOfUserInterfaceItem(JSStringRef interfaceItem) const
</span><span class="cx"> {
</span></span></pre>
</div>
</div>

</body>
</html>