<!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>[209405] trunk/Source/WebKit2</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/209405">209405</a></dd>
<dt>Author</dt> <dd>timothy_horton@apple.com</dd>
<dt>Date</dt> <dd>2016-12-06 10:24:28 -0800 (Tue, 06 Dec 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Almost half-second stall scrolling apple.com because of synchronous getPositionInformation
https://bugs.webkit.org/show_bug.cgi?id=165403
&lt;rdar://problem/29493285&gt;

Reviewed by Enrica Casucci.

When retrieving interaction information, we don't always need to do
snapshots for 3D Touch or the action sheet, especially if we're
synchronously blocking the UI process main thread waiting for the reply.

Add a new InteractionInformationRequest, which allows callers of
getPositionInformation and requestPositionInformation to specify which
optional pieces of information they would like to compute.

* Shared/AssistedNodeInformation.h:
Fix a incorrect comment.

* Shared/ios/InteractionInformationRequest.cpp: Added.
(WebKit::InteractionInformationRequest::encode):
(WebKit::InteractionInformationRequest::decode):
(WebKit::InteractionInformationRequest::isValidForRequest):
* Shared/ios/InteractionInformationRequest.h: Added.
(WebKit::InteractionInformationRequest::InteractionInformationRequest):
* WebKit2.xcodeproj/project.pbxproj:
Add InteractionInformationRequest, which encapsulates all of the
parameters required to generate an InteractionInformationAtPosition.
Previously, that was just a point, but now we have two new parameters:
whether we should generate a snapshot of the element, and whether
we should generate a TextIndicator if the element is a link.

* Shared/ios/InteractionInformationAtPosition.h:
* Shared/ios/InteractionInformationAtPosition.mm:
(WebKit::InteractionInformationAtPosition::encode):
(WebKit::InteractionInformationAtPosition::decode):
(WebKit::InteractionInformationAtPosition::mergeCompatibleOptionalInformation):
Adopt InteractionInformationRequest.

* UIProcess/WebPageProxy.h:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::getPositionInformation):
(WebKit::WebPageProxy::requestPositionInformation):
* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant initialPresentationRectInHostViewForSheet]):
(-[WKActionSheetAssistant presentationRectInHostViewForSheet]):
(-[WKActionSheetAssistant showImageSheet]):
(-[WKActionSheetAssistant showLinkSheet]):
* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView annotation:isBeingPressedAtPoint:controller:]):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
Adopt InteractionInformationRequest.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _showAttachmentSheet]):
(-[WKContentView ensurePositionInformationIsUpToDate:]):
If we have a outstanding asynchronous position information request
for the current point, instead of sending a second separate request,
just wait for the async one to come in.

(-[WKContentView requestAsynchronousPositionInformationUpdate:]):
If asked to do an asynchronous request with more optional bits than
the current otherwise-valid response's request, update the position information.

(-[WKContentView gestureRecognizerShouldBegin:]):
The design of this mechanism is that during the highlight long press,
we do an async position information update, and then when we actually
begin a 3D Touch gesture, we hope to already have the requisite snapshots
ready (so that we can avoid synchronously blocking for them, there).
So, in the highlight long-press async request, ask for all the goodies.

(-[WKContentView hasSelectablePositionAtPoint:]):
(-[WKContentView pointIsNearMarkedText:]):
(-[WKContentView pointIsInAssistedNode:]):
(-[WKContentView _didNotHandleTapAsClick:]):
(-[WKContentView _positionInformationDidChange:]):
If we get a position information update for the same point, but with less
goodies attached (the snapshot/link indicator), copy them over from the old
position information, so that we never accidentally &quot;downgrade&quot; our info.

(-[WKContentView updatePositionInformationForActionSheetAssistant:]):
(-[WKContentView actionSheetAssistant:willStartInteractionWithElement:]):
(-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
(-[WKContentView _dataForPreviewItemController:atPosition:type:]):
(-[WKContentView _presentedViewControllerForPreviewItemController:]):        
More adoption.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleTap):
(WebKit::WebPage::handleTwoFingerTapAtPoint):
(WebKit::WebPage::commitPotentialTap):
Adopt InteractionInformationRequest.

