<!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>[164469] 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/164469">164469</a></dd>
<dt>Author</dt> <dd>benjamin@webkit.org</dd>
<dt>Date</dt> <dd>2014-02-20 21:22:51 -0800 (Thu, 20 Feb 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>WKInteractionView always blocks the main thread when sending touch events
https://bugs.webkit.org/show_bug.cgi?id=129059

Patch by Benjamin Poulain &lt;bpoulain@apple.com&gt; on 2014-02-20
Reviewed by Enrica Casucci.

Add the asynchronous dispatching to WebKit2.

* Shared/NativeWebTouchEvent.h:
(WebKit::NativeWebTouchEvent::uniqueId):
* Shared/ios/NativeWebTouchEventIOS.mm:
(WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
* UIProcess/API/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::doneWithTouchEvent):
* UIProcess/API/ios/WKContentView.h:
* UIProcess/API/ios/WKContentView.mm:
(-[WKContentView willStartUserTriggeredScroll]):
(-[WKContentView willStartUserTriggeredZoom]):
(-[WKContentView _webTouchEvent:WebKit::preventsNativeGestures:]):
* UIProcess/API/ios/WKContentViewInternal.h:
* UIProcess/API/ios/WKInteractionView.h:
* UIProcess/API/ios/WKInteractionView.mm:
(-[WKInteractionView _webTouchEventsRecognized:]):
(-[WKInteractionView _webTouchEvent:WebKit::preventsNativeGestures:]):
(-[WKInteractionView _willStartUserTriggeredScrollingOrZooming]):
* UIProcess/API/ios/WKViewIOS.mm:
(-[WKView scrollViewWillBeginDragging:]):
* WebKit2.xcodeproj/project.pbxproj:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedNativeWebTouchEventh">trunk/Source/WebKit2/Shared/NativeWebTouchEvent.h</a></li>
<li><a href="#trunkSourceWebKit2SharediosNativeWebTouchEventIOSmm">trunk/Source/WebKit2/Shared/ios/NativeWebTouchEventIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIiosPageClientImplIOSmm">trunk/Source/WebKit2/UIProcess/API/ios/PageClientImplIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIiosWKContentViewh">trunk/Source/WebKit2/UIProcess/API/ios/WKContentView.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIiosWKContentViewmm">trunk/Source/WebKit2/UIProcess/API/ios/WKContentView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIiosWKContentViewInternalh">trunk/Source/WebKit2/UIProcess/API/ios/WKContentViewInternal.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIiosWKInteractionViewh">trunk/Source/WebKit2/UIProcess/API/ios/WKInteractionView.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIiosWKInteractionViewmm">trunk/Source/WebKit2/UIProcess/API/ios/WKInteractionView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIiosWKViewIOSmm">trunk/Source/WebKit2/UIProcess/API/ios/WKViewIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (164468 => 164469)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-02-21 04:59:09 UTC (rev 164468)
+++ trunk/Source/WebKit2/ChangeLog        2014-02-21 05:22:51 UTC (rev 164469)
</span><span class="lines">@@ -1,5 +1,35 @@
</span><span class="cx"> 2014-02-20  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        WKInteractionView always blocks the main thread when sending touch events
+        https://bugs.webkit.org/show_bug.cgi?id=129059
+
+        Reviewed by Enrica Casucci.
+
+        Add the asynchronous dispatching to WebKit2.
+
+        * Shared/NativeWebTouchEvent.h:
+        (WebKit::NativeWebTouchEvent::uniqueId):
+        * Shared/ios/NativeWebTouchEventIOS.mm:
+        (WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
+        * UIProcess/API/ios/PageClientImplIOS.mm:
+        (WebKit::PageClientImpl::doneWithTouchEvent):
+        * UIProcess/API/ios/WKContentView.h:
+        * UIProcess/API/ios/WKContentView.mm:
+        (-[WKContentView willStartUserTriggeredScroll]):
+        (-[WKContentView willStartUserTriggeredZoom]):
+        (-[WKContentView _webTouchEvent:WebKit::preventsNativeGestures:]):
+        * UIProcess/API/ios/WKContentViewInternal.h:
+        * UIProcess/API/ios/WKInteractionView.h:
+        * UIProcess/API/ios/WKInteractionView.mm:
+        (-[WKInteractionView _webTouchEventsRecognized:]):
+        (-[WKInteractionView _webTouchEvent:WebKit::preventsNativeGestures:]):
+        (-[WKInteractionView _willStartUserTriggeredScrollingOrZooming]):
+        * UIProcess/API/ios/WKViewIOS.mm:
+        (-[WKView scrollViewWillBeginDragging:]):
+        * WebKit2.xcodeproj/project.pbxproj:
+
+2014-02-20  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
+
</ins><span class="cx">         Start fixing the view states driven by the WKScrollView
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=129140
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedNativeWebTouchEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/NativeWebTouchEvent.h (164468 => 164469)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/NativeWebTouchEvent.h        2014-02-21 04:59:09 UTC (rev 164468)
+++ trunk/Source/WebKit2/Shared/NativeWebTouchEvent.h        2014-02-21 05:22:51 UTC (rev 164469)
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx"> public:
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     explicit NativeWebTouchEvent(UIWebTouchEventsGestureRecognizer *);
</span><del>-    const UIWebTouchEventsGestureRecognizer* nativeEvent() const { return m_nativeEvent.get(); }
</del><ins>+    unsigned uniqueId() const { return m_uniqueID; }
</ins><span class="cx"> #elif PLATFORM(GTK)
</span><span class="cx">     NativeWebTouchEvent(const NativeWebTouchEvent&amp;);
</span><span class="cx">     NativeWebTouchEvent(GdkEvent*, WebCore::GtkTouchContextHelper&amp;);
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>-    RetainPtr&lt;UIWebTouchEventsGestureRecognizer&gt; m_nativeEvent;
</del><ins>+    unsigned m_uniqueID;
</ins><span class="cx"> #elif PLATFORM(GTK)
</span><span class="cx">     GUniquePtr&lt;GdkEvent&gt; m_nativeEvent;
</span><span class="cx">     const WebCore::GtkTouchContextHelper&amp; m_touchContext;
</span></span></pre></div>
<a id="trunkSourceWebKit2SharediosNativeWebTouchEventIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/ios/NativeWebTouchEventIOS.mm (164468 => 164469)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/ios/NativeWebTouchEventIOS.mm        2014-02-21 04:59:09 UTC (rev 164468)
+++ trunk/Source/WebKit2/Shared/ios/NativeWebTouchEventIOS.mm        2014-02-21 05:22:51 UTC (rev 164469)
</span><span class="lines">@@ -35,6 +35,8 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><ins>+static unsigned uniqueTouchEventIdIndex = 0;
+
</ins><span class="cx"> static inline WebEvent::Type webEventTypeForUIWebTouchEventType(UIWebTouchEventType type)
</span><span class="cx"> {
</span><span class="cx">     switch (type) {
</span><span class="lines">@@ -95,7 +97,7 @@
</span><span class="cx"> 
</span><span class="cx"> NativeWebTouchEvent::NativeWebTouchEvent(UIWebTouchEventsGestureRecognizer *gestureRecognizer)
</span><span class="cx">     : WebTouchEvent(webEventTypeForUIWebTouchEventType(gestureRecognizer.type), static_cast&lt;Modifiers&gt;(0), WTF::currentTime(), extractWebTouchPoint(gestureRecognizer), positionForCGPoint(gestureRecognizer.locationInWindow), gestureRecognizer.inJavaScriptGesture, gestureRecognizer.scale, gestureRecognizer.rotation)
</span><del>-    , m_nativeEvent(gestureRecognizer)
</del><ins>+    , m_uniqueID(uniqueTouchEventIdIndex++)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIiosPageClientImplIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/ios/PageClientImplIOS.mm (164468 => 164469)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/ios/PageClientImplIOS.mm        2014-02-21 04:59:09 UTC (rev 164468)
+++ trunk/Source/WebKit2/UIProcess/API/ios/PageClientImplIOS.mm        2014-02-21 05:22:51 UTC (rev 164469)
</span><span class="lines">@@ -276,7 +276,7 @@
</span><span class="cx"> #if ENABLE(TOUCH_EVENTS)
</span><span class="cx"> void PageClientImpl::doneWithTouchEvent(const NativeWebTouchEvent&amp; nativeWebtouchEvent, bool eventHandled)
</span><span class="cx"> {
</span><del>-    [nativeWebtouchEvent.nativeEvent() setDefaultPrevented:eventHandled];
</del><ins>+    [m_view _webTouchEvent:nativeWebtouchEvent preventsNativeGestures:eventHandled];
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIiosWKContentViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/ios/WKContentView.h (164468 => 164469)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/ios/WKContentView.h        2014-02-21 04:59:09 UTC (rev 164468)
+++ trunk/Source/WebKit2/UIProcess/API/ios/WKContentView.h        2014-02-21 05:22:51 UTC (rev 164469)
</span><span class="lines">@@ -67,6 +67,7 @@
</span><span class="cx"> - (void)didFinishScrolling;
</span><span class="cx"> - (void)didZoomToScale:(CGFloat)scale;
</span><span class="cx"> - (void)willStartZoomOrScroll;
</span><ins>+- (void)willStartUserTriggeredScroll;
</ins><span class="cx"> - (void)willStartUserTriggeredZoom;
</span><span class="cx"> 
</span><span class="cx"> @end
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIiosWKContentViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/ios/WKContentView.mm (164468 => 164469)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/ios/WKContentView.mm        2014-02-21 04:59:09 UTC (rev 164468)
+++ trunk/Source/WebKit2/UIProcess/API/ios/WKContentView.mm        2014-02-21 05:22:51 UTC (rev 164469)
</span><span class="lines">@@ -199,8 +199,14 @@
</span><span class="cx">     [_interactionView _willStartScrollingOrZooming];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)willStartUserTriggeredScroll
+{
+    [_interactionView _willStartUserTriggeredScrollingOrZooming];
+}
+
</ins><span class="cx"> - (void)willStartUserTriggeredZoom
</span><span class="cx"> {
</span><ins>+    [_interactionView _willStartUserTriggeredScrollingOrZooming];
</ins><span class="cx">     _page-&gt;willStartUserTriggeredZooming();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -261,6 +267,11 @@
</span><span class="cx">         [_delegate contentView:self didCommitLayerTree:layerTreeTransaction];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)_webTouchEvent:(const WebKit::NativeWebTouchEvent&amp;)touchEvent preventsNativeGestures:(BOOL)preventsNativeGesture
+{
+    [_interactionView _webTouchEvent:touchEvent preventsNativeGestures:preventsNativeGesture];
+}
+
</ins><span class="cx"> - (void)_didGetTapHighlightForRequest:(uint64_t)requestID color:(const Color&amp;)color quads:(const Vector&lt;FloatQuad&gt;&amp;)highlightedQuads topLeftRadius:(const IntSize&amp;)topLeftRadius topRightRadius:(const IntSize&amp;)topRightRadius bottomLeftRadius:(const IntSize&amp;)bottomLeftRadius bottomRightRadius:(const IntSize&amp;)bottomRightRadius
</span><span class="cx"> {
</span><span class="cx">     [_interactionView _didGetTapHighlightForRequest:requestID color:color quads:highlightedQuads topLeftRadius:topLeftRadius topRightRadius:topRightRadius bottomLeftRadius:bottomLeftRadius bottomRightRadius:bottomRightRadius];
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIiosWKContentViewInternalh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/ios/WKContentViewInternal.h (164468 => 164469)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/ios/WKContentViewInternal.h        2014-02-21 04:59:09 UTC (rev 164468)
+++ trunk/Source/WebKit2/UIProcess/API/ios/WKContentViewInternal.h        2014-02-21 05:22:51 UTC (rev 164469)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> class DrawingAreaProxy;
</span><span class="cx"> class GeolocationPermissionRequestProxy;
</span><span class="cx"> class LayerTreeContext;
</span><ins>+class NativeWebTouchEvent;
</ins><span class="cx"> class RemoteLayerTreeTransaction;
</span><span class="cx"> class WebFrameProxy;
</span><span class="cx"> class WebPageProxy;
</span><span class="lines">@@ -61,6 +62,7 @@
</span><span class="cx"> - (void)_didCommitLoadForMainFrame;
</span><span class="cx"> - (void)_didCommitLayerTree:(const WebKit::RemoteLayerTreeTransaction&amp;)layerTreeTransaction;
</span><span class="cx"> 
</span><ins>+- (void)_webTouchEvent:(const WebKit::NativeWebTouchEvent&amp;)touchEvent preventsNativeGestures:(BOOL)preventsDefault;
</ins><span class="cx"> - (void)_didGetTapHighlightForRequest:(uint64_t)requestID color:(const WebCore::Color&amp;)color quads:(const Vector&lt;WebCore::FloatQuad&gt;&amp;)highlightedQuads topLeftRadius:(const WebCore::IntSize&amp;)topLeftRadius topRightRadius:(const WebCore::IntSize&amp;)topRightRadius bottomLeftRadius:(const WebCore::IntSize&amp;)bottomLeftRadius bottomRightRadius:(const WebCore::IntSize&amp;)bottomRightRadius;
</span><span class="cx"> 
</span><span class="cx"> - (void)_startAssistingNode;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIiosWKInteractionViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/ios/WKInteractionView.h (164468 => 164469)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/ios/WKInteractionView.h        2014-02-21 04:59:09 UTC (rev 164468)
+++ trunk/Source/WebKit2/UIProcess/API/ios/WKInteractionView.h        2014-02-21 05:22:51 UTC (rev 164469)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><ins>+class NativeWebTouchEvent;
</ins><span class="cx"> class WebPageProxy;
</span><span class="cx"> struct InteractionInformationAtPosition;
</span><span class="cx"> }
</span><span class="lines">@@ -55,6 +56,7 @@
</span><span class="cx"> - (void)setScrollView:(UIWebScrollView *)scrollView;
</span><span class="cx"> - (void)setPage:(PassRefPtr&lt;WebKit::WebPageProxy&gt;)page;
</span><span class="cx"> 
</span><ins>+- (void)_webTouchEvent:(const WebKit::NativeWebTouchEvent&amp;)touchEvent preventsNativeGestures:(BOOL)preventsDefault;
</ins><span class="cx"> - (void)_didGetTapHighlightForRequest:(uint64_t)requestID color:(const WebCore::Color&amp;)color quads:(const Vector&lt;WebCore::FloatQuad&gt;&amp;)highlightedQuads topLeftRadius:(const WebCore::IntSize&amp;)topLeftRadius topRightRadius:(const WebCore::IntSize&amp;)topRightRadius bottomLeftRadius:(const WebCore::IntSize&amp;)bottomLeftRadius bottomRightRadius:(const WebCore::IntSize&amp;)bottomRightRadius;
</span><span class="cx"> 
</span><span class="cx"> - (void)_startAssistingNode;
</span><span class="lines">@@ -66,6 +68,7 @@
</span><span class="cx"> - (void)_updatePositionInformation;
</span><span class="cx"> - (void)_performAction:(WebKit::WKSheetActions)action;
</span><span class="cx"> - (void)_willStartScrollingOrZooming;
</span><ins>+- (void)_willStartUserTriggeredScrollingOrZooming;
</ins><span class="cx"> - (void)_didEndScrollingOrZooming;
</span><span class="cx"> @property (readonly, nonatomic) WebKit::InteractionInformationAtPosition positionInformation;
</span><span class="cx"> @end
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIiosWKInteractionViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/ios/WKInteractionView.mm (164468 => 164469)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/ios/WKInteractionView.mm        2014-02-21 04:59:09 UTC (rev 164468)
+++ trunk/Source/WebKit2/UIProcess/API/ios/WKInteractionView.mm        2014-02-21 05:22:51 UTC (rev 164469)
</span><span class="lines">@@ -148,6 +148,9 @@
</span><span class="cx"> 
</span><span class="cx"> @implementation WKInteractionView {
</span><span class="cx">     RetainPtr&lt;UIWebTouchEventsGestureRecognizer&gt; _touchEventGestureRecognizer;
</span><ins>+    BOOL _canSendTouchEventsAsynchronously;
+    unsigned _nativeWebTouchEventUniqueIdBeingSentSynchronously;
+
</ins><span class="cx">     RetainPtr&lt;UITapGestureRecognizer&gt; _singleTapGestureRecognizer;
</span><span class="cx">     RetainPtr&lt;_UIWebHighlightLongPressGestureRecognizer&gt; _highlightLongPressGestureRecognizer;
</span><span class="cx">     RetainPtr&lt;UILongPressGestureRecognizer&gt; _longPressGestureRecognizer;
</span><span class="lines">@@ -279,8 +282,13 @@
</span><span class="cx"> {
</span><span class="cx">     NativeWebTouchEvent nativeWebTouchEvent(gestureRecognizer);
</span><span class="cx"> 
</span><del>-    // FIXME: this kind of event delivery is supposed to be only used for testing. We must switch to asynchronous handling.
-    _page-&gt;setShouldSendEventsSynchronously(true);
</del><ins>+    if (nativeWebTouchEvent.type() == WebKit::WebEvent::TouchStart)
+        _canSendTouchEventsAsynchronously = NO;
+
+    if (!_canSendTouchEventsAsynchronously)
+        _nativeWebTouchEventUniqueIdBeingSentSynchronously = nativeWebTouchEvent.uniqueId();
+
+    _page-&gt;setShouldSendEventsSynchronously(!_canSendTouchEventsAsynchronously);
</ins><span class="cx">     _page-&gt;handleTouchEvent(nativeWebTouchEvent);
</span><span class="cx">     _page-&gt;setShouldSendEventsSynchronously(false);
</span><span class="cx"> }
</span><span class="lines">@@ -322,6 +330,20 @@
</span><span class="cx">     return FloatQuad(points[1], points[0], points[2], points[3]);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)_webTouchEvent:(const WebKit::NativeWebTouchEvent&amp;)touchEvent preventsNativeGestures:(BOOL)preventsNativeGesture
+{
+    if (preventsNativeGesture) {
+        // If we are dispatching events synchronously and the event coming back is not the one we are sending, it is a callback
+        // from an event sent asynchronously prior to the synchronous event. In that case, it should not use that information
+        // to update UIWebTouchEventsGestureRecognizer.
+        if (!_canSendTouchEventsAsynchronously &amp;&amp; _nativeWebTouchEventUniqueIdBeingSentSynchronously != touchEvent.uniqueId())
+            return;
+
+        _canSendTouchEventsAsynchronously = YES;
+        [_touchEventGestureRecognizer setDefaultPrevented:YES];
+    }
+}
+
</ins><span class="cx"> - (void)_didGetTapHighlightForRequest:(uint64_t)requestID color:(const WebCore::Color&amp;)color quads:(const Vector&lt;WebCore::FloatQuad&gt;&amp;)highlightedQuads topLeftRadius:(const WebCore::IntSize&amp;)topLeftRadius topRightRadius:(const WebCore::IntSize&amp;)topRightRadius bottomLeftRadius:(const WebCore::IntSize&amp;)bottomLeftRadius bottomRightRadius:(const WebCore::IntSize&amp;)bottomRightRadius
</span><span class="cx"> {
</span><span class="cx">     if (!_isTapHighlightIDValid || _latestTapHighlightID != requestID)
</span><span class="lines">@@ -685,6 +707,11 @@
</span><span class="cx">     [_textSelectionAssistant willStartScrollingOverflow];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)_willStartUserTriggeredScrollingOrZooming
+{
+    _canSendTouchEventsAsynchronously = YES;
+}
+
</ins><span class="cx"> - (void)_didEndScrollingOrZooming
</span><span class="cx"> {
</span><span class="cx">     [_webSelectionAssistant didEndScrollingOrZoomingPage];
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIiosWKViewIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/ios/WKViewIOS.mm (164468 => 164469)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/ios/WKViewIOS.mm        2014-02-21 04:59:09 UTC (rev 164468)
+++ trunk/Source/WebKit2/UIProcess/API/ios/WKViewIOS.mm        2014-02-21 05:22:51 UTC (rev 164469)
</span><span class="lines">@@ -190,6 +190,8 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
</span><span class="cx"> {
</span><ins>+    if (scrollView.panGestureRecognizer.state == UIGestureRecognizerStateBegan)
+        [_contentView willStartUserTriggeredScroll];
</ins><span class="cx">     [_contentView willStartZoomOrScroll];
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (164468 => 164469)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-02-21 04:59:09 UTC (rev 164468)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-02-21 05:22:51 UTC (rev 164469)
</span><span class="lines">@@ -415,6 +415,7 @@
</span><span class="cx">                 1FB00AC9185F76460019142E /* WKWebProcessPlugInPageGroupInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1FB00AC6185F76460019142E /* WKWebProcessPlugInPageGroupInternal.h */; };
</span><span class="cx">                 1QQ417CB12C00CCA002BE67B /* TextCheckerCompletion.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CC417C912C00CCA002BE67B /* TextCheckerCompletion.h */; };
</span><span class="cx">                 1ZZ417EF12C00D87002BE67B /* TextCheckerCompletion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1BB417C912C00CCA002BE67B /* TextCheckerCompletion.cpp */; };
</span><ins>+                263172CF18B469490065B9C3 /* NativeWebTouchEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 263172CE18B469490065B9C3 /* NativeWebTouchEvent.h */; };
</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">                 293EBEAB1627D9C9005F89F1 /* WKDOMText.h in Headers */ = {isa = PBXBuildFile; fileRef = 293EBEA91627D9C9005F89F1 /* WKDOMText.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -2108,6 +2109,7 @@
</span><span class="cx">                 1FB00AC4185F76460019142E /* WKWebProcessPlugInPageGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebProcessPlugInPageGroup.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1FB00AC5185F76460019142E /* WKWebProcessPlugInPageGroup.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebProcessPlugInPageGroup.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1FB00AC6185F76460019142E /* WKWebProcessPlugInPageGroupInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebProcessPlugInPageGroupInternal.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                263172CE18B469490065B9C3 /* NativeWebTouchEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeWebTouchEvent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 26659AA0185FAAED004303DD /* Info-iOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = &quot;Info-iOS.plist&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 26F9A83A18A3463F00AEB88A /* WKWebViewPrivate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKWebViewPrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 290F4271172A0C7400939FF0 /* ChildProcessSupplement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChildProcessSupplement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -3881,6 +3883,7 @@
</span><span class="cx">                                 1ADCB869189831B30022EE5A /* NavigationActionData.h */,
</span><span class="cx">                                 C02BFF1512514FD8009CCBEA /* NativeWebKeyboardEvent.h */,
</span><span class="cx">                                 31EA25D3134F78D6005B1452 /* NativeWebMouseEvent.h */,
</span><ins>+                                263172CE18B469490065B9C3 /* NativeWebTouchEvent.h */,
</ins><span class="cx">                                 DF58C6311371AC5800F9A37C /* NativeWebWheelEvent.h */,
</span><span class="cx">                                 BCCF673212C7F15C008F9C35 /* OriginAndDatabases.cpp */,
</span><span class="cx">                                 BCCF672C12C7EDF7008F9C35 /* OriginAndDatabases.h */,
</span><span class="lines">@@ -6287,6 +6290,7 @@
</span><span class="cx">                                 377EAD4517E2C51A002D193D /* WKDeclarationSpecifiers.h in Headers */,
</span><span class="cx">                                 1FB00AC7185F76460019142E /* WKWebProcessPlugInPageGroup.h in Headers */,
</span><span class="cx">                                 377EAD4917E2C77B002D193D /* WKUserScriptInjectionTime.h in Headers */,
</span><ins>+                                263172CF18B469490065B9C3 /* NativeWebTouchEvent.h in Headers */,
</ins><span class="cx">                                 1F7506B21859163E00EC0FF7 /* WKWebProcessPlugInHitTestResult.h in Headers */,
</span><span class="cx">                                 1F7506B11859163700EC0FF7 /* WKWebProcessPlugInFrame.h in Headers */,
</span><span class="cx">                                 BC59548915C7868500FD1E3E /* WebKit2.h in Headers */,
</span></span></pre>
</div>
</div>

</body>
</html>