<!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>[213627] trunk/Source</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/213627">213627</a></dd>
<dt>Author</dt> <dd>wenson_hsieh@apple.com</dd>
<dt>Date</dt> <dd>2017-03-08 21:16:20 -0800 (Wed, 08 Mar 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add plumbing for WebCore to notify WebKit2 when an edit drag has concluded
https://bugs.webkit.org/show_bug.cgi?id=169392
&lt;rdar://problem/30882974&gt;

Reviewed by Tim Horton.

Source/WebCore:

Add DragClient::didConcludeEditDrag and invoke it after performing an edit drag in
DragController::performDragOperation.

* page/DragClient.h:
(WebCore::DragClient::didConcludeEditDrag):
* page/DragController.cpp:
(WebCore::DragController::performDragOperation):

Source/WebKit/mac:

Add a stub implementation of WebDragClient::didConcludeEditDrag.

* WebCoreSupport/WebDragClient.h:

Source/WebKit2:

Add boilerplate plumbing for didConcludeEditDataInteraction from the web process to the UI process. Also makes
some minor tweaks to WKContentView along the way.

* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::didConcludeEditDataInteraction):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:

Bail out of zooming to the focus rect when performing a data interaction operation. This needs to eventually
work, but is not high priority at the moment.

(-[WKContentView becomeFirstResponderForWebView]):
(-[WKContentView _displayFormNodeInputView]):
(-[WKContentView useSelectionAssistantWithMode:]):
(-[WKContentView _updateChangedSelection:]):
(-[WKContentView suppressAssistantSelectionView]):
(-[WKContentView setSuppressAssistantSelectionView:]):

Add a mechanism for suppressing the text interaction assistant's selection view. If the text interaction
assistant exists while beginning or ending suppression, the selection will be deactivated or activated. If there
is not text interaction assistant, then we instead remember whether or not we should be suppressing the
selection, and bail out of activating the selection if so.

* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::didConcludeEditDataInteraction):
* WebProcess/WebCoreSupport/WebDragClient.h:
* WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::WebDragClient::didConcludeEditDrag):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::didConcludeEditDataInteraction):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorepageDragClienth">trunk/Source/WebCore/page/DragClient.h</a></li>
<li><a href="#trunkSourceWebCorepageDragControllercpp">trunk/Source/WebCore/page/DragController.cpp</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebDragClienth">trunk/Source/WebKit/mac/WebCoreSupport/WebDragClient.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessPageClienth">trunk/Source/WebKit2/UIProcess/PageClient.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxymessagesin">trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosPageClientImplIOSh">trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosPageClientImplIOSmm">trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWKContentViewInteractionh">trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWKContentViewInteractionmm">trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWebPageProxyIOSmm">trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebDragClienth">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebDragClient.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportgtkWebDragClientGtkcpp">trunk/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportmacWebDragClientMacmm">trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPageh">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm">trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (213626 => 213627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-03-09 04:55:56 UTC (rev 213626)
+++ trunk/Source/WebCore/ChangeLog        2017-03-09 05:16:20 UTC (rev 213627)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2017-03-08  Wenson Hsieh  &lt;wenson_hsieh@apple.com&gt;
+
+        Add plumbing for WebCore to notify WebKit2 when an edit drag has concluded
+        https://bugs.webkit.org/show_bug.cgi?id=169392
+        &lt;rdar://problem/30882974&gt;
+
+        Reviewed by Tim Horton.
+
+        Add DragClient::didConcludeEditDrag and invoke it after performing an edit drag in
+        DragController::performDragOperation.
+
+        * page/DragClient.h:
+        (WebCore::DragClient::didConcludeEditDrag):
+        * page/DragController.cpp:
+        (WebCore::DragController::performDragOperation):
+
</ins><span class="cx"> 2017-03-08  Matt Baker  &lt;mattbaker@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Add DOM breakpoints UI for node/subtree modification events
</span></span></pre></div>
<a id="trunkSourceWebCorepageDragClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DragClient.h (213626 => 213627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DragClient.h        2017-03-09 04:55:56 UTC (rev 213626)
+++ trunk/Source/WebCore/page/DragClient.h        2017-03-09 05:16:20 UTC (rev 213627)
</span><span class="lines">@@ -46,6 +46,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void willPerformDragDestinationAction(DragDestinationAction, const DragData&amp;) = 0;
</span><span class="cx">     virtual void willPerformDragSourceAction(DragSourceAction, const IntPoint&amp;, DataTransfer&amp;) = 0;
</span><ins>+    virtual void didConcludeEditDrag() { }
</ins><span class="cx">     virtual DragDestinationAction actionMaskForDrag(const DragData&amp;) = 0;
</span><span class="cx">     virtual DragSourceAction dragSourceActionMaskForPoint(const IntPoint&amp; rootViewPoint) = 0;
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCorepageDragControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DragController.cpp (213626 => 213627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DragController.cpp        2017-03-09 04:55:56 UTC (rev 213626)
+++ trunk/Source/WebCore/page/DragController.cpp        2017-03-09 05:16:20 UTC (rev 213627)
</span><span class="lines">@@ -246,6 +246,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if ((m_dragDestinationAction &amp; DragDestinationActionEdit) &amp;&amp; concludeEditDrag(dragData)) {
</span><ins>+        m_client.didConcludeEditDrag();
</ins><span class="cx">         m_documentUnderMouse = nullptr;
</span><span class="cx">         return true;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (213626 => 213627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2017-03-09 04:55:56 UTC (rev 213626)
+++ trunk/Source/WebKit/mac/ChangeLog        2017-03-09 05:16:20 UTC (rev 213627)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2017-03-08  Wenson Hsieh  &lt;wenson_hsieh@apple.com&gt;
+
+        Add plumbing for WebCore to notify WebKit2 when an edit drag has concluded
+        https://bugs.webkit.org/show_bug.cgi?id=169392
+        &lt;rdar://problem/30882974&gt;
+
+        Reviewed by Tim Horton.
+
+        Add a stub implementation of WebDragClient::didConcludeEditDrag.
+
+        * WebCoreSupport/WebDragClient.h:
+
</ins><span class="cx"> 2017-03-08  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Simplify the PaymentCoordinator interface
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebDragClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebDragClient.h (213626 => 213627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebDragClient.h        2017-03-09 04:55:56 UTC (rev 213626)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebDragClient.h        2017-03-09 05:16:20 UTC (rev 213627)
</span><span class="lines">@@ -48,6 +48,7 @@
</span><span class="cx"> #if ENABLE(ATTACHMENT_ELEMENT)
</span><span class="cx">     void declareAndWriteAttachment(const String&amp; pasteboardName, WebCore::Element&amp;, const WebCore::URL&amp;, const String&amp; path, WebCore::Frame*) override;
</span><span class="cx"> #endif
</span><ins>+    void didConcludeEditDrag() override { }
</ins><span class="cx"> private:
</span><span class="cx">     WebView* m_webView;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (213626 => 213627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2017-03-09 04:55:56 UTC (rev 213626)
+++ trunk/Source/WebKit2/ChangeLog        2017-03-09 05:16:20 UTC (rev 213627)
</span><span class="lines">@@ -1,3 +1,48 @@
</span><ins>+2017-03-08  Wenson Hsieh  &lt;wenson_hsieh@apple.com&gt;
+
+        Add plumbing for WebCore to notify WebKit2 when an edit drag has concluded
+        https://bugs.webkit.org/show_bug.cgi?id=169392
+        &lt;rdar://problem/30882974&gt;
+
+        Reviewed by Tim Horton.
+
+        Add boilerplate plumbing for didConcludeEditDataInteraction from the web process to the UI process. Also makes
+        some minor tweaks to WKContentView along the way.
+
+        * UIProcess/PageClient.h:
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/ios/PageClientImplIOS.h:
+        * UIProcess/ios/PageClientImplIOS.mm:
+        (WebKit::PageClientImpl::didConcludeEditDataInteraction):
+        * UIProcess/ios/WKContentViewInteraction.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+
+        Bail out of zooming to the focus rect when performing a data interaction operation. This needs to eventually
+        work, but is not high priority at the moment.
+
+        (-[WKContentView becomeFirstResponderForWebView]):
+        (-[WKContentView _displayFormNodeInputView]):
+        (-[WKContentView useSelectionAssistantWithMode:]):
+        (-[WKContentView _updateChangedSelection:]):
+        (-[WKContentView suppressAssistantSelectionView]):
+        (-[WKContentView setSuppressAssistantSelectionView:]):
+
+        Add a mechanism for suppressing the text interaction assistant's selection view. If the text interaction
+        assistant exists while beginning or ending suppression, the selection will be deactivated or activated. If there
+        is not text interaction assistant, then we instead remember whether or not we should be suppressing the
+        selection, and bail out of activating the selection if so.
+
+        * UIProcess/ios/WebPageProxyIOS.mm:
+        (WebKit::WebPageProxy::didConcludeEditDataInteraction):
+        * WebProcess/WebCoreSupport/WebDragClient.h:
+        * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
+        * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
+        (WebKit::WebDragClient::didConcludeEditDrag):
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::didConcludeEditDataInteraction):
+
</ins><span class="cx"> 2017-03-08  John Wilander  &lt;wilander@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Resource Load Statistics: Communicate to the network process which domains to partition
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessPageClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/PageClient.h (213626 => 213627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/PageClient.h        2017-03-09 04:55:56 UTC (rev 213626)
+++ trunk/Source/WebKit2/UIProcess/PageClient.h        2017-03-09 05:16:20 UTC (rev 213627)
</span><span class="lines">@@ -384,6 +384,7 @@
</span><span class="cx">     virtual void didPerformDataInteractionControllerOperation() = 0;
</span><span class="cx">     virtual void didHandleStartDataInteractionRequest(bool started) = 0;
</span><span class="cx">     virtual void startDataInteractionWithImage(const WebCore::IntPoint&amp; clientPosition, const ShareableBitmap::Handle&amp; image, std::optional&lt;WebCore::TextIndicatorData&gt;, const WebCore::FloatPoint&amp; anchorPoint, uint64_t action) = 0;
</span><ins>+    virtual void didConcludeEditDataInteraction(std::optional&lt;WebCore::TextIndicatorData&gt;) = 0;
</ins><span class="cx"> #endif
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (213626 => 213627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2017-03-09 04:55:56 UTC (rev 213626)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2017-03-09 05:16:20 UTC (rev 213627)
</span><span class="lines">@@ -562,6 +562,7 @@
</span><span class="cx">     void didPerformDataInteractionControllerOperation();
</span><span class="cx">     void didHandleStartDataInteractionRequest(bool started);
</span><span class="cx">     void requestStartDataInteraction(const WebCore::IntPoint&amp; clientPosition, const WebCore::IntPoint&amp; globalPosition);
</span><ins>+    void didConcludeEditDataInteraction(std::optional&lt;WebCore::TextIndicatorData&gt;);
</ins><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> #if ENABLE(DATA_DETECTION)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (213626 => 213627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2017-03-09 04:55:56 UTC (rev 213626)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2017-03-09 05:16:20 UTC (rev 213627)
</span><span class="lines">@@ -311,6 +311,7 @@
</span><span class="cx"> #if ENABLE(DATA_INTERACTION)
</span><span class="cx">     DidPerformDataInteractionControllerOperation()
</span><span class="cx">     DidHandleStartDataInteractionRequest(bool started)
</span><ins>+    DidConcludeEditDataInteraction(std::optional&lt;WebCore::TextIndicatorData&gt; textIndicator)
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosPageClientImplIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h (213626 => 213627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h        2017-03-09 04:55:56 UTC (rev 213626)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h        2017-03-09 05:16:20 UTC (rev 213627)
</span><span class="lines">@@ -206,6 +206,7 @@
</span><span class="cx">     void didPerformDataInteractionControllerOperation() override;
</span><span class="cx">     void didHandleStartDataInteractionRequest(bool started) override;
</span><span class="cx">     void startDataInteractionWithImage(const WebCore::IntPoint&amp; clientPosition, const ShareableBitmap::Handle&amp; image, std::optional&lt;WebCore::TextIndicatorData&gt;, const WebCore::FloatPoint&amp; anchorPoint, uint64_t action) override;
</span><ins>+    void didConcludeEditDataInteraction(std::optional&lt;WebCore::TextIndicatorData&gt;) override;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     WKContentView *m_contentView;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosPageClientImplIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm (213626 => 213627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm        2017-03-09 04:55:56 UTC (rev 213626)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm        2017-03-09 05:16:20 UTC (rev 213627)
</span><span class="lines">@@ -785,6 +785,11 @@
</span><span class="cx"> {
</span><span class="cx">     [m_contentView _startDataInteractionWithImage:ShareableBitmap::create(image)-&gt;makeCGImageCopy() withIndicatorData:indicatorData atClientPosition:CGPointMake(clientPosition.x(), clientPosition.y()) anchorPoint:anchorPoint action:action];
</span><span class="cx"> }
</span><ins>+
+void PageClientImpl::didConcludeEditDataInteraction(std::optional&lt;TextIndicatorData&gt; data)
+{
+    [m_contentView _didConcludeEditDataInteraction:data];
+}
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::handleActiveNowPlayingSessionInfoResponse(bool hasActiveSession, const String&amp; title, double duration, double elapsedTime)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewInteractionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h (213626 => 213627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h        2017-03-09 04:55:56 UTC (rev 213626)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h        2017-03-09 05:16:20 UTC (rev 213627)
</span><span class="lines">@@ -122,6 +122,7 @@
</span><span class="cx"> 
</span><span class="cx">     RetainPtr&lt;UIWKTextInteractionAssistant&gt; _textSelectionAssistant;
</span><span class="cx">     RetainPtr&lt;UIWKSelectionAssistant&gt; _webSelectionAssistant;
</span><ins>+    BOOL _suppressAssistantSelectionView;
</ins><span class="cx"> 
</span><span class="cx">     RetainPtr&lt;UITextInputTraits&gt; _traits;
</span><span class="cx">     RetainPtr&lt;UIWebFormAccessory&gt; _formAccessoryView;
</span><span class="lines">@@ -196,6 +197,9 @@
</span><span class="cx">     RetainPtr&lt;WKDataInteraction&gt; _dataInteraction;
</span><span class="cx"> #endif
</span><span class="cx">     CGPoint _deferredActionSheetRequestLocation;
</span><ins>+    RetainPtr&lt;UIView&gt; _visibleContentViewSnapshot;
+    RetainPtr&lt;UIImageView&gt; _dataInteractionUnselectedContentSnapshot;
+    BOOL _isRunningConcludeEditDataInteractionAnimation;
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -217,6 +221,7 @@
</span><span class="cx"> @property (nonatomic, readonly) const WebKit::WKAutoCorrectionData&amp; autocorrectionData;
</span><span class="cx"> @property (nonatomic, readonly) const WebKit::AssistedNodeInformation&amp; assistedNodeInformation;
</span><span class="cx"> @property (nonatomic, readonly) UIWebFormAccessory *formAccessoryView;
</span><ins>+@property (nonatomic) BOOL suppressAssistantSelectionView;
</ins><span class="cx"> 
</span><span class="cx"> - (void)setupInteraction;
</span><span class="cx"> - (void)cleanupInteraction;
</span><span class="lines">@@ -281,6 +286,7 @@
</span><span class="cx"> - (void)_didPerformDataInteractionControllerOperation;
</span><span class="cx"> - (void)_didHandleStartDataInteractionRequest:(BOOL)started;
</span><span class="cx"> - (void)_startDataInteractionWithImage:(RetainPtr&lt;CGImageRef&gt;)image withIndicatorData:(std::optional&lt;WebCore::TextIndicatorData&gt;)indicatorData atClientPosition:(CGPoint)clientPosition anchorPoint:(CGPoint)anchorPoint action:(uint64_t)action;
</span><ins>+- (void)_didConcludeEditDataInteraction:(std::optional&lt;WebCore::TextIndicatorData&gt;)data;
</ins><span class="cx"> - (void)_simulateDataInteractionEntered:(id)info;
</span><span class="cx"> - (void)_simulateDataInteractionUpdated:(id)info;
</span><span class="cx"> - (void)_simulateDataInteractionPerformOperation:(id)info;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewInteractionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (213626 => 213627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm        2017-03-09 04:55:56 UTC (rev 213626)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm        2017-03-09 05:16:20 UTC (rev 213627)
</span><span class="lines">@@ -827,7 +827,7 @@
</span><span class="cx">         SetForScope&lt;BOOL&gt; becomingFirstResponder { _becomingFirstResponder, YES };
</span><span class="cx">         didBecomeFirstResponder = [super becomeFirstResponder];
</span><span class="cx">     }
</span><del>-    if (didBecomeFirstResponder)
</del><ins>+    if (didBecomeFirstResponder &amp;&amp; !self.suppressAssistantSelectionView)
</ins><span class="cx">         [_textSelectionAssistant activateSelection];
</span><span class="cx"> 
</span><span class="cx">     return didBecomeFirstResponder;
</span><span class="lines">@@ -1140,16 +1140,23 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_displayFormNodeInputView
</span><span class="cx"> {
</span><del>-    // In case user scaling is force enabled, do not use that scaling when zooming in with an input field.
-    // Zooming above the page's default scale factor should only happen when the user performs it.
-    [self _zoomToFocusRect:_assistedNodeInformation.elementRect
-             selectionRect: _didAccessoryTabInitiateFocus ? IntRect() : _assistedNodeInformation.selectionRect
-               insideFixed:_assistedNodeInformation.insideFixedPosition
-                  fontSize:_assistedNodeInformation.nodeFontSize
-              minimumScale:_assistedNodeInformation.minimumScaleFactor
-              maximumScale:_assistedNodeInformation.maximumScaleFactorIgnoringAlwaysScalable
-              allowScaling:(_assistedNodeInformation.allowsUserScalingIgnoringAlwaysScalable &amp;&amp; !UICurrentUserInterfaceIdiomIsPad())
-               forceScroll:[self requiresAccessoryView]];
</del><ins>+    BOOL shouldZoomToFocusRect = YES;
+#if ENABLE(DATA_INTERACTION)
+    // FIXME: We need to teach WKWebView to properly zoom and scroll during a data interaction operation.
+    shouldZoomToFocusRect = ![WebItemProviderPasteboard sharedInstance].hasPendingOperation;
+#endif
+    if (shouldZoomToFocusRect) {
+        // In case user scaling is force enabled, do not use that scaling when zooming in with an input field.
+        // Zooming above the page's default scale factor should only happen when the user performs it.
+        [self _zoomToFocusRect:_assistedNodeInformation.elementRect
+                 selectionRect: _didAccessoryTabInitiateFocus ? IntRect() : _assistedNodeInformation.selectionRect
+                   insideFixed:_assistedNodeInformation.insideFixedPosition
+                      fontSize:_assistedNodeInformation.nodeFontSize
+                  minimumScale:_assistedNodeInformation.minimumScaleFactor
+                  maximumScale:_assistedNodeInformation.maximumScaleFactorIgnoringAlwaysScalable
+                  allowScaling:(_assistedNodeInformation.allowsUserScalingIgnoringAlwaysScalable &amp;&amp; !UICurrentUserInterfaceIdiomIsPad())
+                   forceScroll:[self requiresAccessoryView]];
+    }
</ins><span class="cx"> 
</span><span class="cx">     _didAccessoryTabInitiateFocus = NO;
</span><span class="cx">     [self _ensureFormAccessoryView];
</span><span class="lines">@@ -1723,7 +1730,7 @@
</span><span class="cx">             [_textSelectionAssistant setGestureRecognizers];
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (self.isFirstResponder)
</del><ins>+        if (self.isFirstResponder &amp;&amp; !self.suppressAssistantSelectionView)
</ins><span class="cx">             [_textSelectionAssistant activateSelection];
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -3897,7 +3904,9 @@
</span><span class="cx">         [_webSelectionAssistant didEndScrollingOrZoomingPage];
</span><span class="cx">         [[_webSelectionAssistant selectionView] setHidden:NO];
</span><span class="cx"> 
</span><del>-        [_textSelectionAssistant activateSelection];
</del><ins>+        if (!self.suppressAssistantSelectionView)
+            [_textSelectionAssistant activateSelection];
+
</ins><span class="cx">         [_textSelectionAssistant didEndScrollingOverflow];
</span><span class="cx"> 
</span><span class="cx">         _needsDeferredEndScrollingSelectionUpdate = NO;
</span><span class="lines">@@ -3904,6 +3913,26 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (BOOL)suppressAssistantSelectionView
+{
+    return _suppressAssistantSelectionView;
+}
+
+- (void)setSuppressAssistantSelectionView:(BOOL)suppressAssistantSelectionView
+{
+    if (_suppressAssistantSelectionView == suppressAssistantSelectionView)
+        return;
+
+    _suppressAssistantSelectionView = suppressAssistantSelectionView;
+    if (!_textSelectionAssistant)
+        return;
+
+    if (suppressAssistantSelectionView)
+        [_textSelectionAssistant deactivateSelection];
+    else
+        [_textSelectionAssistant activateSelection];
+}
+
</ins><span class="cx"> - (void)_showPlaybackTargetPicker:(BOOL)hasVideo fromRect:(const IntRect&amp;)elementRect
</span><span class="cx"> {
</span><span class="cx">     if (!_airPlayRoutePicker)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWebPageProxyIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm (213626 => 213627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm        2017-03-09 04:55:56 UTC (rev 213626)
+++ trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm        2017-03-09 05:16:20 UTC (rev 213627)
</span><span class="lines">@@ -1132,6 +1132,11 @@
</span><span class="cx">         m_process-&gt;send(Messages::WebPage::RequestStartDataInteraction(clientPosition, globalPosition), m_pageID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebPageProxy::didConcludeEditDataInteraction(std::optional&lt;TextIndicatorData&gt; data)
+{
+    m_pageClient.didConcludeEditDataInteraction(data);
+}
+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if USE(QUICK_LOOK)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebDragClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebDragClient.h (213626 => 213627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebDragClient.h        2017-03-09 04:55:56 UTC (rev 213626)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebDragClient.h        2017-03-09 05:16:20 UTC (rev 213627)
</span><span class="lines">@@ -48,6 +48,7 @@
</span><span class="cx">     WebCore::DragSourceAction dragSourceActionMaskForPoint(const WebCore::IntPoint&amp; windowPoint) override;
</span><span class="cx"> 
</span><span class="cx">     void startDrag(WebCore::DragImage, const WebCore::IntPoint&amp; dragImageOrigin, const WebCore::IntPoint&amp; eventPos, const WebCore::FloatPoint&amp; dragImageAnchor, WebCore::DataTransfer&amp;, WebCore::Frame&amp;, WebCore::DragSourceAction) override;
</span><ins>+    void didConcludeEditDrag() override;
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     void declareAndWriteDragImage(const String&amp; pasteboardName, WebCore::Element&amp;, const WebCore::URL&amp;, const String&amp;, WebCore::Frame*) override;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportgtkWebDragClientGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp (213626 => 213627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp        2017-03-09 04:55:56 UTC (rev 213626)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp        2017-03-09 05:16:20 UTC (rev 213627)
</span><span class="lines">@@ -56,6 +56,10 @@
</span><span class="cx">     return bitmap;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebDragClient::didConcludeEditDrag()
+{
+}
+
</ins><span class="cx"> void WebDragClient::startDrag(DragImage dragImage, const IntPoint&amp; clientPosition, const IntPoint&amp; globalPosition, const FloatPoint&amp;, DataTransfer&amp; dataTransfer, Frame&amp;, DragSourceAction)
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;ShareableBitmap&gt; bitmap = convertCairoSurfaceToShareableBitmap(dragImage.get().get());
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportmacWebDragClientMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm (213626 => 213627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm        2017-03-09 04:55:56 UTC (rev 213626)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm        2017-03-09 05:16:20 UTC (rev 213627)
</span><span class="lines">@@ -82,6 +82,10 @@
</span><span class="cx">     return WTFMove(bitmap);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebDragClient::didConcludeEditDrag()
+{
+}
+
</ins><span class="cx"> void WebDragClient::startDrag(DragImage image, const IntPoint&amp; point, const IntPoint&amp;, const FloatPoint&amp;, DataTransfer&amp;, Frame&amp; frame, DragSourceAction dragSourceAction)
</span><span class="cx"> {
</span><span class="cx">     IntSize bitmapSize([image.get() size]);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (213626 => 213627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2017-03-09 04:55:56 UTC (rev 213626)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2017-03-09 05:16:20 UTC (rev 213627)
</span><span class="lines">@@ -965,6 +965,10 @@
</span><span class="cx">     void didGetLoadDecisionForIcon(bool decision, uint64_t loadIdentifier, uint64_t newCallbackID);
</span><span class="cx">     void setUseIconLoadingClient(bool);
</span><span class="cx"> 
</span><ins>+#if ENABLE(DATA_INTERACTION)
+    void didConcludeEditDataInteraction();
+#endif
+
</ins><span class="cx"> private:
</span><span class="cx">     WebPage(uint64_t pageID, WebPageCreationParameters&amp;&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (213626 => 213627)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2017-03-09 04:55:56 UTC (rev 213626)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2017-03-09 05:16:20 UTC (rev 213627)
</span><span class="lines">@@ -643,6 +643,20 @@
</span><span class="cx">     bool didStart = m_page-&gt;mainFrame().eventHandler().tryToBeginDataInteractionAtPoint(clientPosition, globalPosition);
</span><span class="cx">     send(Messages::WebPageProxy::DidHandleStartDataInteractionRequest(didStart));
</span><span class="cx"> }
</span><ins>+
+void WebPage::didConcludeEditDataInteraction()
+{
+    std::optional&lt;TextIndicatorData&gt; textIndicatorData;
+
+    static auto defaultEditDragTextIndicatorOptions = TextIndicatorOptionIncludeSnapshotOfAllVisibleContentWithoutSelection | TextIndicatorOptionDoNotClipToVisibleRect | TextIndicatorOptionPaintAllContent | TextIndicatorOptionIncludeMarginIfRangeMatchesSelection | TextIndicatorOptionPaintBackgrounds | TextIndicatorOptionIncludeSnapshotWithSelectionHighlight;
+    auto&amp; frame = m_page-&gt;focusController().focusedOrMainFrame();
+    if (auto range = frame.selection().selection().toNormalizedRange()) {
+        if (auto textIndicator = TextIndicator::createWithRange(*range, defaultEditDragTextIndicatorOptions, TextIndicatorPresentationTransition::None))
+            textIndicatorData = textIndicator-&gt;data();
+    }
+
+    send(Messages::WebPageProxy::DidConcludeEditDataInteraction(textIndicatorData));
+}
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> void WebPage::sendTapHighlightForNodeIfNecessary(uint64_t requestID, Node* node)
</span></span></pre>
</div>
</div>

</body>
</html>