(WebKit::WebPage::getPositionInformation):
(WebKit::WebPage::requestPositionInformation):
Copy the request into the response.
Only snapshot if the request wants a snapshot.
Only make a link indicator if the request wants one.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedAssistedNodeInformationh">trunk/Source/WebKit2/Shared/AssistedNodeInformation.h</a></li>
<li><a href="#trunkSourceWebKit2SharediosInteractionInformationAtPositionh">trunk/Source/WebKit2/Shared/ios/InteractionInformationAtPosition.h</a></li>
<li><a href="#trunkSourceWebKit2SharediosInteractionInformationAtPositionmm">trunk/Source/WebKit2/Shared/ios/InteractionInformationAtPosition.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWKActionSheetAssistantmm">trunk/Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.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="#trunkSourceWebKit2UIProcessiosWKPDFViewmm">trunk/Source/WebKit2/UIProcess/ios/WKPDFView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWebPageProxyIOSmm">trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPageh">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagemessagesin">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm">trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2SharediosInteractionInformationRequestcpp">trunk/Source/WebKit2/Shared/ios/InteractionInformationRequest.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharediosInteractionInformationRequesth">trunk/Source/WebKit2/Shared/ios/InteractionInformationRequest.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (209404 => 209405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-12-06 17:58:39 UTC (rev 209404)
+++ trunk/Source/WebKit2/ChangeLog        2016-12-06 18:24:28 UTC (rev 209405)
</span><span class="lines">@@ -1,3 +1,104 @@
</span><ins>+2016-12-06  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        Almost half-second stall scrolling apple.com because of synchronous getPositionInformation
+        https://bugs.webkit.org/show_bug.cgi?id=165403
+        &lt;rdar://problem/29493285&gt;
+
+        Reviewed by Enrica Casucci.
+
+        When retrieving interaction information, we don't always need to do
+        snapshots for 3D Touch or the action sheet, especially if we're
+        synchronously blocking the UI process main thread waiting for the reply.
+
+        Add a new InteractionInformationRequest, which allows callers of
+        getPositionInformation and requestPositionInformation to specify which
+        optional pieces of information they would like to compute.
+
+        * Shared/AssistedNodeInformation.h:
+        Fix a incorrect comment.
+
+        * Shared/ios/InteractionInformationRequest.cpp: Added.
+        (WebKit::InteractionInformationRequest::encode):
+        (WebKit::InteractionInformationRequest::decode):
+        (WebKit::InteractionInformationRequest::isValidForRequest):
+        * Shared/ios/InteractionInformationRequest.h: Added.
+        (WebKit::InteractionInformationRequest::InteractionInformationRequest):
+        * WebKit2.xcodeproj/project.pbxproj:
+        Add InteractionInformationRequest, which encapsulates all of the
+        parameters required to generate an InteractionInformationAtPosition.
+        Previously, that was just a point, but now we have two new parameters:
+        whether we should generate a snapshot of the element, and whether
+        we should generate a TextIndicator if the element is a link.
+
+        * Shared/ios/InteractionInformationAtPosition.h:
+        * Shared/ios/InteractionInformationAtPosition.mm:
+        (WebKit::InteractionInformationAtPosition::encode):
+        (WebKit::InteractionInformationAtPosition::decode):
+        (WebKit::InteractionInformationAtPosition::mergeCompatibleOptionalInformation):
+        Adopt InteractionInformationRequest.
+
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/ios/WebPageProxyIOS.mm:
+        (WebKit::WebPageProxy::getPositionInformation):
+        (WebKit::WebPageProxy::requestPositionInformation):
+        * UIProcess/ios/WKActionSheetAssistant.mm:
+        (-[WKActionSheetAssistant initialPresentationRectInHostViewForSheet]):
+        (-[WKActionSheetAssistant presentationRectInHostViewForSheet]):
+        (-[WKActionSheetAssistant showImageSheet]):
+        (-[WKActionSheetAssistant showLinkSheet]):
+        * UIProcess/ios/WKPDFView.mm:
+        (-[WKPDFView annotation:isBeingPressedAtPoint:controller:]):
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in:
+        Adopt InteractionInformationRequest.
+        
+        * UIProcess/ios/WKContentViewInteraction.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView _showAttachmentSheet]):
+        (-[WKContentView ensurePositionInformationIsUpToDate:]):
+        If we have a outstanding asynchronous position information request
+        for the current point, instead of sending a second separate request,
+        just wait for the async one to come in.
+
+        (-[WKContentView requestAsynchronousPositionInformationUpdate:]):
+        If asked to do an asynchronous request with more optional bits than
+        the current otherwise-valid response's request, update the position information.
+
+        (-[WKContentView gestureRecognizerShouldBegin:]):
+        The design of this mechanism is that during the highlight long press,
+        we do an async position information update, and then when we actually
+        begin a 3D Touch gesture, we hope to already have the requisite snapshots
+        ready (so that we can avoid synchronously blocking for them, there).
+        So, in the highlight long-press async request, ask for all the goodies.
+
+        (-[WKContentView hasSelectablePositionAtPoint:]):
+        (-[WKContentView pointIsNearMarkedText:]):
+        (-[WKContentView pointIsInAssistedNode:]):
+        (-[WKContentView _didNotHandleTapAsClick:]):
+        (-[WKContentView _positionInformationDidChange:]):
+        If we get a position information update for the same point, but with less
+        goodies attached (the snapshot/link indicator), copy them over from the old
+        position information, so that we never accidentally &quot;downgrade&quot; our info.
+
+        (-[WKContentView updatePositionInformationForActionSheetAssistant:]):
+        (-[WKContentView actionSheetAssistant:willStartInteractionWithElement:]):
+        (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
+        (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
+        (-[WKContentView _presentedViewControllerForPreviewItemController:]):        
+        More adoption.
+        
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::handleTap):
+        (WebKit::WebPage::handleTwoFingerTapAtPoint):
+        (WebKit::WebPage::commitPotentialTap):
+        Adopt InteractionInformationRequest.
+
+        (WebKit::WebPage::getPositionInformation):
+        (WebKit::WebPage::requestPositionInformation):
+        Copy the request into the response.
+        Only snapshot if the request wants a snapshot.
+        Only make a link indicator if the request wants one.
+
</ins><span class="cx"> 2016-12-06  Daniel Bates  &lt;dabates@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Cleanup: Rename some HTTP 0.9-specific functions to conform to WebKit Code Style Guidelines
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedAssistedNodeInformationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/AssistedNodeInformation.h (209404 => 209405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/AssistedNodeInformation.h        2016-12-06 17:58:39 UTC (rev 209404)
+++ trunk/Source/WebKit2/Shared/AssistedNodeInformation.h        2016-12-06 18:24:28 UTC (rev 209405)
</span><span class="lines">@@ -23,8 +23,7 @@
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef AssistedNodeInformation_h
-#define AssistedNodeInformation_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #include &quot;ArgumentCoders.h&quot;
</span><span class="cx"> #include &lt;WebCore/AutocapitalizeTypes.h&gt;
</span><span class="lines">@@ -118,5 +117,3 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> }
</span><del>-
-#endif // InteractionInformationAtPosition_h
</del></span></pre></div>
<a id="trunkSourceWebKit2SharediosInteractionInformationAtPositionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/ios/InteractionInformationAtPosition.h (209404 => 209405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/ios/InteractionInformationAtPosition.h        2016-12-06 17:58:39 UTC (rev 209404)
+++ trunk/Source/WebKit2/Shared/ios/InteractionInformationAtPosition.h        2016-12-06 18:24:28 UTC (rev 209405)
</span><span class="lines">@@ -23,12 +23,12 @@
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef InteractionInformationAtPosition_h
-#define InteractionInformationAtPosition_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;ArgumentCoders.h&quot;
</span><ins>+#include &quot;InteractionInformationRequest.h&quot;
</ins><span class="cx"> #include &quot;ShareableBitmap.h&quot;
</span><span class="cx"> #include &lt;WebCore/IntPoint.h&gt;
</span><span class="cx"> #include &lt;WebCore/SelectionRect.h&gt;
</span><span class="lines">@@ -38,7 +38,8 @@
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="cx"> struct InteractionInformationAtPosition {
</span><del>-    WebCore::IntPoint point;
</del><ins>+    InteractionInformationRequest request;
+
</ins><span class="cx">     bool nodeAtPositionIsAssistedNode { false };
</span><span class="cx">     bool isSelectable { false };
</span><span class="cx">     bool isNearMarkedText { false };
</span><span class="lines">@@ -66,6 +67,11 @@
</span><span class="cx">     RetainPtr&lt;NSArray&gt; dataDetectorResults;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    // Copy compatible optional bits forward (for example, if we have a InteractionInformationAtPosition
+    // with snapshots in it, and perform another request for the same point without requesting the snapshots,
+    // we can fetch the cheap information and copy the snapshots into the new response).
+    void mergeCompatibleOptionalInformation(const InteractionInformationAtPosition&amp; oldInformation);
+
</ins><span class="cx">     void encode(IPC::Encoder&amp;) const;
</span><span class="cx">     static bool decode(IPC::Decoder&amp;, InteractionInformationAtPosition&amp;);
</span><span class="cx"> };
</span><span class="lines">@@ -73,5 +79,3 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif // PLATFORM(IOS)
</span><del>-
-#endif // InteractionInformationAtPosition_h
</del></span></pre></div>
<a id="trunkSourceWebKit2SharediosInteractionInformationAtPositionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/ios/InteractionInformationAtPosition.mm (209404 => 209405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/ios/InteractionInformationAtPosition.mm        2016-12-06 17:58:39 UTC (rev 209404)
+++ trunk/Source/WebKit2/Shared/ios/InteractionInformationAtPosition.mm        2016-12-06 18:24:28 UTC (rev 209405)
</span><span class="lines">@@ -40,7 +40,8 @@
</span><span class="cx"> 
</span><span class="cx"> void InteractionInformationAtPosition::encode(IPC::Encoder&amp; encoder) const
</span><span class="cx"> {
</span><del>-    encoder &lt;&lt; point;
</del><ins>+    encoder &lt;&lt; request;
+
</ins><span class="cx">     encoder &lt;&lt; nodeAtPositionIsAssistedNode;
</span><span class="cx">     encoder &lt;&lt; isSelectable;
</span><span class="cx">     encoder &lt;&lt; isNearMarkedText;
</span><span class="lines">@@ -80,7 +81,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool InteractionInformationAtPosition::decode(IPC::Decoder&amp; decoder, InteractionInformationAtPosition&amp; result)
</span><span class="cx"> {
</span><del>-    if (!decoder.decode(result.point))
</del><ins>+    if (!decoder.decode(result.request))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (!decoder.decode(result.nodeAtPositionIsAssistedNode))
</span><span class="lines">@@ -167,6 +168,19 @@
</span><span class="cx"> 
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><del>-#endif
</del><span class="cx"> 
</span><ins>+void InteractionInformationAtPosition::mergeCompatibleOptionalInformation(const InteractionInformationAtPosition&amp; oldInformation)
+{
+    if (oldInformation.request.point != request.point)
+        return;
+
+    if (oldInformation.request.includeSnapshot &amp;&amp; !request.includeSnapshot)
+        image = oldInformation.image;
+
+    if (oldInformation.request.includeLinkIndicator &amp;&amp; !request.includeLinkIndicator)
+        linkIndicator = oldInformation.linkIndicator;
</ins><span class="cx"> }
</span><ins>+
+#endif // PLATFORM(IOS)
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2SharediosInteractionInformationRequestcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/Shared/ios/InteractionInformationRequest.cpp (0 => 209405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/ios/InteractionInformationRequest.cpp                                (rev 0)
+++ trunk/Source/WebKit2/Shared/ios/InteractionInformationRequest.cpp        2016-12-06 18:24:28 UTC (rev 209405)
</span><span class="lines">@@ -0,0 +1,73 @@
</span><ins>+/*
+ * Copyright (C) 2016 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 &quot;config.h&quot;
+#import &quot;InteractionInformationRequest.h&quot;
+
+#import &quot;ArgumentCodersCF.h&quot;
+#import &quot;WebCoreArgumentCoders.h&quot;
+
+namespace WebKit {
+
+#if PLATFORM(IOS)
+
+void InteractionInformationRequest::encode(IPC::Encoder&amp; encoder) const
+{
+    encoder &lt;&lt; point;
+    encoder &lt;&lt; includeSnapshot;
+    encoder &lt;&lt; includeLinkIndicator;
+}
+
+bool InteractionInformationRequest::decode(IPC::Decoder&amp; decoder, InteractionInformationRequest&amp; result)
+{
+    if (!decoder.decode(result.point))
+        return false;
+
+    if (!decoder.decode(result.includeSnapshot))
+        return false;
+
+    if (!decoder.decode(result.includeLinkIndicator))
+        return false;
+
+    return true;
+}
+
+bool InteractionInformationRequest::isValidForRequest(const InteractionInformationRequest&amp; other)
+{
+    if (other.point != point)
+        return false;
+
+    if (other.includeSnapshot &amp;&amp; !includeSnapshot)
+        return false;
+
+    if (other.includeLinkIndicator &amp;&amp; !includeLinkIndicator)
+        return false;
+
+    return true;
+}
+
+#endif // PLATFORM(IOS)
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2SharediosInteractionInformationRequesth"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/Shared/ios/InteractionInformationRequest.h (0 => 209405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/ios/InteractionInformationRequest.h                                (rev 0)
+++ trunk/Source/WebKit2/Shared/ios/InteractionInformationRequest.h        2016-12-06 18:24:28 UTC (rev 209405)
</span><span class="lines">@@ -0,0 +1,59 @@
</span><ins>+/*
+ * Copyright (C) 2016 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.
+ */
+
+#pragma once
+
+#if PLATFORM(IOS)
+
+#include &quot;ArgumentCoders.h&quot;
+#include &quot;ShareableBitmap.h&quot;
+#include &lt;WebCore/IntPoint.h&gt;
+#include &lt;WebCore/SelectionRect.h&gt;
+#include &lt;WebCore/TextIndicator.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace WebKit {
+
+struct InteractionInformationRequest {
+    WebCore::IntPoint point;
+
+    bool includeSnapshot { false };
+    bool includeLinkIndicator { false };
+
+    InteractionInformationRequest() { }
+    explicit InteractionInformationRequest(WebCore::IntPoint point)
+    {
+        this-&gt;point = point;
+    }
+
+    bool isValidForRequest(const InteractionInformationRequest&amp;);
+
+    void encode(IPC::Encoder&amp;) const;
+    static bool decode(IPC::Decoder&amp;, InteractionInformationRequest&amp;);
+};
+
+}
+
+#endif // PLATFORM(IOS)
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (209404 => 209405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2016-12-06 17:58:39 UTC (rev 209404)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2016-12-06 18:24:28 UTC (rev 209405)
</span><span class="lines">@@ -210,6 +210,7 @@
</span><span class="cx"> struct EditingRange;
</span><span class="cx"> struct EditorState;
</span><span class="cx"> class GamepadData;
</span><ins>+struct InteractionInformationRequest;
</ins><span class="cx"> struct LoadParameters;
</span><span class="cx"> struct PlatformPopupMenuData;
</span><span class="cx"> struct PrintInfo;
</span><span class="lines">@@ -511,8 +512,8 @@
</span><span class="cx">     void replaceDictatedText(const String&amp; oldText, const String&amp; newText);
</span><span class="cx">     void replaceSelectedText(const String&amp; oldText, const String&amp; newText);
</span><span class="cx">     void didReceivePositionInformation(const InteractionInformationAtPosition&amp;);
</span><del>-    void getPositionInformation(const WebCore::IntPoint&amp;, InteractionInformationAtPosition&amp;);
-    void requestPositionInformation(const WebCore::IntPoint&amp;);
</del><ins>+    void getPositionInformation(const InteractionInformationRequest&amp;, InteractionInformationAtPosition&amp;);
+    void requestPositionInformation(const InteractionInformationRequest&amp;);
</ins><span class="cx">     void startInteractionWithElementAtPosition(const WebCore::IntPoint&amp;);
</span><span class="cx">     void stopInteraction();
</span><span class="cx">     void performActionOnElement(uint32_t action);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKActionSheetAssistantmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm (209404 => 209405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm        2016-12-06 17:58:39 UTC (rev 209404)
+++ trunk/Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm        2016-12-06 18:24:28 UTC (rev 209405)
</span><span class="lines">@@ -159,7 +159,7 @@
</span><span class="cx">     if (!view || !delegate)
</span><span class="cx">         return CGRectZero;
</span><span class="cx"> 
</span><del>-    return [self _presentationRectForSheetGivenPoint:[delegate positionInformationForActionSheetAssistant:self].point inHostView:view];
</del><ins>+    return [self _presentationRectForSheetGivenPoint:[delegate positionInformationForActionSheetAssistant:self].request.point inHostView:view];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (CGRect)presentationRectInHostViewForSheet
</span><span class="lines">@@ -172,7 +172,7 @@
</span><span class="cx">     const auto&amp; positionInformation = [delegate positionInformationForActionSheetAssistant:self];
</span><span class="cx"> 
</span><span class="cx">     CGRect boundingRect = positionInformation.bounds;
</span><del>-    CGPoint fromPoint = positionInformation.point;
</del><ins>+    CGPoint fromPoint = positionInformation.request.point;
</ins><span class="cx"> 
</span><span class="cx">     // FIXME: We must adjust our presentation point to take into account a change in document scale.
</span><span class="cx"> 
</span><span class="lines">@@ -293,7 +293,7 @@
</span><span class="cx">     const auto&amp; positionInformation = [delegate positionInformationForActionSheetAssistant:self];
</span><span class="cx"> 
</span><span class="cx">     NSURL *targetURL = [NSURL _web_URLWithWTFString:positionInformation.url];
</span><del>-    auto elementInfo = adoptNS([[_WKActivatedElementInfo alloc] _initWithType:_WKActivatedElementTypeImage URL:targetURL location:positionInformation.point title:positionInformation.title ID:positionInformation.idAttribute rect:positionInformation.bounds image:positionInformation.image.get()]);
</del><ins>+    auto elementInfo = adoptNS([[_WKActivatedElementInfo alloc] _initWithType:_WKActivatedElementTypeImage URL:targetURL location:positionInformation.request.point title:positionInformation.title ID:positionInformation.idAttribute rect:positionInformation.bounds image:positionInformation.image.get()]);
</ins><span class="cx">     if ([delegate respondsToSelector:@selector(actionSheetAssistant:showCustomSheetForElement:)] &amp;&amp; [delegate actionSheetAssistant:self showCustomSheetForElement:elementInfo.get()])
</span><span class="cx">         return;
</span><span class="cx">     auto defaultActions = [self defaultActionsForImageSheet:elementInfo.get()];
</span><span class="lines">@@ -411,7 +411,7 @@
</span><span class="cx">     if (!targetURL)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    auto elementInfo = adoptNS([[_WKActivatedElementInfo alloc] _initWithType:_WKActivatedElementTypeLink URL:targetURL location:positionInformation.point title:positionInformation.title ID:positionInformation.idAttribute rect:positionInformation.bounds image:positionInformation.image.get()]);
</del><ins>+    auto elementInfo = adoptNS([[_WKActivatedElementInfo alloc] _initWithType:_WKActivatedElementTypeLink URL:targetURL location:positionInformation.request.point title:positionInformation.title ID:positionInformation.idAttribute rect:positionInformation.bounds image:positionInformation.image.get()]);
</ins><span class="cx">     if ([delegate respondsToSelector:@selector(actionSheetAssistant:showCustomSheetForElement:)] &amp;&amp; [delegate actionSheetAssistant:self showCustomSheetForElement:elementInfo.get()])
</span><span class="cx">         return;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewInteractionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h (209404 => 209405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h        2016-12-06 17:58:39 UTC (rev 209404)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h        2016-12-06 18:24:28 UTC (rev 209405)
</span><span class="lines">@@ -159,6 +159,8 @@
</span><span class="cx"> 
</span><span class="cx">     WebKit::WKSelectionDrawingInfo _lastSelectionDrawingInfo;
</span><span class="cx"> 
</span><ins>+    std::optional&lt;WebKit::InteractionInformationRequest&gt; _outstandingPositionInformationRequest;
+
</ins><span class="cx">     BOOL _isEditable;
</span><span class="cx">     BOOL _showingTextStyleOptions;
</span><span class="cx">     BOOL _hasValidPositionInformation;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewInteractionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (209404 => 209405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm        2016-12-06 17:58:39 UTC (rev 209404)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm        2016-12-06 18:24:28 UTC (rev 209405)
</span><span class="lines">@@ -1192,7 +1192,7 @@
</span><span class="cx">     if (![uiDelegate respondsToSelector:@selector(_webView:showCustomSheetForElement:)])
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    auto element = adoptNS([[_WKActivatedElementInfo alloc] _initWithType:_WKActivatedElementTypeAttachment URL:[NSURL _web_URLWithWTFString:_positionInformation.url] location:_positionInformation.point title:_positionInformation.title ID:_positionInformation.idAttribute rect:_positionInformation.bounds image:nil]);
</del><ins>+    auto element = adoptNS([[_WKActivatedElementInfo alloc] _initWithType:_WKActivatedElementTypeAttachment URL:[NSURL _web_URLWithWTFString:_positionInformation.url] location:_positionInformation.request.point title:_positionInformation.title ID:_positionInformation.idAttribute rect:_positionInformation.bounds image:nil]);
</ins><span class="cx">     [uiDelegate _webView:_webView showCustomSheetForElement:element.get()];
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1227,14 +1227,32 @@
</span><span class="cx">     return nil;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)ensurePositionInformationIsUpToDate:(CGPoint)point
</del><ins>+- (void)ensurePositionInformationIsUpToDate:(WebKit::InteractionInformationRequest)request
</ins><span class="cx"> {
</span><del>-    if (!_hasValidPositionInformation || roundedIntPoint(point) != _positionInformation.point) {
-        _page-&gt;getPositionInformation(roundedIntPoint(point), _positionInformation);
-        _hasValidPositionInformation = YES;
</del><ins>+    if (_hasValidPositionInformation &amp;&amp; _positionInformation.request.isValidForRequest(request))
+        return;
+
+    if (_outstandingPositionInformationRequest &amp;&amp; _outstandingPositionInformationRequest-&gt;isValidForRequest(request)) {
+        if (auto* connection = _page-&gt;process().connection()) {
+            connection-&gt;waitForAndDispatchImmediately&lt;Messages::WebPageProxy::DidReceivePositionInformation&gt;(_page-&gt;pageID(), Seconds::infinity());
+            return;
+        }
</ins><span class="cx">     }
</span><ins>+
+    _page-&gt;getPositionInformation(request, _positionInformation);
+    _hasValidPositionInformation = YES;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)requestAsynchronousPositionInformationUpdate:(WebKit::InteractionInformationRequest)request
+{
+    if (_hasValidPositionInformation &amp;&amp; _positionInformation.request.isValidForRequest(request))
+        return;
+
+    _outstandingPositionInformationRequest = request;
+
+    _page-&gt;requestPositionInformation(request);
+}
+
</ins><span class="cx"> #if ENABLE(DATA_DETECTION)
</span><span class="cx"> - (NSArray *)_dataDetectionResults
</span><span class="cx"> {
</span><span class="lines">@@ -1255,7 +1273,8 @@
</span><span class="cx">         if (_textSelectionAssistant) {
</span><span class="cx">             // Request information about the position with sync message.
</span><span class="cx">             // If the assisted node is the same, prevent the gesture.
</span><del>-            _page-&gt;getPositionInformation(roundedIntPoint(point), _positionInformation);
</del><ins>+            InteractionInformationRequest request(roundedIntPoint(point));
+            _page-&gt;getPositionInformation(request, _positionInformation);
</ins><span class="cx">             _hasValidPositionInformation = YES;
</span><span class="cx">             if (_positionInformation.nodeAtPositionIsAssistedNode)
</span><span class="cx">                 return NO;
</span><span class="lines">@@ -1274,7 +1293,17 @@
</span><span class="cx">             // We still have no idea about what is at the location.
</span><span class="cx">             // Send and async message to find out.
</span><span class="cx">             _hasValidPositionInformation = NO;
</span><del>-            _page-&gt;requestPositionInformation(roundedIntPoint(point));
</del><ins>+            InteractionInformationRequest request(roundedIntPoint(point));
+
+            // If 3D Touch is enabled, asynchronously collect snapshots in the hopes that
+            // they'll arrive before we have to synchronously request them in
+            // _interactionShouldBeginFromPreviewItemController.
+            if (self.traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable) {
+                request.includeSnapshot = true;
+                request.includeLinkIndicator = true;
+            }
+
+            [self requestAsynchronousPositionInformationUpdate:request];
</ins><span class="cx">             return YES;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -1283,7 +1312,8 @@
</span><span class="cx">         // Use the information retrieved with one of the previous calls
</span><span class="cx">         // to gestureRecognizerShouldBegin.
</span><span class="cx">         // Force a sync call if not ready yet.
</span><del>-        [self ensurePositionInformationIsUpToDate:point];
</del><ins>+        InteractionInformationRequest request(roundedIntPoint(point));
+        [self ensurePositionInformationIsUpToDate:request];
</ins><span class="cx"> 
</span><span class="cx">         if (_textSelectionAssistant) {
</span><span class="cx">             // Prevent the gesture if it is the same node.
</span><span class="lines">@@ -1323,19 +1353,22 @@
</span><span class="cx">     if (_inspectorNodeSearchEnabled)
</span><span class="cx">         return NO;
</span><span class="cx"> 
</span><del>-    [self ensurePositionInformationIsUpToDate:point];
</del><ins>+    InteractionInformationRequest request(roundedIntPoint(point));
+    [self ensurePositionInformationIsUpToDate:request];
</ins><span class="cx">     return _positionInformation.isSelectable;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)pointIsNearMarkedText:(CGPoint)point
</span><span class="cx"> {
</span><del>-    [self ensurePositionInformationIsUpToDate:point];
</del><ins>+    InteractionInformationRequest request(roundedIntPoint(point));
+    [self ensurePositionInformationIsUpToDate:request];
</ins><span class="cx">     return _positionInformation.isNearMarkedText;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)pointIsInAssistedNode:(CGPoint)point
</span><span class="cx"> {
</span><del>-    [self ensurePositionInformationIsUpToDate:point];
</del><ins>+    InteractionInformationRequest request(roundedIntPoint(point));
+    [self ensurePositionInformationIsUpToDate:request];
</ins><span class="cx">     return _positionInformation.nodeAtPositionIsAssistedNode;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1465,7 +1498,7 @@
</span><span class="cx"> {
</span><span class="cx">     // FIXME: we should also take into account whether or not the UI delegate
</span><span class="cx">     // has handled this notification.
</span><del>-    if (_hasValidPositionInformation &amp;&amp; point == _positionInformation.point &amp;&amp; _positionInformation.isDataDetectorLink) {
</del><ins>+    if (_hasValidPositionInformation &amp;&amp; point == _positionInformation.request.point &amp;&amp; _positionInformation.isDataDetectorLink) {
</ins><span class="cx">         [self _showDataDetectorsSheet];
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -1581,7 +1614,12 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_positionInformationDidChange:(const InteractionInformationAtPosition&amp;)info
</span><span class="cx"> {
</span><del>-    _positionInformation = info;
</del><ins>+    _outstandingPositionInformationRequest = std::nullopt;
+
+    InteractionInformationAtPosition newInfo = info;
+    newInfo.mergeCompatibleOptionalInformation(_positionInformation);
+
+    _positionInformation = newInfo;
</ins><span class="cx">     _hasValidPositionInformation = YES;
</span><span class="cx">     if (_actionSheetAssistant)
</span><span class="cx">         [_actionSheetAssistant updateSheetPosition];
</span><span class="lines">@@ -3766,7 +3804,10 @@
</span><span class="cx"> - (void)updatePositionInformationForActionSheetAssistant:(WKActionSheetAssistant *)assistant
</span><span class="cx"> {
</span><span class="cx">     _hasValidPositionInformation = NO;
</span><del>-    _page-&gt;requestPositionInformation(_positionInformation.point);
</del><ins>+    InteractionInformationRequest request(_positionInformation.request.point);
+    request.includeSnapshot = YES;
+
+    [self requestAsynchronousPositionInformationUpdate:request];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)actionSheetAssistant:(WKActionSheetAssistant *)assistant performAction:(WebKit::SheetAction)action
</span><span class="lines">@@ -3816,7 +3857,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)actionSheetAssistant:(WKActionSheetAssistant *)assistant willStartInteractionWithElement:(_WKActivatedElementInfo *)element
</span><span class="cx"> {
</span><del>-    _page-&gt;startInteractionWithElementAtPosition(_positionInformation.point);
</del><ins>+    _page-&gt;startInteractionWithElementAtPosition(_positionInformation.request.point);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)actionSheetAssistantDidStopInteraction:(WKActionSheetAssistant *)assistant
</span><span class="lines">@@ -3894,10 +3935,13 @@
</span><span class="cx">     if (!_highlightLongPressCanClick)
</span><span class="cx">         return NO;
</span><span class="cx"> 
</span><del>-    [self ensurePositionInformationIsUpToDate:position];
</del><ins>+    InteractionInformationRequest request(roundedIntPoint(position));
+    request.includeSnapshot = true;
+    request.includeLinkIndicator = true;
+    [self ensurePositionInformationIsUpToDate:request];
</ins><span class="cx">     if (!_positionInformation.isLink &amp;&amp; !_positionInformation.isImage &amp;&amp; !_positionInformation.isAttachment)
</span><span class="cx">         return NO;
</span><del>-    
</del><ins>+
</ins><span class="cx">     String absoluteLinkURL = _positionInformation.url;
</span><span class="cx">     if (_positionInformation.isLink) {
</span><span class="cx">         NSURL *targetURL = [NSURL _web_URLWithWTFString:_positionInformation.url];
</span><span class="lines">@@ -3986,7 +4030,7 @@
</span><span class="cx">     } else if (canShowAttachmentPreview) {
</span><span class="cx"> #if __IPHONE_OS_VERSION_MIN_REQUIRED &gt;= 100000
</span><span class="cx">         *type = UIPreviewItemTypeAttachment;
</span><del>-        auto element = adoptNS([[_WKActivatedElementInfo alloc] _initWithType:_WKActivatedElementTypeAttachment URL:[NSURL _web_URLWithWTFString:_positionInformation.url] location:_positionInformation.point title:_positionInformation.title ID:_positionInformation.idAttribute rect:_positionInformation.bounds image:nil]);
</del><ins>+        auto element = adoptNS([[_WKActivatedElementInfo alloc] _initWithType:_WKActivatedElementTypeAttachment URL:[NSURL _web_URLWithWTFString:_positionInformation.url] location:_positionInformation.request.point title:_positionInformation.title ID:_positionInformation.idAttribute rect:_positionInformation.bounds image:nil]);
</ins><span class="cx">         NSUInteger index = [uiDelegate _webView:_webView indexIntoAttachmentListForElement:element.get()];
</span><span class="cx">         if (index != NSNotFound) {
</span><span class="cx">             BOOL sourceIsManaged = NO;
</span><span class="lines">@@ -4042,11 +4086,11 @@
</span><span class="cx"> 
</span><span class="cx">     if ([_previewItemController type] == UIPreviewItemTypeLink) {
</span><span class="cx">         _highlightLongPressCanClick = NO;
</span><del>-        _page-&gt;startInteractionWithElementAtPosition(_positionInformation.point);
</del><ins>+        _page-&gt;startInteractionWithElementAtPosition(_positionInformation.request.point);
</ins><span class="cx"> 
</span><span class="cx">         // Treat animated images like a link preview
</span><span class="cx">         if (isValidURLForImagePreview &amp;&amp; _positionInformation.isAnimatedImage) {
</span><del>-            RetainPtr&lt;_WKActivatedElementInfo&gt; animatedImageElementInfo = adoptNS([[_WKActivatedElementInfo alloc] _initWithType:_WKActivatedElementTypeImage URL:targetURL location:_positionInformation.point title:_positionInformation.title ID:_positionInformation.idAttribute rect:_positionInformation.bounds image:_positionInformation.image.get()]);
</del><ins>+            RetainPtr&lt;_WKActivatedElementInfo&gt; animatedImageElementInfo = adoptNS([[_WKActivatedElementInfo alloc] _initWithType:_WKActivatedElementTypeImage URL:targetURL location:_positionInformation.request.point title:_positionInformation.title ID:_positionInformation.idAttribute rect:_positionInformation.bounds image:_positionInformation.image.get()]);
</ins><span class="cx"> 
</span><span class="cx">             if ([uiDelegate respondsToSelector:@selector(_webView:previewViewControllerForAnimatedImageAtURL:defaultActions:elementInfo:imageSize:)]) {
</span><span class="cx">                 RetainPtr&lt;NSArray&gt; actions = [_actionSheetAssistant defaultActionsForImageSheet:animatedImageElementInfo.get()];
</span><span class="lines">@@ -4054,7 +4098,7 @@
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        RetainPtr&lt;_WKActivatedElementInfo&gt; elementInfo = adoptNS([[_WKActivatedElementInfo alloc] _initWithType:_WKActivatedElementTypeLink URL:targetURL location:_positionInformation.point title:_positionInformation.title ID:_positionInformation.idAttribute rect:_positionInformation.bounds image:_positionInformation.image.get()]);
</del><ins>+        RetainPtr&lt;_WKActivatedElementInfo&gt; elementInfo = adoptNS([[_WKActivatedElementInfo alloc] _initWithType:_WKActivatedElementTypeLink URL:targetURL location:_positionInformation.request.point title:_positionInformation.title ID:_positionInformation.idAttribute rect:_positionInformation.bounds image:_positionInformation.image.get()]);
</ins><span class="cx"> 
</span><span class="cx">         auto actions = [_actionSheetAssistant defaultActionsForLinkSheet:elementInfo.get()];
</span><span class="cx">         if ([uiDelegate respondsToSelector:@selector(webView:previewingViewControllerForElement:defaultActions:)]) {
</span><span class="lines">@@ -4082,8 +4126,8 @@
</span><span class="cx">         if (!isValidURLForImagePreview)
</span><span class="cx">             return nil;
</span><span class="cx"> 
</span><del>-        RetainPtr&lt;_WKActivatedElementInfo&gt; elementInfo = adoptNS([[_WKActivatedElementInfo alloc] _initWithType:_WKActivatedElementTypeImage URL:targetURL location:_positionInformation.point title:_positionInformation.title ID:_positionInformation.idAttribute rect:_positionInformation.bounds image:_positionInformation.image.get()]);
-        _page-&gt;startInteractionWithElementAtPosition(_positionInformation.point);
</del><ins>+        RetainPtr&lt;_WKActivatedElementInfo&gt; elementInfo = adoptNS([[_WKActivatedElementInfo alloc] _initWithType:_WKActivatedElementTypeImage URL:targetURL location:_positionInformation.request.point title:_positionInformation.title ID:_positionInformation.idAttribute rect:_positionInformation.bounds image:_positionInformation.image.get()]);
+        _page-&gt;startInteractionWithElementAtPosition(_positionInformation.request.point);
</ins><span class="cx"> 
</span><span class="cx">         if ([uiDelegate respondsToSelector:@selector(_webView:willPreviewImageWithURL:)])
</span><span class="cx">             [uiDelegate _webView:_webView willPreviewImageWithURL:targetURL];
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKPDFViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKPDFView.mm (209404 => 209405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKPDFView.mm        2016-12-06 17:58:39 UTC (rev 209404)
+++ trunk/Source/WebKit2/UIProcess/ios/WKPDFView.mm        2016-12-06 18:24:28 UTC (rev 209405)
</span><span class="lines">@@ -690,8 +690,9 @@
</span><span class="cx">     if (!url)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+    _positionInformation.request.point = roundedIntPoint([controller.pageView convertPoint:point toView:self]);
+
</ins><span class="cx">     _positionInformation.url = url.absoluteString;
</span><del>-    _positionInformation.point = roundedIntPoint([controller.pageView convertPoint:point toView:self]);
</del><span class="cx">     _positionInformation.bounds = roundedIntRect([self convertRect:[controller.pageView convertRectFromPDFPageSpace:annotation.Rect] fromView:controller.pageView]);
</span><span class="cx"> 
</span><span class="cx">     [self _highlightLinkAnnotation:linkAnnotation forDuration:.75 completionHandler:^{
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWebPageProxyIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm (209404 => 209405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm        2016-12-06 17:58:39 UTC (rev 209404)
+++ trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm        2016-12-06 18:24:28 UTC (rev 209405)
</span><span class="lines">@@ -628,14 +628,14 @@
</span><span class="cx">     m_pageClient.positionInformationDidChange(info);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::getPositionInformation(const WebCore::IntPoint&amp; point, InteractionInformationAtPosition&amp; info)
</del><ins>+void WebPageProxy::getPositionInformation(const InteractionInformationRequest&amp; request, InteractionInformationAtPosition&amp; info)
</ins><span class="cx"> {
</span><del>-    m_process-&gt;sendSync(Messages::WebPage::GetPositionInformation(point), Messages::WebPage::GetPositionInformation::Reply(info), m_pageID);
</del><ins>+    m_process-&gt;sendSync(Messages::WebPage::GetPositionInformation(request), Messages::WebPage::GetPositionInformation::Reply(info), m_pageID);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::requestPositionInformation(const WebCore::IntPoint&amp; point)
</del><ins>+void WebPageProxy::requestPositionInformation(const InteractionInformationRequest&amp; request)
</ins><span class="cx"> {
</span><del>-    m_process-&gt;send(Messages::WebPage::RequestPositionInformation(point), m_pageID);
</del><ins>+    m_process-&gt;send(Messages::WebPage::RequestPositionInformation(request), m_pageID);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPageProxy::startInteractionWithElementAtPosition(const WebCore::IntPoint&amp; point)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (209404 => 209405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2016-12-06 17:58:39 UTC (rev 209404)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2016-12-06 18:24:28 UTC (rev 209405)
</span><span class="lines">@@ -628,6 +628,8 @@
</span><span class="cx">                 2D429BFD1721E2C700EC681F /* PDFPluginPasswordField.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D429BFB1721E2BA00EC681F /* PDFPluginPasswordField.mm */; };
</span><span class="cx">                 2D47B56C1810714E003A3AEE /* RemoteLayerBackingStore.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D47B56A1810714E003A3AEE /* RemoteLayerBackingStore.mm */; };
</span><span class="cx">                 2D47B56D1810714E003A3AEE /* RemoteLayerBackingStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D47B56B1810714E003A3AEE /* RemoteLayerBackingStore.h */; };
</span><ins>+                2D4D2C811DF60BF3002EB10C /* InteractionInformationRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D4D2C7F1DF60BF3002EB10C /* InteractionInformationRequest.h */; };
+                2D4D2C821DF60BF3002EB10C /* InteractionInformationRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D4D2C801DF60BF3002EB10C /* InteractionInformationRequest.cpp */; };
</ins><span class="cx">                 2D50365E1BCC793F00E20BB3 /* NativeWebGestureEventMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D50365D1BCC793F00E20BB3 /* NativeWebGestureEventMac.mm */; };
</span><span class="cx">                 2D50366B1BCDE17900E20BB3 /* NativeWebGestureEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D50366A1BCDE17900E20BB3 /* NativeWebGestureEvent.h */; };
</span><span class="cx">                 2D5036751BCED19F00E20BB3 /* WebGestureEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D5036731BCED19F00E20BB3 /* WebGestureEvent.cpp */; };
</span><span class="lines">@@ -2697,6 +2699,8 @@
</span><span class="cx">                 2D429BFB1721E2BA00EC681F /* PDFPluginPasswordField.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = PDFPluginPasswordField.mm; path = PDF/PDFPluginPasswordField.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D47B56A1810714E003A3AEE /* RemoteLayerBackingStore.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RemoteLayerBackingStore.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D47B56B1810714E003A3AEE /* RemoteLayerBackingStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteLayerBackingStore.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                2D4D2C7F1DF60BF3002EB10C /* InteractionInformationRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InteractionInformationRequest.h; path = ios/InteractionInformationRequest.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2D4D2C801DF60BF3002EB10C /* InteractionInformationRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InteractionInformationRequest.cpp; path = ios/InteractionInformationRequest.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 2D50365D1BCC793F00E20BB3 /* NativeWebGestureEventMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeWebGestureEventMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D50366A1BCDE17900E20BB3 /* NativeWebGestureEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeWebGestureEvent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D5036731BCED19F00E20BB3 /* WebGestureEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebGestureEvent.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -5038,6 +5042,8 @@
</span><span class="cx">                                 2DA9449D1884E4F000ED86DB /* GestureTypes.h */,
</span><span class="cx">                                 C5BCE5DA1C50761D00CDE3FA /* InteractionInformationAtPosition.h */,
</span><span class="cx">                                 C5BCE5DB1C50761D00CDE3FA /* InteractionInformationAtPosition.mm */,
</span><ins>+                                2D4D2C7F1DF60BF3002EB10C /* InteractionInformationRequest.h */,
+                                2D4D2C801DF60BF3002EB10C /* InteractionInformationRequest.cpp */,
</ins><span class="cx">                                 2DA944971884E4F000ED86DB /* NativeWebKeyboardEventIOS.mm */,
</span><span class="cx">                                 2DA944981884E4F000ED86DB /* NativeWebTouchEventIOS.mm */,
</span><span class="cx">                                 A118A9EC1907AD6F00F7C92B /* QuickLookDocumentData.cpp */,
</span><span class="lines">@@ -7934,6 +7940,7 @@
</span><span class="cx">                                 2DAF06D618BD1A470081CEB1 /* SmartMagnificationController.h in Headers */,
</span><span class="cx">                                 2DE6943E18BD2A68005C15E5 /* SmartMagnificationControllerMessages.h in Headers */,
</span><span class="cx">                                 5272B28B1406985D0096A5D0 /* StatisticsData.h in Headers */,
</span><ins>+                                2D4D2C811DF60BF3002EB10C /* InteractionInformationRequest.h in Headers */,
</ins><span class="cx">                                 514BDED316C98EDD00E4E25E /* StatisticsRequest.h in Headers */,
</span><span class="cx">                                 1AD3306F16B1D991004F60E7 /* StorageAreaImpl.h in Headers */,
</span><span class="cx">                                 1ACECD2517162DB1001FC9EF /* StorageAreaMap.h in Headers */,
</span><span class="lines">@@ -9186,6 +9193,7 @@
</span><span class="cx">                                 51E35209180F5D6B00E53BE9 /* DatabaseServiceEntryPoint.mm in Sources */,
</span><span class="cx">                                 51E35200180F5D0F00E53BE9 /* DatabaseToWebProcessConnection.cpp in Sources */,
</span><span class="cx">                                 51032F1D180F791700961BB7 /* DatabaseToWebProcessConnectionMessageReceiver.cpp in Sources */,
</span><ins>+                                2D4D2C821DF60BF3002EB10C /* InteractionInformationRequest.cpp in Sources */,
</ins><span class="cx">                                 C55F91701C595F630029E92D /* DataDetectionResult.mm in Sources */,
</span><span class="cx">                                 1AC7537F183BE50F0072CB15 /* DataReference.cpp in Sources */,
</span><span class="cx">                                 BC032DA510F437D10058C15A /* Decoder.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (209404 => 209405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2016-12-06 17:58:39 UTC (rev 209404)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2016-12-06 18:24:28 UTC (rev 209405)
</span><span class="lines">@@ -197,6 +197,7 @@
</span><span class="cx"> struct EditorState;
</span><span class="cx"> class GamepadData;
</span><span class="cx"> struct InteractionInformationAtPosition;
</span><ins>+struct InteractionInformationRequest;
</ins><span class="cx"> struct LoadParameters;
</span><span class="cx"> struct PrintInfo;
</span><span class="cx"> struct WebPageCreationParameters;
</span><span class="lines">@@ -561,8 +562,8 @@
</span><span class="cx">     void syncApplyAutocorrection(const String&amp; correction, const String&amp; originalText, bool&amp; correctionApplied);
</span><span class="cx">     void requestAutocorrectionContext(uint64_t callbackID);
</span><span class="cx">     void getAutocorrectionContext(String&amp; beforeText, String&amp; markedText, String&amp; selectedText, String&amp; afterText, uint64_t&amp; location, uint64_t&amp; length);
</span><del>-    void getPositionInformation(const WebCore::IntPoint&amp;, InteractionInformationAtPosition&amp;);
-    void requestPositionInformation(const WebCore::IntPoint&amp;);
</del><ins>+    void getPositionInformation(const InteractionInformationRequest&amp;, InteractionInformationAtPosition&amp;);
+    void requestPositionInformation(const InteractionInformationRequest&amp;);
</ins><span class="cx">     void startInteractionWithElementAtPosition(const WebCore::IntPoint&amp;);
</span><span class="cx">     void stopInteraction();
</span><span class="cx">     void performActionOnElement(uint32_t action);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagemessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (209404 => 209405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in        2016-12-06 17:58:39 UTC (rev 209404)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in        2016-12-06 18:24:28 UTC (rev 209405)
</span><span class="lines">@@ -76,8 +76,8 @@
</span><span class="cx">     SyncApplyAutocorrection(String correction, String originalText) -&gt; (bool autocorrectionApplied)
</span><span class="cx">     RequestAutocorrectionContext(uint64_t callbackID)
</span><span class="cx">     GetAutocorrectionContext() -&gt; (String beforeContext, String markedText, String selectedText, String afterContext, uint64_t location, uint64_t length) 
</span><del>-    GetPositionInformation(WebCore::IntPoint point) -&gt; (struct WebKit::InteractionInformationAtPosition information)
-    RequestPositionInformation(WebCore::IntPoint point)
</del><ins>+    GetPositionInformation(struct WebKit::InteractionInformationRequest request) -&gt; (struct WebKit::InteractionInformationAtPosition information)
+    RequestPositionInformation(struct WebKit::InteractionInformationRequest request)
</ins><span class="cx">     StartInteractionWithElementAtPosition(WebCore::IntPoint point)
</span><span class="cx">     StopInteraction()
</span><span class="cx">     PerformActionOnElement(uint32_t action)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (209404 => 209405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2016-12-06 17:58:39 UTC (rev 209404)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2016-12-06 18:24:28 UTC (rev 209405)
</span><span class="lines">@@ -598,7 +598,8 @@
</span><span class="cx">     if (!frameRespondingToClick || lastLayerTreeTransactionId &lt; WebFrame::fromCoreFrame(*frameRespondingToClick)-&gt;firstLayerTreeTransactionIDAfterDidCommitLoad())
</span><span class="cx">         send(Messages::WebPageProxy::DidNotHandleTapAsClick(adjustedIntPoint));
</span><span class="cx">     else if (is&lt;Element&gt;(*nodeRespondingToClick) &amp;&amp; DataDetection::shouldCancelDefaultAction(downcast&lt;Element&gt;(*nodeRespondingToClick))) {
</span><del>-        requestPositionInformation(adjustedIntPoint);
</del><ins>+        InteractionInformationRequest request(adjustedIntPoint);
+        requestPositionInformation(request);
</ins><span class="cx">         send(Messages::WebPageProxy::DidNotHandleTapAsClick(adjustedIntPoint));
</span><span class="cx">     } else
</span><span class="cx">         handleSyntheticClick(nodeRespondingToClick, adjustedPoint);
</span><span class="lines">@@ -658,7 +659,8 @@
</span><span class="cx">     }
</span><span class="cx">     sendTapHighlightForNodeIfNecessary(requestID, nodeRespondingToClick);
</span><span class="cx">     if (is&lt;Element&gt;(*nodeRespondingToClick) &amp;&amp; DataDetection::shouldCancelDefaultAction(downcast&lt;Element&gt;(*nodeRespondingToClick))) {
</span><del>-        requestPositionInformation(roundedIntPoint(adjustedPoint));
</del><ins>+        InteractionInformationRequest request(roundedIntPoint(adjustedPoint));
+        requestPositionInformation(request);
</ins><span class="cx">         send(Messages::WebPageProxy::DidNotHandleTapAsClick(roundedIntPoint(adjustedPoint)));
</span><span class="cx">     } else
</span><span class="cx">         completeSyntheticClick(nodeRespondingToClick, adjustedPoint, WebCore::TwoFingerTap);
</span><span class="lines">@@ -692,7 +694,8 @@
</span><span class="cx"> 
</span><span class="cx">     if (m_potentialTapNode == nodeRespondingToClick) {
</span><span class="cx">         if (is&lt;Element&gt;(*nodeRespondingToClick) &amp;&amp; DataDetection::shouldCancelDefaultAction(downcast&lt;Element&gt;(*nodeRespondingToClick))) {
</span><del>-            requestPositionInformation(roundedIntPoint(m_potentialTapLocation));
</del><ins>+            InteractionInformationRequest request(roundedIntPoint(m_potentialTapLocation));
+            requestPositionInformation(request);
</ins><span class="cx">             commitPotentialTapFailed();
</span><span class="cx">         } else
</span><span class="cx">             handleSyntheticClick(nodeRespondingToClick, adjustedPoint);
</span><span class="lines">@@ -2274,12 +2277,13 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPage::getPositionInformation(const IntPoint&amp; point, InteractionInformationAtPosition&amp; info)
</del><ins>+void WebPage::getPositionInformation(const InteractionInformationRequest&amp; request, InteractionInformationAtPosition&amp; info)
</ins><span class="cx"> {
</span><ins>+    info.request = request;
+
</ins><span class="cx">     FloatPoint adjustedPoint;
</span><del>-    Node* hitNode = m_page-&gt;mainFrame().nodeRespondingToClickEvents(point, adjustedPoint);
</del><ins>+    Node* hitNode = m_page-&gt;mainFrame().nodeRespondingToClickEvents(request.point, adjustedPoint);
</ins><span class="cx"> 
</span><del>-    info.point = point;
</del><span class="cx">     info.nodeAtPositionIsAssistedNode = (hitNode == m_assistedNode);
</span><span class="cx">     if (m_assistedNode) {
</span><span class="cx">         const Frame&amp; frame = m_page-&gt;focusController().focusedOrMainFrame();
</span><span class="lines">@@ -2287,7 +2291,7 @@
</span><span class="cx">             const uint32_t kHitAreaWidth = 66;
</span><span class="cx">             const uint32_t kHitAreaHeight = 66;
</span><span class="cx">             FrameView&amp; view = *frame.view();
</span><del>-            IntPoint adjustedPoint(view.rootViewToContents(point));
</del><ins>+            IntPoint adjustedPoint(view.rootViewToContents(request.point));
</ins><span class="cx">             IntPoint constrainedPoint = m_assistedNode ? constrainPoint(adjustedPoint, frame, *m_assistedNode) : adjustedPoint;
</span><span class="cx">             VisiblePosition position = frame.visiblePositionForPoint(constrainedPoint);
</span><span class="cx"> 
</span><span class="lines">@@ -2297,9 +2301,9 @@
</span><span class="cx">             else if (position &gt; compositionRange-&gt;endPosition())
</span><span class="cx">                 position = compositionRange-&gt;endPosition();
</span><span class="cx">             IntRect caretRect = view.contentsToRootView(position.absoluteCaretBounds());
</span><del>-            float deltaX = abs(caretRect.x() + (caretRect.width() / 2) - point.x());
-            float deltaYFromTheTop = abs(caretRect.y() - point.y());
-            float deltaYFromTheBottom = abs(caretRect.y() + caretRect.height() - point.y());
</del><ins>+            float deltaX = abs(caretRect.x() + (caretRect.width() / 2) - request.point.x());
+            float deltaYFromTheTop = abs(caretRect.y() - request.point.y());
+            float deltaYFromTheBottom = abs(caretRect.y() + caretRect.height() - request.point.y());
</ins><span class="cx"> 
</span><span class="cx">             info.isNearMarkedText = !(deltaX &gt; kHitAreaWidth || deltaYFromTheTop &gt; kHitAreaHeight || deltaYFromTheBottom &gt; kHitAreaHeight);
</span><span class="cx">         }
</span><span class="lines">@@ -2323,20 +2327,26 @@
</span><span class="cx">                 if (linkElement) {
</span><span class="cx">                     info.isLink = true;
</span><span class="cx"> 
</span><del>-                    // Ensure that the image contains at most 600K pixels, so that it is not too big.
-                    if (RefPtr&lt;WebImage&gt; snapshot = snapshotNode(*element, SnapshotOptionsShareable, 600 * 1024))
-                        info.image = snapshot-&gt;bitmap();
</del><ins>+                    if (request.includeSnapshot) {
+                        // Ensure that the image contains at most 600K pixels, so that it is not too big.
+                        if (RefPtr&lt;WebImage&gt; snapshot = snapshotNode(*element, SnapshotOptionsShareable, 600 * 1024))
+                            info.image = snapshot-&gt;bitmap();
+                    }
</ins><span class="cx"> 
</span><del>-                    RefPtr&lt;Range&gt; linkRange = rangeOfContents(*linkElement);
-                    if (linkRange) {
-                        float deviceScaleFactor = corePage()-&gt;deviceScaleFactor();
-                        const float marginInPoints = 4;
</del><ins>+                    if (request.includeLinkIndicator) {
+                        RefPtr&lt;Range&gt; linkRange = rangeOfContents(*linkElement);
+                        if (linkRange) {
+                            float deviceScaleFactor = corePage()-&gt;deviceScaleFactor();
+                            const float marginInPoints = 4;
</ins><span class="cx"> 
</span><del>-                        RefPtr&lt;TextIndicator&gt; textIndicator = TextIndicator::createWithRange(*linkRange, TextIndicatorOptionTightlyFitContent | TextIndicatorOptionRespectTextColor | TextIndicatorOptionPaintBackgrounds | TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges |
-                            TextIndicatorOptionIncludeMarginIfRangeMatchesSelection, TextIndicatorPresentationTransition::None, FloatSize(marginInPoints * deviceScaleFactor, marginInPoints * deviceScaleFactor));
-                        if (textIndicator)
-                            info.linkIndicator = textIndicator-&gt;data();
</del><ins>+                            RefPtr&lt;TextIndicator&gt; textIndicator = TextIndicator::createWithRange(*linkRange, TextIndicatorOptionTightlyFitContent | TextIndicatorOptionRespectTextColor | TextIndicatorOptionPaintBackgrounds | TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges |
+                                TextIndicatorOptionIncludeMarginIfRangeMatchesSelection, TextIndicatorPresentationTransition::None, FloatSize(marginInPoints * deviceScaleFactor, marginInPoints * deviceScaleFactor));
+
+                            if (textIndicator)
+                                info.linkIndicator = textIndicator-&gt;data();
+                        }
</ins><span class="cx">                     }
</span><ins>+
</ins><span class="cx"> #if ENABLE(DATA_DETECTION)
</span><span class="cx">                     info.isDataDetectorLink = DataDetection::isDataDetectorLink(*element);
</span><span class="cx">                     if (info.isDataDetectorLink) {
</span><span class="lines">@@ -2400,7 +2410,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!elementIsLinkOrImage) {
</span><del>-        HitTestResult result = m_page-&gt;mainFrame().eventHandler().hitTestResultAtPoint((point), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::DisallowUserAgentShadowContent | HitTestRequest::AllowChildFrameContent);
</del><ins>+        HitTestResult result = m_page-&gt;mainFrame().eventHandler().hitTestResultAtPoint(request.point, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::DisallowUserAgentShadowContent | HitTestRequest::AllowChildFrameContent);
</ins><span class="cx">         hitNode = result.innerNode();
</span><span class="cx">         // Hit test could return HTMLHtmlElement that has no renderer, if the body is smaller than the document.
</span><span class="cx">         if (hitNode &amp;&amp; hitNode-&gt;renderer()) {
</span><span class="lines">@@ -2423,11 +2433,11 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPage::requestPositionInformation(const IntPoint&amp; point)
</del><ins>+void WebPage::requestPositionInformation(const InteractionInformationRequest&amp; request)
</ins><span class="cx"> {
</span><span class="cx">     InteractionInformationAtPosition info;
</span><span class="cx"> 
</span><del>-    getPositionInformation(point, info);
</del><ins>+    getPositionInformation(request, info);
</ins><span class="cx">     send(Messages::WebPageProxy::DidReceivePositionInformation(info));
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>