<!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>[168388] 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/168388">168388</a></dd>
<dt>Author</dt> <dd>benjamin@webkit.org</dd>
<dt>Date</dt> <dd>2014-05-06 15:53:12 -0700 (Tue, 06 May 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>[iOS][WK2] Add tap highlight on the simple UITapGestureRecognizer
https://bugs.webkit.org/show_bug.cgi?id=132623
<rdar://problem/16709507>
Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-05-06
Reviewed by Enrica Casucci.
Add a low latency highlight for tap/click.
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::commitPotentialTapFailed):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView _showTapHighlightWithColor:WebCore::quads:WebCore::topLeftRadius:WebCore::topRightRadius:WebCore::bottomLeftRadius:WebCore::bottomRightRadius:WebCore::]):
(-[WKContentView _didGetTapHighlightForRequest:color:WebCore::quads:WebCore::topLeftRadius:WebCore::topRightRadius:WebCore::bottomLeftRadius:WebCore::bottomRightRadius:WebCore::]):
(-[WKContentView _finishInteraction]):
(-[WKContentView _highlightLongPressRecognized:]):
(-[WKContentView _singleTapRecognized:]):
(-[WKContentView _singleTapDidReset:]):
(-[WKContentView _commitPotentialTapFailed]):
(-[WKContentView _singleTapCommited:]):
(-[WKContentView _attemptClickAtLocation:]):
* UIProcess/ios/WKSyntheticClickTapGestureRecognizer.h: Added.
* UIProcess/ios/WKSyntheticClickTapGestureRecognizer.m: Added.
(-[WKSyntheticClickTapGestureRecognizer setGestureRecognizedTarget:action:]):
(-[WKSyntheticClickTapGestureRecognizer setResetTarget:action:]):
(-[WKSyntheticClickTapGestureRecognizer setState:]):
(-[WKSyntheticClickTapGestureRecognizer reset]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::potentialTapAtPosition):
(WebKit::WebPageProxy::commitPotentialTap):
(WebKit::WebPageProxy::cancelPotentialTap):
(WebKit::WebPageProxy::tapHighlightAtPosition):
(WebKit::WebPageProxy::commitPotentialTapFailed):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):
(WebKit::WebPage::handleTap):
(WebKit::WebPage::sendTapHighlightForNodeIfNecessary):
(WebKit::WebPage::potentialTapAtPosition):
(WebKit::WebPage::commitPotentialTap):
(WebKit::WebPage::cancelPotentialTap):
(WebKit::WebPage::tapHighlightAtPosition):</pre>
<h3>Modified Paths</h3>
<ul>
<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="#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="#trunkSourceWebKit2UIProcessiosWKSyntheticClickTapGestureRecognizerh">trunk/Source/WebKit2/UIProcess/ios/WKSyntheticClickTapGestureRecognizer.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWKSyntheticClickTapGestureRecognizerm">trunk/Source/WebKit2/UIProcess/ios/WKSyntheticClickTapGestureRecognizer.m</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (168387 => 168388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-05-06 22:44:56 UTC (rev 168387)
+++ trunk/Source/WebKit2/ChangeLog        2014-05-06 22:53:12 UTC (rev 168388)
</span><span class="lines">@@ -1,3 +1,55 @@
</span><ins>+2014-05-06 Benjamin Poulain <bpoulain@apple.com>
+
+ [iOS][WK2] Add tap highlight on the simple UITapGestureRecognizer
+ https://bugs.webkit.org/show_bug.cgi?id=132623
+ <rdar://problem/16709507>
+
+ Reviewed by Enrica Casucci.
+
+ Add a low latency highlight for tap/click.
+
+ * UIProcess/PageClient.h:
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/WebPageProxy.messages.in:
+ * UIProcess/ios/PageClientImplIOS.h:
+ * UIProcess/ios/PageClientImplIOS.mm:
+ (WebKit::PageClientImpl::commitPotentialTapFailed):
+ * UIProcess/ios/WKContentViewInteraction.h:
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView setupInteraction]):
+ (-[WKContentView _showTapHighlightWithColor:WebCore::quads:WebCore::topLeftRadius:WebCore::topRightRadius:WebCore::bottomLeftRadius:WebCore::bottomRightRadius:WebCore::]):
+ (-[WKContentView _didGetTapHighlightForRequest:color:WebCore::quads:WebCore::topLeftRadius:WebCore::topRightRadius:WebCore::bottomLeftRadius:WebCore::bottomRightRadius:WebCore::]):
+ (-[WKContentView _finishInteraction]):
+ (-[WKContentView _highlightLongPressRecognized:]):
+ (-[WKContentView _singleTapRecognized:]):
+ (-[WKContentView _singleTapDidReset:]):
+ (-[WKContentView _commitPotentialTapFailed]):
+ (-[WKContentView _singleTapCommited:]):
+ (-[WKContentView _attemptClickAtLocation:]):
+ * UIProcess/ios/WKSyntheticClickTapGestureRecognizer.h: Added.
+ * UIProcess/ios/WKSyntheticClickTapGestureRecognizer.m: Added.
+ (-[WKSyntheticClickTapGestureRecognizer setGestureRecognizedTarget:action:]):
+ (-[WKSyntheticClickTapGestureRecognizer setResetTarget:action:]):
+ (-[WKSyntheticClickTapGestureRecognizer setState:]):
+ (-[WKSyntheticClickTapGestureRecognizer reset]):
+ * UIProcess/ios/WebPageProxyIOS.mm:
+ (WebKit::WebPageProxy::potentialTapAtPosition):
+ (WebKit::WebPageProxy::commitPotentialTap):
+ (WebKit::WebPageProxy::cancelPotentialTap):
+ (WebKit::WebPageProxy::tapHighlightAtPosition):
+ (WebKit::WebPageProxy::commitPotentialTapFailed):
+ * WebKit2.xcodeproj/project.pbxproj:
+ * WebProcess/WebPage/WebPage.h:
+ * WebProcess/WebPage/WebPage.messages.in:
+ * WebProcess/WebPage/ios/WebPageIOS.mm:
+ (WebKit::WebPage::handleSyntheticClick):
+ (WebKit::WebPage::handleTap):
+ (WebKit::WebPage::sendTapHighlightForNodeIfNecessary):
+ (WebKit::WebPage::potentialTapAtPosition):
+ (WebKit::WebPage::commitPotentialTap):
+ (WebKit::WebPage::cancelPotentialTap):
+ (WebKit::WebPage::tapHighlightAtPosition):
+
</ins><span class="cx"> 2014-05-06 Anders Carlsson <andersca@apple.com>
</span><span class="cx">
</span><span class="cx"> Put WebArchive and WebArchiveResource in the API namespace.
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessPageClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/PageClient.h (168387 => 168388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/PageClient.h        2014-05-06 22:44:56 UTC (rev 168387)
+++ trunk/Source/WebKit2/UIProcess/PageClient.h        2014-05-06 22:53:12 UTC (rev 168388)
</span><span class="lines">@@ -241,6 +241,7 @@
</span><span class="cx"> #endif // PLATFORM(MAC)
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><ins>+ virtual void commitPotentialTapFailed() = 0;
</ins><span class="cx"> virtual void didGetTapHighlightGeometries(uint64_t requestID, const WebCore::Color&, const Vector<WebCore::FloatQuad>& highlightedQuads, const WebCore::IntSize& topLeftRadius, const WebCore::IntSize& topRightRadius, const WebCore::IntSize& bottomLeftRadius, const WebCore::IntSize& bottomRightRadius) = 0;
</span><span class="cx">
</span><span class="cx"> virtual void didCommitLayerTree(const RemoteLayerTreeTransaction&) = 0;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (168387 => 168388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-05-06 22:44:56 UTC (rev 168387)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-05-06 22:53:12 UTC (rev 168388)
</span><span class="lines">@@ -622,6 +622,7 @@
</span><span class="cx"> void applicationWillResignActive();
</span><span class="cx"> void applicationDidBecomeActive();
</span><span class="cx"> void zoomToRect(WebCore::FloatRect, double minimumScale, double maximumScale);
</span><ins>+ void commitPotentialTapFailed();
</ins><span class="cx"> void didNotHandleTapAsClick(const WebCore::IntPoint&);
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="lines">@@ -1030,6 +1031,9 @@
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> void willStartUserTriggeredZooming();
</span><span class="cx">
</span><ins>+ void potentialTapAtPosition(const WebCore::FloatPoint&, uint64_t& requestID);
+ void commitPotentialTap();
+ void cancelPotentialTap();
</ins><span class="cx"> void tapHighlightAtPosition(const WebCore::FloatPoint&, uint64_t& requestID);
</span><span class="cx">
</span><span class="cx"> void blurAssistedNode();
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (168387 => 168388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2014-05-06 22:44:56 UTC (rev 168387)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2014-05-06 22:53:12 UTC (rev 168388)
</span><span class="lines">@@ -169,6 +169,7 @@
</span><span class="cx"> DidUpdateBlockSelectionWithTouch(uint32_t touch, uint32_t flags, float growThreshold, float shrinkThreshold)
</span><span class="cx"> ShowPlaybackTargetPicker(bool hasVideo, WebCore::IntRect elementRect)
</span><span class="cx"> ZoomToRect(WebCore::FloatRect rect, double minimumScale, double maximumScale)
</span><ins>+ CommitPotentialTapFailed()
</ins><span class="cx"> DidNotHandleTapAsClick(WebCore::IntPoint point)
</span><span class="cx"> #endif
</span><span class="cx"> #if PLATFORM(GTK)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosPageClientImplIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h (168387 => 168388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h        2014-05-06 22:44:56 UTC (rev 168387)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h        2014-05-06 22:53:12 UTC (rev 168388)
</span><span class="lines">@@ -106,6 +106,7 @@
</span><span class="cx"> virtual void wheelEventWasNotHandledByWebCore(const NativeWebWheelEvent&) override;
</span><span class="cx"> virtual void clearCustomSwipeViews() override;
</span><span class="cx">
</span><ins>+ virtual void commitPotentialTapFailed() override;
</ins><span class="cx"> virtual void didGetTapHighlightGeometries(uint64_t requestID, const WebCore::Color&, const Vector<WebCore::FloatQuad>& highlightedQuads, const WebCore::IntSize& topLeftRadius, const WebCore::IntSize& topRightRadius, const WebCore::IntSize& bottomLeftRadius, const WebCore::IntSize& bottomRightRadius) override;
</span><span class="cx">
</span><span class="cx"> virtual void didCommitLayerTree(const RemoteLayerTreeTransaction&) override;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosPageClientImplIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm (168387 => 168388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm        2014-05-06 22:44:56 UTC (rev 168387)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm        2014-05-06 22:53:12 UTC (rev 168388)
</span><span class="lines">@@ -366,6 +366,11 @@
</span><span class="cx"> notImplemented();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void PageClientImpl::commitPotentialTapFailed()
+{
+ [m_contentView _commitPotentialTapFailed];
+}
+
</ins><span class="cx"> void PageClientImpl::didGetTapHighlightGeometries(uint64_t requestID, const WebCore::Color& color, const Vector<WebCore::FloatQuad>& highlightedQuads, const WebCore::IntSize& topLeftRadius, const WebCore::IntSize& topRightRadius, const WebCore::IntSize& bottomLeftRadius, const WebCore::IntSize& bottomRightRadius)
</span><span class="cx"> {
</span><span class="cx"> [m_contentView _didGetTapHighlightForRequest:requestID color:color quads:highlightedQuads topLeftRadius:topLeftRadius topRightRadius:topRightRadius bottomLeftRadius:bottomLeftRadius bottomRightRadius:bottomRightRadius];
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewInteractionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h (168387 => 168388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h        2014-05-06 22:44:56 UTC (rev 168387)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h        2014-05-06 22:53:12 UTC (rev 168388)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #import "AssistedNodeInformation.h"
</span><span class="cx"> #import "GestureTypes.h"
</span><span class="cx"> #import "InteractionInformationAtPosition.h"
</span><ins>+#import "WKSyntheticClickTapGestureRecognizer.h"
</ins><span class="cx"> #import "WKAirPlayRoutePicker.h"
</span><span class="cx"> #import "WKFileUploadPanel.h"
</span><span class="cx"> #import "WKFormPeripheral.h"
</span><span class="lines">@@ -39,6 +40,8 @@
</span><span class="cx"> #import <UIKit/UIWKTextInteractionAssistant.h>
</span><span class="cx"> #import <UIKit/UIWebFormAccessory.h>
</span><span class="cx"> #import <UIKit/UIWebTouchEventsGestureRecognizer.h>
</span><ins>+#import <WebCore/Color.h>
+#import <WebCore/FloatQuad.h>
</ins><span class="cx"> #import <wtf/Forward.h>
</span><span class="cx"> #import <wtf/Vector.h>
</span><span class="cx"> #import <wtf/text/WTFString.h>
</span><span class="lines">@@ -84,7 +87,7 @@
</span><span class="cx">
</span><span class="cx"> BOOL _canSendTouchEventsAsynchronously;
</span><span class="cx">
</span><del>- RetainPtr<UITapGestureRecognizer> _singleTapGestureRecognizer;
</del><ins>+ RetainPtr<WKSyntheticClickTapGestureRecognizer> _singleTapGestureRecognizer;
</ins><span class="cx"> RetainPtr<_UIWebHighlightLongPressGestureRecognizer> _highlightLongPressGestureRecognizer;
</span><span class="cx"> RetainPtr<UILongPressGestureRecognizer> _longPressGestureRecognizer;
</span><span class="cx"> RetainPtr<UITapGestureRecognizer> _doubleTapGestureRecognizer;
</span><span class="lines">@@ -108,6 +111,15 @@
</span><span class="cx"> id <UITextInputDelegate> _inputDelegate;
</span><span class="cx">
</span><span class="cx"> uint64_t _latestTapHighlightID;
</span><ins>+ struct TapHighlightInformation {
+ WebCore::Color color;
+ Vector<WebCore::FloatQuad> quads;
+ WebCore::IntSize topLeftRadius;
+ WebCore::IntSize topRightRadius;
+ WebCore::IntSize bottomLeftRadius;
+ WebCore::IntSize bottomRightRadius;
+ };
+ std::unique_ptr<TapHighlightInformation> _potentialTapHighlightInformation;
</ins><span class="cx">
</span><span class="cx"> WebKit::WKAutoCorrectionData _autocorrectionData;
</span><span class="cx"> WebKit::InteractionInformationAtPosition _positionInformation;
</span><span class="lines">@@ -120,6 +132,7 @@
</span><span class="cx"> BOOL _showingTextStyleOptions;
</span><span class="cx"> BOOL _hasValidPositionInformation;
</span><span class="cx"> BOOL _isTapHighlightIDValid;
</span><ins>+ BOOL _potentialTapInProgress;
</ins><span class="cx"> BOOL _selectionNeedsUpdate;
</span><span class="cx"> BOOL _usingGestureForSelection;
</span><span class="cx"> }
</span><span class="lines">@@ -139,6 +152,7 @@
</span><span class="cx"> - (void)cleanupInteraction;
</span><span class="cx">
</span><span class="cx"> - (void)_webTouchEvent:(const WebKit::NativeWebTouchEvent&)touchEvent preventsNativeGestures:(BOOL)preventsDefault;
</span><ins>+- (void)_commitPotentialTapFailed;
</ins><span class="cx"> - (void)_didGetTapHighlightForRequest:(uint64_t)requestID color:(const WebCore::Color&)color quads:(const Vector<WebCore::FloatQuad>&)highlightedQuads topLeftRadius:(const WebCore::IntSize&)topLeftRadius topRightRadius:(const WebCore::IntSize&)topRightRadius bottomLeftRadius:(const WebCore::IntSize&)bottomLeftRadius bottomRightRadius:(const WebCore::IntSize&)bottomRightRadius;
</span><span class="cx">
</span><span class="cx"> - (void)_startAssistingNode:(const WebKit::AssistedNodeInformation&)information userIsInteracting:(BOOL)userIsInteracting userObject:(NSObject <NSSecureCoding> *)userObject;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewInteractionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (168387 => 168388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm        2014-05-06 22:44:56 UTC (rev 168387)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm        2014-05-06 22:53:12 UTC (rev 168388)
</span><span class="lines">@@ -191,8 +191,10 @@
</span><span class="cx"> [_touchEventGestureRecognizer setDelegate:self];
</span><span class="cx"> [self addGestureRecognizer:_touchEventGestureRecognizer.get()];
</span><span class="cx">
</span><del>- _singleTapGestureRecognizer = adoptNS([[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(_singleTapRecognized:)]);
</del><ins>+ _singleTapGestureRecognizer = adoptNS([[WKSyntheticClickTapGestureRecognizer alloc] initWithTarget:self action:@selector(_singleTapCommited:)]);
</ins><span class="cx"> [_singleTapGestureRecognizer setDelegate:self];
</span><ins>+ [_singleTapGestureRecognizer setGestureRecognizedTarget:self action:@selector(_singleTapRecognized:)];
+ [_singleTapGestureRecognizer setResetTarget:self action:@selector(_singleTapDidReset:)];
</ins><span class="cx"> [self addGestureRecognizer:_singleTapGestureRecognizer.get()];
</span><span class="cx">
</span><span class="cx"> _doubleTapGestureRecognizer = adoptNS([[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(_doubleTapRecognized:)]);
</span><span class="lines">@@ -362,11 +364,8 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-- (void)_didGetTapHighlightForRequest:(uint64_t)requestID color:(const WebCore::Color&)color quads:(const Vector<WebCore::FloatQuad>&)highlightedQuads topLeftRadius:(const WebCore::IntSize&)topLeftRadius topRightRadius:(const WebCore::IntSize&)topRightRadius bottomLeftRadius:(const WebCore::IntSize&)bottomLeftRadius bottomRightRadius:(const WebCore::IntSize&)bottomRightRadius
</del><ins>+- (void)_showTapHighlightWithColor:(const WebCore::Color&)color quads:(const Vector<WebCore::FloatQuad>&)highlightedQuads topLeftRadius:(const WebCore::IntSize&)topLeftRadius topRightRadius:(const WebCore::IntSize&)topRightRadius bottomLeftRadius:(const WebCore::IntSize&)bottomLeftRadius bottomRightRadius:(const WebCore::IntSize&)bottomRightRadius
</ins><span class="cx"> {
</span><del>- if (!_isTapHighlightIDValid || _latestTapHighlightID != requestID)
- return;
-
</del><span class="cx"> if (!highlightedQuadsAreSmallerThanRect(highlightedQuads, _page->unobscuredContentRect()))
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -433,6 +432,30 @@
</span><span class="cx"> [_highlightView setCornerRadii:borderRadii.get()];
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+- (void)_didGetTapHighlightForRequest:(uint64_t)requestID color:(const WebCore::Color&)color quads:(const Vector<WebCore::FloatQuad>&)highlightedQuads topLeftRadius:(const WebCore::IntSize&)topLeftRadius topRightRadius:(const WebCore::IntSize&)topRightRadius bottomLeftRadius:(const WebCore::IntSize&)bottomLeftRadius bottomRightRadius:(const WebCore::IntSize&)bottomRightRadius
+{
+ if (!_isTapHighlightIDValid || _latestTapHighlightID != requestID)
+ return;
+
+ if (_potentialTapInProgress) {
+ _potentialTapHighlightInformation = std::make_unique<TapHighlightInformation>();
+ _potentialTapHighlightInformation->color = color;
+ _potentialTapHighlightInformation->quads = highlightedQuads;
+ _potentialTapHighlightInformation->topLeftRadius = topLeftRadius;
+ _potentialTapHighlightInformation->topRightRadius = topRightRadius;
+ _potentialTapHighlightInformation->bottomLeftRadius = bottomLeftRadius;
+ _potentialTapHighlightInformation->bottomRightRadius = bottomRightRadius;
+ return;
+ }
+
+ [self _showTapHighlightWithColor:color
+ quads:highlightedQuads
+ topLeftRadius:topLeftRadius
+ topRightRadius:topRightRadius
+ bottomLeftRadius:bottomLeftRadius
+ bottomRightRadius:bottomRightRadius];
+}
+
</ins><span class="cx"> - (void)_cancelLongPressGestureRecognizer
</span><span class="cx"> {
</span><span class="cx"> [_highlightLongPressGestureRecognizer cancel];
</span><span class="lines">@@ -635,6 +658,19 @@
</span><span class="cx"> [_highlightRootView removeFromSuperview];
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+- (void)_finishInteraction
+{
+ [UIView animateWithDuration:0.1
+ animations:^{
+ [[_highlightRootView layer] setOpacity:0];
+ }
+ completion:^(BOOL){
+ _isTapHighlightIDValid = NO;
+ [_highlightRootView removeFromSuperview];
+ [[_highlightRootView layer] setOpacity:1];
+ }];
+}
+
</ins><span class="cx"> - (BOOL)hasSelectablePositionAtPoint:(CGPoint)point
</span><span class="cx"> {
</span><span class="cx"> [self ensurePositionInformationIsUpToDate:point];
</span><span class="lines">@@ -686,12 +722,15 @@
</span><span class="cx">
</span><span class="cx"> switch ([gestureRecognizer state]) {
</span><span class="cx"> case UIGestureRecognizerStateBegan:
</span><del>- _page->tapHighlightAtPosition([gestureRecognizer startPoint], _latestTapHighlightID);
</del><ins>+ _page->tapHighlightAtPosition([gestureRecognizer startPoint], ++_latestTapHighlightID);
</ins><span class="cx"> _isTapHighlightIDValid = YES;
</span><span class="cx"> break;
</span><span class="cx"> case UIGestureRecognizerStateEnded:
</span><del>- if (!_positionInformation.clickableElementName.isEmpty())
</del><ins>+ if (!_positionInformation.clickableElementName.isEmpty()) {
</ins><span class="cx"> [self _attemptClickAtLocation:[gestureRecognizer startPoint]];
</span><ins>+ [self _finishInteraction];
+ } else
+ [self _cancelInteraction];
</ins><span class="cx"> break;
</span><span class="cx"> case UIGestureRecognizerStateCancelled:
</span><span class="cx"> [self _cancelInteraction];
</span><span class="lines">@@ -717,15 +756,59 @@
</span><span class="cx"> - (void)_singleTapRecognized:(UITapGestureRecognizer *)gestureRecognizer
</span><span class="cx"> {
</span><span class="cx"> ASSERT(gestureRecognizer == _singleTapGestureRecognizer);
</span><ins>+ ASSERT(!_potentialTapInProgress);
</ins><span class="cx">
</span><del>- if (_webSelectionAssistant && ![_webSelectionAssistant shouldHandleSingleTapAtPoint:gestureRecognizer.location])
</del><ins>+ _page->potentialTapAtPosition(gestureRecognizer.location, ++_latestTapHighlightID);
+ _potentialTapInProgress = YES;
+ _isTapHighlightIDValid = YES;
+}
+
+- (void)_singleTapDidReset:(UITapGestureRecognizer *)gestureRecognizer
+{
+ ASSERT(gestureRecognizer == _singleTapGestureRecognizer);
+ if (_potentialTapInProgress) {
+ _potentialTapInProgress = NO;
+ _potentialTapHighlightInformation = nullptr;
+ [self _cancelInteraction];
+ _page->cancelPotentialTap();
+ }
+}
+
+- (void)_commitPotentialTapFailed
+{
+ [self _cancelInteraction];
+}
+
+- (void)_singleTapCommited:(UITapGestureRecognizer *)gestureRecognizer
+{
+ ASSERT(gestureRecognizer == _singleTapGestureRecognizer);
+
+ if (_webSelectionAssistant && ![_webSelectionAssistant shouldHandleSingleTapAtPoint:gestureRecognizer.location]) {
+ [self _singleTapDidReset:gestureRecognizer];
</ins><span class="cx"> return;
</span><ins>+ }
</ins><span class="cx">
</span><ins>+ ASSERT(_potentialTapInProgress);
+
</ins><span class="cx"> [_webSelectionAssistant clearSelection];
</span><span class="cx">
</span><span class="cx"> _lastInteractionLocation = gestureRecognizer.location;
</span><span class="cx">
</span><del>- [self _attemptClickAtLocation:gestureRecognizer.location];
</del><ins>+ _potentialTapInProgress = NO;
+
+ if (_potentialTapHighlightInformation) {
+ [self _showTapHighlightWithColor:_potentialTapHighlightInformation->color
+ quads:_potentialTapHighlightInformation->quads
+ topLeftRadius:_potentialTapHighlightInformation->topLeftRadius
+ topRightRadius:_potentialTapHighlightInformation->topRightRadius
+ bottomLeftRadius:_potentialTapHighlightInformation->bottomLeftRadius
+ bottomRightRadius:_potentialTapHighlightInformation->bottomRightRadius];
+ _potentialTapHighlightInformation = nullptr;
+ }
+
+ _page->commitPotentialTap();
+
+ [self _finishInteraction];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)_doubleTapRecognized:(UITapGestureRecognizer *)gestureRecognizer
</span><span class="lines">@@ -744,10 +827,6 @@
</span><span class="cx">
</span><span class="cx"> - (void)_attemptClickAtLocation:(CGPoint)location
</span><span class="cx"> {
</span><del>- // FIXME: Ideally, we should always provide some visual feedback on click. If a short tap did not trigger the
- // tap highlight, we should show one based on a timer if we commit the synthetic mouse events.
- [self _cancelInteraction];
-
</del><span class="cx"> if (![self isFirstResponder])
</span><span class="cx"> [self becomeFirstResponder];
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKSyntheticClickTapGestureRecognizerh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/ios/WKSyntheticClickTapGestureRecognizer.h (0 => 168388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKSyntheticClickTapGestureRecognizer.h         (rev 0)
+++ trunk/Source/WebKit2/UIProcess/ios/WKSyntheticClickTapGestureRecognizer.h        2014-05-06 22:53:12 UTC (rev 168388)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if PLATFORM(IOS)
+
+#import <UIKit/UITapGestureRecognizer_Private.h>
+
+@interface WKSyntheticClickTapGestureRecognizer : UITapGestureRecognizer
+- (void)setGestureRecognizedTarget:(id)target action:(SEL)action;
+- (void)setResetTarget:(id)target action:(SEL)action;
+@end
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKSyntheticClickTapGestureRecognizerm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/ios/WKSyntheticClickTapGestureRecognizer.m (0 => 168388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKSyntheticClickTapGestureRecognizer.m         (rev 0)
+++ trunk/Source/WebKit2/UIProcess/ios/WKSyntheticClickTapGestureRecognizer.m        2014-05-06 22:53:12 UTC (rev 168388)
</span><span class="lines">@@ -0,0 +1,66 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "WKSyntheticClickTapGestureRecognizer.h"
+
+#if PLATFORM(IOS)
+
+#import <UIKit/UIGestureRecognizerSubclass.h>
+
+@implementation WKSyntheticClickTapGestureRecognizer {
+ id _gestureRecognizedTarget;
+ SEL _gestureRecognizedAction;
+ id _resetTarget;
+ SEL _resetAction;
+}
+
+- (void)setGestureRecognizedTarget:(id)target action:(SEL)action
+{
+ _gestureRecognizedTarget = target;
+ _gestureRecognizedAction = action;
+}
+
+- (void)setResetTarget:(id)target action:(SEL)action
+{
+ _resetTarget = target;
+ _resetAction = action;
+}
+
+- (void)setState:(UIGestureRecognizerState)state
+{
+ [_gestureRecognizedTarget performSelector:_gestureRecognizedAction withObject:self];
+ [super setState:state];
+}
+
+- (void)reset
+{
+ [super reset];
+ [_resetTarget performSelector:_resetAction withObject:self];
+}
+
+@end
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWebPageProxyIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm (168387 => 168388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm        2014-05-06 22:44:56 UTC (rev 168387)
+++ trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm        2014-05-06 22:53:12 UTC (rev 168388)
</span><span class="lines">@@ -461,11 +461,23 @@
</span><span class="cx"> process().send(Messages::WebPage::WillStartUserTriggeredZooming(), m_pageID);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void WebPageProxy::potentialTapAtPosition(const WebCore::FloatPoint& position, uint64_t& requestID)
+{
+ process().send(Messages::WebPage::PotentialTapAtPosition(requestID, position), m_pageID);
+}
+
+void WebPageProxy::commitPotentialTap()
+{
+ process().send(Messages::WebPage::CommitPotentialTap(), m_pageID);
+}
+
+void WebPageProxy::cancelPotentialTap()
+{
+ process().send(Messages::WebPage::CancelPotentialTap(), m_pageID);
+}
+
</ins><span class="cx"> void WebPageProxy::tapHighlightAtPosition(const WebCore::FloatPoint& position, uint64_t& requestID)
</span><span class="cx"> {
</span><del>- static uint64_t uniqueRequestID = 0;
- requestID = ++uniqueRequestID;
-
</del><span class="cx"> process().send(Messages::WebPage::TapHighlightAtPosition(requestID, position), m_pageID);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -581,6 +593,11 @@
</span><span class="cx"> m_pageClient.zoomToRect(rect, minimumScale, maximumScale);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void WebPageProxy::commitPotentialTapFailed()
+{
+ m_pageClient.commitPotentialTapFailed();
+}
+
</ins><span class="cx"> void WebPageProxy::didNotHandleTapAsClick(const WebCore::IntPoint& point)
</span><span class="cx"> {
</span><span class="cx"> m_uiClient->didNotHandleTapAsClick(point);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (168387 => 168388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-05-06 22:44:56 UTC (rev 168387)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-05-06 22:53:12 UTC (rev 168388)
</span><span class="lines">@@ -474,6 +474,8 @@
</span><span class="cx">                 2684054F18B86C8E0022C38B /* ViewUpdateDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2684054518B85E7E0022C38B /* ViewUpdateDispatcher.cpp */; };
</span><span class="cx">                 2684055218B86ED60022C38B /* ViewUpdateDispatcherMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2684055018B86ED60022C38B /* ViewUpdateDispatcherMessageReceiver.cpp */; };
</span><span class="cx">                 2684055318B86ED60022C38B /* ViewUpdateDispatcherMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 2684055118B86ED60022C38B /* ViewUpdateDispatcherMessages.h */; };
</span><ins>+                26F10BE819187E2E001D0E68 /* WKSyntheticClickTapGestureRecognizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 26F10BE619187E2E001D0E68 /* WKSyntheticClickTapGestureRecognizer.h */; };
+                26F10BE919187E2E001D0E68 /* WKSyntheticClickTapGestureRecognizer.m in Sources */ = {isa = PBXBuildFile; fileRef = 26F10BE719187E2E001D0E68 /* WKSyntheticClickTapGestureRecognizer.m */; };
</ins><span class="cx">                 26F9A83B18A3468100AEB88A /* WKWebViewPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 26F9A83A18A3463F00AEB88A /* WKWebViewPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 290F4272172A0C7400939FF0 /* ChildProcessSupplement.h in Headers */ = {isa = PBXBuildFile; fileRef = 290F4271172A0C7400939FF0 /* ChildProcessSupplement.h */; };
</span><span class="cx">                 29232DF418B29D6800D0596F /* WKAccessibilityWebPageObjectMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 29232DF318B29D6800D0596F /* WKAccessibilityWebPageObjectMac.h */; };
</span><span class="lines">@@ -2288,6 +2290,8 @@
</span><span class="cx">                 2684054A18B866FF0022C38B /* VisibleContentRectUpdateInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VisibleContentRectUpdateInfo.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 2684055018B86ED60022C38B /* ViewUpdateDispatcherMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ViewUpdateDispatcherMessageReceiver.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 2684055118B86ED60022C38B /* ViewUpdateDispatcherMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewUpdateDispatcherMessages.h; sourceTree = "<group>"; };
</span><ins>+                26F10BE619187E2E001D0E68 /* WKSyntheticClickTapGestureRecognizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKSyntheticClickTapGestureRecognizer.h; path = ios/WKSyntheticClickTapGestureRecognizer.h; sourceTree = "<group>"; };
+                26F10BE719187E2E001D0E68 /* WKSyntheticClickTapGestureRecognizer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = WKSyntheticClickTapGestureRecognizer.m; path = ios/WKSyntheticClickTapGestureRecognizer.m; sourceTree = "<group>"; };
</ins><span class="cx">                 26F9A83A18A3463F00AEB88A /* WKWebViewPrivate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKWebViewPrivate.h; sourceTree = "<group>"; };
</span><span class="cx">                 290F4271172A0C7400939FF0 /* ChildProcessSupplement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChildProcessSupplement.h; sourceTree = "<group>"; };
</span><span class="cx">                 29232DF118B29D1100D0596F /* WKAccessibilityWebPageObjectMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKAccessibilityWebPageObjectMac.mm; sourceTree = "<group>"; };
</span><span class="lines">@@ -4502,6 +4506,8 @@
</span><span class="cx">                                 2DAF06D418BD1A470081CEB1 /* SmartMagnificationController.h */,
</span><span class="cx">                                 2DAF06D518BD1A470081CEB1 /* SmartMagnificationController.mm */,
</span><span class="cx">                                 2DAF06D818BD23BA0081CEB1 /* SmartMagnificationController.messages.in */,
</span><ins>+                                26F10BE619187E2E001D0E68 /* WKSyntheticClickTapGestureRecognizer.h */,
+                                26F10BE719187E2E001D0E68 /* WKSyntheticClickTapGestureRecognizer.m */,
</ins><span class="cx">                                 2DA944AA1884E9BA00ED86DB /* WebInspectorProxyIOS.mm */,
</span><span class="cx">                                 2D3EF4401917646300034184 /* WebMemoryPressureHandlerIOS.cpp */,
</span><span class="cx">                                 2D3EF4411917646300034184 /* WebMemoryPressureHandlerIOS.h */,
</span><span class="lines">@@ -7386,6 +7392,7 @@
</span><span class="cx">                                 753E3E0E1887398900188496 /* SessionTracker.h in Headers */,
</span><span class="cx">                                 BC40760E124FF0270068F20A /* WKURLResponse.h in Headers */,
</span><span class="cx">                                 759CCD5A1808F6160078E8A8 /* WebOriginDataManagerProxy.h in Headers */,
</span><ins>+                                26F10BE819187E2E001D0E68 /* WKSyntheticClickTapGestureRecognizer.h in Headers */,
</ins><span class="cx">                                 BC40762B124FF0400068F20A /* WKURLResponseNS.h in Headers */,
</span><span class="cx">                                 F6113E29126CE19B0057D0A7 /* WKUserContentURLPattern.h in Headers */,
</span><span class="cx">                                 BC8699B7116AADAA002A925B /* WKViewInternal.h in Headers */,
</span><span class="lines">@@ -8699,6 +8706,7 @@
</span><span class="cx">                                 935EEBA0127761AC003322B8 /* WKBundleBackForwardListItem.cpp in Sources */,
</span><span class="cx">                                 51FA2D7715212E2600C1BA0B /* WKBundleDOMWindowExtension.cpp in Sources */,
</span><span class="cx">                                 BCD25F1811D6BDE100169B0E /* WKBundleFrame.cpp in Sources */,
</span><ins>+                                26F10BE919187E2E001D0E68 /* WKSyntheticClickTapGestureRecognizer.m in Sources */,
</ins><span class="cx">                                 BC498630124D18C100D834E1 /* WKBundleHitTestResult.cpp in Sources */,
</span><span class="cx">                                 6501BD1A12F1243400E9F248 /* WKBundleInspector.cpp in Sources */,
</span><span class="cx">                                 753E3E0D1887398500188496 /* SessionTracker.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (168387 => 168388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2014-05-06 22:44:56 UTC (rev 168387)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2014-05-06 22:53:12 UTC (rev 168388)
</span><span class="lines">@@ -451,6 +451,9 @@
</span><span class="cx"> bool allowsUserScaling() const;
</span><span class="cx">
</span><span class="cx"> void handleTap(const WebCore::IntPoint&);
</span><ins>+ void potentialTapAtPosition(uint64_t requestID, const WebCore::FloatPoint&);
+ void commitPotentialTap();
+ void cancelPotentialTap();
</ins><span class="cx"> void tapHighlightAtPosition(uint64_t requestID, const WebCore::FloatPoint&);
</span><span class="cx">
</span><span class="cx"> void blurAssistedNode();
</span><span class="lines">@@ -820,7 +823,8 @@
</span><span class="cx"> PassRefPtr<WebCore::Range> contractedRangeFromHandle(WebCore::Range* currentRange, SelectionHandlePosition, SelectionFlags&);
</span><span class="cx"> void getAssistedNodeInformation(AssistedNodeInformation&);
</span><span class="cx"> void platformInitializeAccessibility();
</span><del>- RefPtr<WebCore::Range> m_currentBlockSelection;
</del><ins>+ void handleSyntheticClick(WebCore::Node* nodeRespondingToClick, const WebCore::FloatPoint& location);
+ void sendTapHighlightForNodeIfNecessary(uint64_t requestID, WebCore::Node*);
</ins><span class="cx"> #endif
</span><span class="cx"> #if !PLATFORM(COCOA)
</span><span class="cx"> static const char* interpretKeyEvent(const WebCore::KeyboardEvent*);
</span><span class="lines">@@ -1173,6 +1177,9 @@
</span><span class="cx"> RefPtr<WebCore::Node> m_interactionNode;
</span><span class="cx"> WebCore::IntPoint m_lastInteractionLocation;
</span><span class="cx">
</span><ins>+ RefPtr<WebCore::Node> m_potentialTapNode;
+ WebCore::FloatPoint m_potentialTapLocation;
+
</ins><span class="cx"> WebCore::ViewportConfiguration m_viewportConfiguration;
</span><span class="cx"> uint64_t m_lastVisibleContentRectUpdateID;
</span><span class="cx"> bool m_hasReceivedVisibleContentRectsAfterDidCommitLoad;
</span><span class="lines">@@ -1181,6 +1188,7 @@
</span><span class="cx"> bool m_userIsInteracting;
</span><span class="cx"> WebCore::FloatSize m_screenSize;
</span><span class="cx"> WebCore::FloatSize m_availableScreenSize;
</span><ins>+ RefPtr<WebCore::Range> m_currentBlockSelection;
</ins><span class="cx"> WebCore::IntSize m_blockSelectionDesiredSize;
</span><span class="cx"> WebCore::FloatSize m_minimumLayoutSizeForMinimalUI;
</span><span class="cx"> bool m_inDynamicSizeUpdate;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagemessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (168387 => 168388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in        2014-05-06 22:44:56 UTC (rev 168387)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in        2014-05-06 22:53:12 UTC (rev 168388)
</span><span class="lines">@@ -48,6 +48,9 @@
</span><span class="cx"> DynamicViewportSizeUpdate(WebCore::FloatSize minimumLayoutSize, WebCore::FloatRect targetExposedContentRect, WebCore::FloatRect targetUnobscuredRect, double scale)
</span><span class="cx">
</span><span class="cx"> HandleTap(WebCore::IntPoint point)
</span><ins>+ PotentialTapAtPosition(uint64_t requestID, WebCore::FloatPoint point)
+ CommitPotentialTap()
+ CancelPotentialTap()
</ins><span class="cx"> TapHighlightAtPosition(uint64_t requestID, WebCore::FloatPoint point)
</span><span class="cx"> BlurAssistedNode()
</span><span class="cx"> SelectWithGesture(WebCore::IntPoint point, uint32_t granularity, uint32_t gestureType, uint32_t gestureState, uint64_t callbackID)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (168387 => 168388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2014-05-06 22:44:56 UTC (rev 168387)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2014-05-06 22:53:12 UTC (rev 168388)
</span><span class="lines">@@ -319,12 +319,10 @@
</span><span class="cx"> didChangeSelection();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebPage::handleTap(const IntPoint& point)
</del><ins>+void WebPage::handleSyntheticClick(Node* nodeRespondingToClick, const WebCore::FloatPoint& location)
</ins><span class="cx"> {
</span><ins>+ IntPoint roundedAdjustedPoint = roundedIntPoint(location);
</ins><span class="cx"> Frame& mainframe = m_page->mainFrame();
</span><del>- FloatPoint adjustedPoint;
- Node* nodeRespondingToClick = mainframe.nodeRespondingToClickEvents(point, adjustedPoint);
- IntPoint roundedAdjustedPoint = roundedIntPoint(adjustedPoint);
</del><span class="cx">
</span><span class="cx"> WKBeginObservingContentChanges(true);
</span><span class="cx"> mainframe.eventHandler().mouseMoved(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, NoButton, PlatformEvent::MouseMoved, 0, false, false, false, false, 0));
</span><span class="lines">@@ -355,15 +353,18 @@
</span><span class="cx"> m_userIsInteracting = false;
</span><span class="cx">
</span><span class="cx"> if (!tapWasHandled || !nodeRespondingToClick || !nodeRespondingToClick->isElementNode())
</span><del>- send(Messages::WebPageProxy::DidNotHandleTapAsClick(point));
</del><ins>+ send(Messages::WebPageProxy::DidNotHandleTapAsClick(roundedIntPoint(location)));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void WebPage::tapHighlightAtPosition(uint64_t requestID, const FloatPoint& position)
</del><ins>+void WebPage::handleTap(const IntPoint& point)
</ins><span class="cx"> {
</span><del>- Frame& mainframe = m_page->mainFrame();
</del><span class="cx"> FloatPoint adjustedPoint;
</span><del>- Node* node = mainframe.nodeRespondingToClickEvents(position, adjustedPoint);
</del><ins>+ Node* nodeRespondingToClick = m_page->mainFrame().nodeRespondingToClickEvents(point, adjustedPoint);
+ handleSyntheticClick(nodeRespondingToClick, adjustedPoint);
+}
</ins><span class="cx">
</span><ins>+void WebPage::sendTapHighlightForNodeIfNecessary(uint64_t requestID, Node* node)
+{
</ins><span class="cx"> if (!node)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -395,6 +396,42 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void WebPage::potentialTapAtPosition(uint64_t requestID, const WebCore::FloatPoint& position)
+{
+ m_potentialTapNode = m_page->mainFrame().nodeRespondingToClickEvents(position, m_potentialTapLocation);
+ sendTapHighlightForNodeIfNecessary(requestID, m_potentialTapNode.get());
+}
+
+void WebPage::commitPotentialTap()
+{
+ if (!m_potentialTapNode || !m_potentialTapNode->renderer())
+ return;
+
+ FloatPoint adjustedPoint;
+ Node* nodeRespondingToClick = m_page->mainFrame().nodeRespondingToClickEvents(m_potentialTapLocation, adjustedPoint);
+
+ if (m_potentialTapNode == nodeRespondingToClick)
+ handleSyntheticClick(nodeRespondingToClick, adjustedPoint);
+ else
+ send(Messages::WebPageProxy::CommitPotentialTapFailed());
+
+ m_potentialTapNode = nullptr;
+ m_potentialTapLocation = FloatPoint();
+}
+
+void WebPage::cancelPotentialTap()
+{
+ m_potentialTapNode = nullptr;
+ m_potentialTapLocation = FloatPoint();
+}
+
+void WebPage::tapHighlightAtPosition(uint64_t requestID, const FloatPoint& position)
+{
+ Frame& mainframe = m_page->mainFrame();
+ FloatPoint adjustedPoint;
+ sendTapHighlightForNodeIfNecessary(requestID, mainframe.nodeRespondingToClickEvents(position, adjustedPoint));
+}
+
</ins><span class="cx"> void WebPage::blurAssistedNode()
</span><span class="cx"> {
</span><span class="cx"> if (m_assistedNode && m_assistedNode->isElementNode())
</span></span></pre>
</div>
</div>
</body>
</html>