<!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>[163749] trunk</title>
</head>
<body>

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

<h3>Log Message</h3>
<pre>.: [GTK] Enable touch features
https://bugs.webkit.org/show_bug.cgi?id=98931

Patch by Carlos Garnacho &lt;carlosg@gnome.org&gt; on 2014-02-09
Reviewed by Carlos Garcia Campos.

* Source/autotools/SetupWebKitFeatures.m4:
* Source/cmake/OptionsGTK.cmake: set ENABLE_TOUCH_EVENTS to 1 if building with GTK+.

Source/WebCore: [GTK] Add touch-events related code to build
https://bugs.webkit.org/show_bug.cgi?id=98931

Patch by Carlos Garnacho &lt;carlosg@gnome.org&gt; on 2014-02-09
Reviewed by Carlos Garcia Campos.

Tests in fast/events/touch have been enabled on GTK+ now that touch
support is implemented, and thus all expected bits are there.

* platform/gtk/GtkTouchContextHelper.cpp:
* platform/gtk/GtkTouchContextHelper.h: Add helper object to track all touchpoints, handy
when creating WebTouchEvents.
* GNUmakefile.list.am:
* PlatformGTK.cmake:
* bindings/gobject/GNUmakefile.am: Add touch related code and idls to build, those are
necessary now that GTK+ implements touch events.

Source/WebKit/gtk: [GTK] Allow building with touch events enabled
https://bugs.webkit.org/show_bug.cgi?id=98931

Patch by Carlos Garnacho &lt;carlosg@gnome.org&gt; on 2014-02-09
Reviewed by Carlos Garcia Campos.

Even though WebKit1 GTK code doesn't implement touch events,
Fix build if ENABLE_TOUCH_EVENTS is present for WK2.

* WebCoreSupport/ChromeClientGtk.h:
(WebKit::ChromeClient::needTouchEvents): Add empty stub

Source/WebKit2: [GTK] Implement support touch events
https://bugs.webkit.org/show_bug.cgi?id=98931

Patch by Carlos Garnacho &lt;carlosg@gnome.org&gt; on 2014-02-09
Reviewed by Carlos Garcia Campos.

In GTK+ &gt;= 3.4.0, GdkEventTouch is available to inform about multitouch events. Use these to implement
touch events on this platform. If a touch is left unhandled and is the &quot;pointer emulating&quot; one, mouse
events will be generated as a fallback.

* GNUmakefile.list.am:
* PlatformGTK.cmake:
* Shared/gtk/NativeWebTouchEventGtk.cpp:
* Shared/NativeWebTouchEvent.h:
(WebKit::NativeWebTouchEvent::nativeEvent):
(WebKit::NativeWebTouchEvent::touchContext): Add GTK+ implementation of NativeWebTouchEvent.
* Shared/gtk/WebEventFactory.cpp:
(WebKit::touchPhaseFromEvents):
(WebKit::WebEventFactory::createWebTouchEvent): Add methods to generate WebTouchEvents out
of GdkEventTouch events, a GtkTouchContextHelper object is used to hold information about all current
touches, in order to build information about all individual touchpoints.
* Shared/gtk/WebEventFactory.h:
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::doneWithTouchEvent): Implement pointer emulation. If a touch event was unhandled
in DOM and pertains to the touch sequence that emulates pointer events. The event gets transformed to its
mouse event counterpart and handled by the widget again.
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseRealize): Listen for touch events
(webkitWebViewBaseTouchEvent):
(webkit_web_view_base_class_init): Add implementation for the touch_events() handler, this merely
lets the pageProxy handle the NativeWebTouchEvent we create to wrap the GdkEvent received.

Tools: [GTK] Enable touch features
https://bugs.webkit.org/show_bug.cgi?id=98931

Patch by Carlos Garnacho &lt;carlosg@gnome.org&gt; on 2014-02-09
Reviewed by Carlos Garcia Campos.

* WebKitTestRunner/EventSenderProxy.h:
* WebKitTestRunner/gtk/EventSenderProxyGtk.cpp:
(WTR::updateEventCoordinates):
(WTR::EventSenderProxy::createTouchEvent):
(WTR::EventSenderProxy::addTouchPoint):
(WTR::EventSenderProxy::updateTouchPoint):
(WTR::EventSenderProxy::sendUpdatedTouchEvents):
(WTR::EventSenderProxy::setTouchPointRadius):
(WTR::EventSenderProxy::setTouchModifier): Implement touch event proxying.

LayoutTests: [GTK] Enable touch features
https://bugs.webkit.org/show_bug.cgi?id=98931

Patch by Carlos Garnacho &lt;carlosg@gnome.org&gt; on 2014-02-09
Reviewed by Carlos Garcia Campos.

* platform/gtk/TestExpectations: remove fast/events/touch
* platform/gtk-wk2/TestExpectations: Add new expectations on
fast/events/touch events.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkChangeLog">trunk/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformgtkTestExpectations">trunk/LayoutTests/platform/gtk/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformgtkwk1TestExpectations">trunk/LayoutTests/platform/gtk-wk1/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformgtkwk2TestExpectations">trunk/LayoutTests/platform/gtk-wk2/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreGNUmakefilelistam">trunk/Source/WebCore/GNUmakefile.list.am</a></li>
<li><a href="#trunkSourceWebCorePlatformGTKcmake">trunk/Source/WebCore/PlatformGTK.cmake</a></li>
<li><a href="#trunkSourceWebCorebindingsgobjectGNUmakefileam">trunk/Source/WebCore/bindings/gobject/GNUmakefile.am</a></li>
<li><a href="#trunkSourceWebCorebindingsgobjectwebkitdomsymbols">trunk/Source/WebCore/bindings/gobject/webkitdom.symbols</a></li>
<li><a href="#trunkSourceWebKitgtkChangeLog">trunk/Source/WebKit/gtk/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitgtkWebCoreSupportChromeClientGtkh">trunk/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2GNUmakefilelistam">trunk/Source/WebKit2/GNUmakefile.list.am</a></li>
<li><a href="#trunkSourceWebKit2PlatformGTKcmake">trunk/Source/WebKit2/PlatformGTK.cmake</a></li>
<li><a href="#trunkSourceWebKit2SharedNativeWebTouchEventh">trunk/Source/WebKit2/Shared/NativeWebTouchEvent.h</a></li>
<li><a href="#trunkSourceWebKit2SharedgtkWebEventFactorycpp">trunk/Source/WebKit2/Shared/gtk/WebEventFactory.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedgtkWebEventFactoryh">trunk/Source/WebKit2/Shared/gtk/WebEventFactory.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkPageClientImplcpp">trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkPageClientImplh">trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewBasecpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp</a></li>
<li><a href="#trunkSourceautotoolsSetupWebKitFeaturesm4">trunk/Source/autotools/SetupWebKitFeatures.m4</a></li>
<li><a href="#trunkSourcecmakeOptionsGTKcmake">trunk/Source/cmake/OptionsGTK.cmake</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsDumpRenderTreegtkEventSendercpp">trunk/Tools/DumpRenderTree/gtk/EventSender.cpp</a></li>
<li><a href="#trunkToolsScriptswebkitperlFeatureListpm">trunk/Tools/Scripts/webkitperl/FeatureList.pm</a></li>
<li><a href="#trunkToolsWebKitTestRunnerEventSenderProxyh">trunk/Tools/WebKitTestRunner/EventSenderProxy.h</a></li>
<li><a href="#trunkToolsWebKitTestRunnergtkEventSenderProxyGtkcpp">trunk/Tools/WebKitTestRunner/gtk/EventSenderProxyGtk.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformgtkGtkTouchContextHelpercpp">trunk/Source/WebCore/platform/gtk/GtkTouchContextHelper.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgtkGtkTouchContextHelperh">trunk/Source/WebCore/platform/gtk/GtkTouchContextHelper.h</a></li>
<li><a href="#trunkSourceWebKit2SharedgtkNativeWebTouchEventGtkcpp">trunk/Source/WebKit2/Shared/gtk/NativeWebTouchEventGtk.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/ChangeLog (163748 => 163749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/ChangeLog        2014-02-09 10:31:33 UTC (rev 163748)
+++ trunk/ChangeLog        2014-02-09 10:55:50 UTC (rev 163749)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2014-02-09  Carlos Garnacho  &lt;carlosg@gnome.org&gt;
+
+        [GTK] Enable touch features
+        https://bugs.webkit.org/show_bug.cgi?id=98931
+
+        Reviewed by Carlos Garcia Campos.
+
+        * Source/autotools/SetupWebKitFeatures.m4:
+        * Source/cmake/OptionsGTK.cmake: set ENABLE_TOUCH_EVENTS to 1 if building with GTK+.
+
</ins><span class="cx"> 2014-02-06  Andreas Kling  &lt;akling@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove unused ENABLE(REPAINT_THROTTLING) flag.
</span></span></pre></div>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (163748 => 163749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-02-09 10:31:33 UTC (rev 163748)
+++ trunk/LayoutTests/ChangeLog        2014-02-09 10:55:50 UTC (rev 163749)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2014-02-09  Carlos Garnacho  &lt;carlosg@gnome.org&gt;
+
+        [GTK] Enable touch features
+        https://bugs.webkit.org/show_bug.cgi?id=98931
+
+        Reviewed by Carlos Garcia Campos.
+
+        * platform/gtk/TestExpectations: remove fast/events/touch
+        * platform/gtk-wk2/TestExpectations: Add new expectations on
+        fast/events/touch events.
+
</ins><span class="cx"> 2014-02-08  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         IDB: storage/indexeddb/mozilla/object-cursors.html fails
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/TestExpectations (163748 => 163749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/TestExpectations        2014-02-09 10:31:33 UTC (rev 163748)
+++ trunk/LayoutTests/platform/gtk/TestExpectations        2014-02-09 10:55:50 UTC (rev 163749)
</span><span class="lines">@@ -153,9 +153,6 @@
</span><span class="cx"> webkit.org/b/61140 fast/notifications [ Skip ]
</span><span class="cx"> webkit.org/b/61140 http/tests/notifications [ Skip ]
</span><span class="cx"> 
</span><del>-# These tests require touch support.
-webkit.org/b/98931 fast/events/touch [ Skip ]
-
</del><span class="cx"> # StorageTracker is not enabled.
</span><span class="cx"> webkit.org/b/98933 storage/domstorage/localstorage/storagetracker [ Skip ]
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkwk1TestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk-wk1/TestExpectations (163748 => 163749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk-wk1/TestExpectations        2014-02-09 10:31:33 UTC (rev 163748)
+++ trunk/LayoutTests/platform/gtk-wk1/TestExpectations        2014-02-09 10:55:50 UTC (rev 163749)
</span><span class="lines">@@ -257,6 +257,9 @@
</span><span class="cx"> # Needs custom policy delegate enhancement to log downloads
</span><span class="cx"> Bug(GTK) http/tests/download [ Failure ]
</span><span class="cx"> 
</span><ins>+# Touch support only implemented in WK2
+fast/events/touch [ Skip ]
+
</ins><span class="cx"> #////////////////////////////////////////////////////////////////////////////////////////
</span><span class="cx"> # End of Tests failing
</span><span class="cx"> #////////////////////////////////////////////////////////////////////////////////////////
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkwk2TestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk-wk2/TestExpectations (163748 => 163749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk-wk2/TestExpectations        2014-02-09 10:31:33 UTC (rev 163748)
+++ trunk/LayoutTests/platform/gtk-wk2/TestExpectations        2014-02-09 10:55:50 UTC (rev 163749)
</span><span class="lines">@@ -186,6 +186,23 @@
</span><span class="cx"> webkit.org/b/120401 fast/events [ Skip ]
</span><span class="cx"> webkit.org/b/120401 editing/selection [ Skip ]
</span><span class="cx"> 
</span><ins>+# Tests in the gesture folder exercise IOS-specific code, non appliable to GTK+
+fast/events/touch/gesture [ Skip ]
+
+# These tests rely on touch event grouping, which X11/GTK+ doesn't do by design
+webkit.org/b/128172 fast/events/touch/basic-multi-touch-events-limited.html [ Failure ]
+webkit.org/b/128172 fast/events/touch/basic-multi-touch-events.html [ Failure ]
+webkit.org/b/128172 fast/events/touch/touch-input-element-change-documents.html [ Failure ]
+webkit.org/b/128172 fast/events/touch/frame-hover-update.html [ Failure ]
+webkit.org/b/128172 fast/events/touch/multi-touch-grouped-targets.html [ Timeout Failure ]
+webkit.org/b/128172 fast/events/touch/multi-touch-inside-nested-iframes.html [ Timeout ]
+webkit.org/b/128172 fast/events/touch/multi-touch-inside-iframes.html [ Timeout ]
+webkit.org/b/128172 fast/events/touch/basic-single-touch-events.html [ Timeout ]
+webkit.org/b/128172 fast/events/touch/page-scaled-touch-gesture-click.html [ Timeout ]
+webkit.org/b/128172 fast/events/touch/touch-target.html [ Timeout ]
+webkit.org/b/128172 fast/events/touch/touch-target-limited.html [ Timeout ]
+webkit.org/b/128172 fast/events/touch/send-oncancel-event.html [ Timeout ]
+
</ins><span class="cx"> #////////////////////////////////////////////////////////////////////////////////////////
</span><span class="cx"> # End of Expected failures
</span><span class="cx"> #////////////////////////////////////////////////////////////////////////////////////////
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (163748 => 163749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-02-09 10:31:33 UTC (rev 163748)
+++ trunk/Source/WebCore/ChangeLog        2014-02-09 10:55:50 UTC (rev 163749)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2014-02-09  Carlos Garnacho  &lt;carlosg@gnome.org&gt;
+
+        [GTK] Add touch-events related code to build
+        https://bugs.webkit.org/show_bug.cgi?id=98931
+
+        Reviewed by Carlos Garcia Campos.
+
+        Tests in fast/events/touch have been enabled on GTK+ now that touch
+        support is implemented, and thus all expected bits are there.
+
+        * platform/gtk/GtkTouchContextHelper.cpp:
+        * platform/gtk/GtkTouchContextHelper.h: Add helper object to track all touchpoints, handy
+        when creating WebTouchEvents.
+        * GNUmakefile.list.am:
+        * PlatformGTK.cmake:
+        * bindings/gobject/GNUmakefile.am: Add touch related code and idls to build, those are
+        necessary now that GTK+ implements touch events.
+
</ins><span class="cx"> 2014-02-09  Zan Dobersek  &lt;zdobersek@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Switch the rest of CSS code from OwnPtr over to std::unique_ptr
</span></span></pre></div>
<a id="trunkSourceWebCoreGNUmakefilelistam"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/GNUmakefile.list.am (163748 => 163749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/GNUmakefile.list.am        2014-02-09 10:31:33 UTC (rev 163748)
+++ trunk/Source/WebCore/GNUmakefile.list.am        2014-02-09 10:55:50 UTC (rev 163749)
</span><span class="lines">@@ -2997,8 +2997,11 @@
</span><span class="cx">         Source/WebCore/dom/TextNodeTraversal.cpp \
</span><span class="cx">         Source/WebCore/dom/TextNodeTraversal.h \
</span><span class="cx">         Source/WebCore/dom/Text.h \
</span><ins>+        Source/WebCore/dom/Touch.cpp \
</ins><span class="cx">         Source/WebCore/dom/Touch.h \
</span><ins>+        Source/WebCore/dom/TouchEvent.cpp \
</ins><span class="cx">         Source/WebCore/dom/TouchEvent.h \
</span><ins>+        Source/WebCore/dom/TouchList.cpp \
</ins><span class="cx">         Source/WebCore/dom/TouchList.h \
</span><span class="cx">         Source/WebCore/dom/TransformSource.h \
</span><span class="cx">         Source/WebCore/dom/TransformSourceLibxslt.cpp \
</span><span class="lines">@@ -6178,6 +6181,8 @@
</span><span class="cx">         Source/WebCore/platform/gtk/GtkInputMethodFilter.h \
</span><span class="cx">         Source/WebCore/platform/gtk/GtkPopupMenu.cpp \
</span><span class="cx">         Source/WebCore/platform/gtk/GtkPopupMenu.h \
</span><ins>+        Source/WebCore/platform/gtk/GtkTouchContextHelper.cpp \
+        Source/WebCore/platform/gtk/GtkTouchContextHelper.h \
</ins><span class="cx">         Source/WebCore/platform/gtk/GtkUtilities.cpp \
</span><span class="cx">         Source/WebCore/platform/gtk/GtkUtilities.h \
</span><span class="cx">         Source/WebCore/platform/gtk/GtkVersioning.c \
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformGTK.cmake (163748 => 163749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformGTK.cmake        2014-02-09 10:31:33 UTC (rev 163748)
+++ trunk/Source/WebCore/PlatformGTK.cmake        2014-02-09 10:55:50 UTC (rev 163749)
</span><span class="lines">@@ -202,6 +202,7 @@
</span><span class="cx">     platform/gtk/GtkInputMethodFilter.cpp
</span><span class="cx">     platform/gtk/GtkPluginWidget.cpp
</span><span class="cx">     platform/gtk/GtkPopupMenu.cpp
</span><ins>+    platform/gtk/GtkTouchContextHelper.cpp
</ins><span class="cx">     platform/gtk/GtkUtilities.cpp
</span><span class="cx">     platform/gtk/GtkVersioning.c
</span><span class="cx">     platform/gtk/KeyBindingTranslator.cpp
</span><span class="lines">@@ -529,6 +530,7 @@
</span><span class="cx">         dom/Range.idl
</span><span class="cx">         dom/ShadowRoot.idl
</span><span class="cx">         dom/Text.idl
</span><ins>+        dom/Touch.idl
</ins><span class="cx">         dom/TreeWalker.idl
</span><span class="cx">         dom/UIEvent.idl
</span><span class="cx">         dom/WebKitNamedFlow.idl
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsgobjectGNUmakefileam"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/gobject/GNUmakefile.am (163748 => 163749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/gobject/GNUmakefile.am        2014-02-09 10:31:33 UTC (rev 163748)
+++ trunk/Source/WebCore/bindings/gobject/GNUmakefile.am        2014-02-09 10:55:50 UTC (rev 163749)
</span><span class="lines">@@ -262,6 +262,8 @@
</span><span class="cx">         DerivedSources/webkitdom/WebKitDOMStyleSheetPrivate.h \
</span><span class="cx">         DerivedSources/webkitdom/WebKitDOMText.cpp \
</span><span class="cx">         DerivedSources/webkitdom/WebKitDOMTextPrivate.h \
</span><ins>+        DerivedSources/webkitdom/WebKitDOMTouch.cpp \
+        DerivedSources/webkitdom/WebKitDOMTouchPrivate.h \
</ins><span class="cx">         DerivedSources/webkitdom/WebKitDOMTimeRanges.cpp \
</span><span class="cx">         DerivedSources/webkitdom/WebKitDOMTimeRangesPrivate.h \
</span><span class="cx">         DerivedSources/webkitdom/WebKitDOMTreeWalker.cpp \
</span><span class="lines">@@ -323,6 +325,7 @@
</span><span class="cx">         DerivedSources/webkitdom/WebKitDOMProcessingInstruction.h \
</span><span class="cx">         DerivedSources/webkitdom/WebKitDOMRange.h \
</span><span class="cx">         DerivedSources/webkitdom/WebKitDOMText.h \
</span><ins>+        DerivedSources/webkitdom/WebKitDOMTouch.h \
</ins><span class="cx">         DerivedSources/webkitdom/WebKitDOMTreeWalker.h \
</span><span class="cx">         DerivedSources/webkitdom/WebKitDOMUIEvent.h \
</span><span class="cx">         DerivedSources/webkitdom/WebKitDOMBlob.h \
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsgobjectwebkitdomsymbols"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/gobject/webkitdom.symbols (163748 => 163749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/gobject/webkitdom.symbols        2014-02-09 10:31:33 UTC (rev 163748)
+++ trunk/Source/WebCore/bindings/gobject/webkitdom.symbols        2014-02-09 10:55:50 UTC (rev 163749)
</span><span class="lines">@@ -104,6 +104,7 @@
</span><span class="cx"> WebKitDOMCSSStyleDeclaration* webkit_dom_document_get_override_style(WebKitDOMDocument*, WebKitDOMElement*, const gchar*)
</span><span class="cx"> WebKitDOMXPathExpression* webkit_dom_document_create_expression(WebKitDOMDocument*, const gchar*, WebKitDOMXPathNSResolver*, GError**)
</span><span class="cx"> WebKitDOMXPathNSResolver* webkit_dom_document_create_ns_resolver(WebKitDOMDocument*, WebKitDOMNode*)
</span><ins>+WebKitDOMTouch* webkit_dom_document_create_touch(WebKitDOMDocument*, WebKitDOMDOMWindow*, WebKitDOMEventTarget*, glong, glong, glong, glong, glong, glong, glong, gfloat, gfloat, GError**)
</ins><span class="cx"> WebKitDOMXPathResult* webkit_dom_document_evaluate(WebKitDOMDocument*, const gchar*, WebKitDOMNode*, WebKitDOMXPathNSResolver*, gushort, WebKitDOMXPathResult*, GError**)
</span><span class="cx"> gboolean webkit_dom_document_exec_command(WebKitDOMDocument*, const gchar*, gboolean, const gchar*)
</span><span class="cx"> gboolean webkit_dom_document_query_command_enabled(WebKitDOMDocument*, const gchar*)
</span><span class="lines">@@ -1662,6 +1663,18 @@
</span><span class="cx"> glong webkit_dom_wheel_event_get_wheel_delta_y(WebKitDOMWheelEvent*)
</span><span class="cx"> glong webkit_dom_wheel_event_get_wheel_delta(WebKitDOMWheelEvent*)
</span><span class="cx"> gboolean webkit_dom_wheel_event_get_webkit_direction_inverted_from_device(WebKitDOMWheelEvent*)
</span><ins>+WebKitDOMEventTarget* webkit_dom_touch_get_target(WebKitDOMTouch*)
+gfloat webkit_dom_touch_get_webkit_force(WebKitDOMTouch*)
+gfloat webkit_dom_touch_get_webkit_rotation_angle(WebKitDOMTouch*)
+glong webkit_dom_touch_get_client_x(WebKitDOMTouch*)
+glong webkit_dom_touch_get_client_y(WebKitDOMTouch*)
+glong webkit_dom_touch_get_page_x(WebKitDOMTouch*)
+glong webkit_dom_touch_get_page_y(WebKitDOMTouch*)
+glong webkit_dom_touch_get_screen_x(WebKitDOMTouch*)
+glong webkit_dom_touch_get_screen_y(WebKitDOMTouch*)
+glong webkit_dom_touch_get_webkit_radius_x(WebKitDOMTouch*)
+glong webkit_dom_touch_get_webkit_radius_y(WebKitDOMTouch*)
+gulong webkit_dom_touch_get_identifier(WebKitDOMTouch*)
</ins><span class="cx"> gchar* webkit_dom_audio_track_get_id(WebKitDOMAudioTrack*)
</span><span class="cx"> gchar* webkit_dom_audio_track_get_kind(WebKitDOMAudioTrack*)
</span><span class="cx"> gchar* webkit_dom_audio_track_get_label(WebKitDOMAudioTrack*)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgtkGtkTouchContextHelpercppfromrev163748trunkSourceWebKit2SharedgtkWebEventFactoryh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/gtk/GtkTouchContextHelper.cpp (from rev 163748, trunk/Source/WebKit2/Shared/gtk/WebEventFactory.h) (0 => 163749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/gtk/GtkTouchContextHelper.cpp                                (rev 0)
+++ trunk/Source/WebCore/platform/gtk/GtkTouchContextHelper.cpp        2014-02-09 10:55:50 UTC (rev 163749)
</span><span class="lines">@@ -0,0 +1,63 @@
</span><ins>+/*
+ * Copyright (C) 2013 Carlos Garnacho &lt;carlosg@gnome.org&gt;
+ *
+ * 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.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;GtkTouchContextHelper.h&quot;
+
+#include &lt;gtk/gtk.h&gt;
+
+namespace WebCore {
+
+bool GtkTouchContextHelper::handleEvent(GdkEvent* touchEvent)
+{
+#ifndef GTK_API_VERSION_2
+    uint32_t sequence = GPOINTER_TO_UINT(gdk_event_get_event_sequence(touchEvent));
+
+    switch (touchEvent-&gt;type) {
+    case GDK_TOUCH_BEGIN: {
+        ASSERT(m_touchEvents.contains(sequence));
+        GUniquePtr&lt;GdkEvent&gt; event(gdk_event_copy(touchEvent));
+        m_touchEvents.add(sequence, std::move(event));
+        break;
+    }
+    case GDK_TOUCH_UPDATE: {
+        auto it = m_touchEvents.find(sequence);
+        ASSERT(it != m_touchEvents.end());
+        it-&gt;value.reset(gdk_event_copy(touchEvent));
+        break;
+    }
+    case GDK_TOUCH_END:
+        ASSERT(m_touchEvents.contains(sequence));
+        m_touchEvents.remove(sequence);
+        break;
+    default:
+        return false;
+    }
+#endif // GTK_API_VERSION_2
+
+    return true;
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgtkGtkTouchContextHelperhfromrev163748trunkSourceWebKit2SharedgtkWebEventFactoryh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/gtk/GtkTouchContextHelper.h (from rev 163748, trunk/Source/WebKit2/Shared/gtk/WebEventFactory.h) (0 => 163749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/gtk/GtkTouchContextHelper.h                                (rev 0)
+++ trunk/Source/WebCore/platform/gtk/GtkTouchContextHelper.h        2014-02-09 10:55:50 UTC (rev 163749)
</span><span class="lines">@@ -0,0 +1,50 @@
</span><ins>+/*
+ * Copyright (C) 2013 Carlos Garnacho &lt;carlosg@gnome.org&gt;
+ *
+ * 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.
+ */
+
+#ifndef GtkTouchContextHelper_h
+#define GtkTouchContextHelper_h
+
+#include &quot;GUniquePtrGtk.h&quot;
+#include &lt;wtf/HashMap.h&gt;
+#include &lt;wtf/Noncopyable.h&gt;
+
+namespace WebCore {
+
+typedef HashMap&lt;uint32_t, GUniquePtr&lt;GdkEvent&gt;&gt; TouchEventsMap;
+
+class GtkTouchContextHelper {
+    WTF_MAKE_NONCOPYABLE(GtkTouchContextHelper);
+public:
+    GtkTouchContextHelper() { };
+    bool handleEvent(GdkEvent*);
+    const TouchEventsMap&amp; touchEvents() const { return m_touchEvents; };
+
+private:
+    TouchEventsMap m_touchEvents;
+};
+
+} // namespace WebCore
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKitgtkChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/gtk/ChangeLog (163748 => 163749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/gtk/ChangeLog        2014-02-09 10:31:33 UTC (rev 163748)
+++ trunk/Source/WebKit/gtk/ChangeLog        2014-02-09 10:55:50 UTC (rev 163749)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2014-02-09  Carlos Garnacho  &lt;carlosg@gnome.org&gt;
+
+        [GTK] Allow building with touch events enabled
+        https://bugs.webkit.org/show_bug.cgi?id=98931
+
+        Reviewed by Carlos Garcia Campos.
+
+        Even though WebKit1 GTK code doesn't implement touch events,
+        Fix build if ENABLE_TOUCH_EVENTS is present for WK2.
+
+        * WebCoreSupport/ChromeClientGtk.h:
+        (WebKit::ChromeClient::needTouchEvents): Add empty stub
+
</ins><span class="cx"> 2014-02-08  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Cleanup the interface of FrameSelection
</span></span></pre></div>
<a id="trunkSourceWebKitgtkWebCoreSupportChromeClientGtkh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h (163748 => 163749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h        2014-02-09 10:31:33 UTC (rev 163748)
+++ trunk/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h        2014-02-09 10:55:50 UTC (rev 163749)
</span><span class="lines">@@ -141,6 +141,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">         virtual void numWheelEventHandlersChanged(unsigned) { }
</span><ins>+        virtual void needTouchEvents(bool) { }
</ins><span class="cx"> 
</span><span class="cx">         virtual void attachRootGraphicsLayer(Frame*, GraphicsLayer*);
</span><span class="cx">         virtual void setNeedsOneShotDrawingSynchronization();
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (163748 => 163749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-02-09 10:31:33 UTC (rev 163748)
+++ trunk/Source/WebKit2/ChangeLog        2014-02-09 10:55:50 UTC (rev 163749)
</span><span class="lines">@@ -1,3 +1,37 @@
</span><ins>+2014-02-09  Carlos Garnacho  &lt;carlosg@gnome.org&gt;
+
+        [GTK] Implement support touch events
+        https://bugs.webkit.org/show_bug.cgi?id=98931
+
+        Reviewed by Carlos Garcia Campos.
+
+        In GTK+ &gt;= 3.4.0, GdkEventTouch is available to inform about multitouch events. Use these to implement
+        touch events on this platform. If a touch is left unhandled and is the &quot;pointer emulating&quot; one, mouse
+        events will be generated as a fallback.
+
+        * GNUmakefile.list.am:
+        * PlatformGTK.cmake:
+        * Shared/gtk/NativeWebTouchEventGtk.cpp:
+        * Shared/NativeWebTouchEvent.h:
+        (WebKit::NativeWebTouchEvent::nativeEvent):
+        (WebKit::NativeWebTouchEvent::touchContext): Add GTK+ implementation of NativeWebTouchEvent.
+        * Shared/gtk/WebEventFactory.cpp:
+        (WebKit::touchPhaseFromEvents):
+        (WebKit::WebEventFactory::createWebTouchEvent): Add methods to generate WebTouchEvents out
+        of GdkEventTouch events, a GtkTouchContextHelper object is used to hold information about all current
+        touches, in order to build information about all individual touchpoints.
+        * Shared/gtk/WebEventFactory.h:
+        * UIProcess/API/gtk/PageClientImpl.cpp:
+        (WebKit::PageClientImpl::doneWithTouchEvent): Implement pointer emulation. If a touch event was unhandled
+        in DOM and pertains to the touch sequence that emulates pointer events. The event gets transformed to its
+        mouse event counterpart and handled by the widget again.
+        * UIProcess/API/gtk/PageClientImpl.h:
+        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
+        (webkitWebViewBaseRealize): Listen for touch events
+        (webkitWebViewBaseTouchEvent):
+        (webkit_web_view_base_class_init): Add implementation for the touch_events() handler, this merely
+        lets the pageProxy handle the NativeWebTouchEvent we create to wrap the GdkEvent received.
+
</ins><span class="cx"> 2014-02-09  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r162768.
</span></span></pre></div>
<a id="trunkSourceWebKit2GNUmakefilelistam"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/GNUmakefile.list.am (163748 => 163749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/GNUmakefile.list.am        2014-02-09 10:31:33 UTC (rev 163748)
+++ trunk/Source/WebKit2/GNUmakefile.list.am        2014-02-09 10:55:50 UTC (rev 163749)
</span><span class="lines">@@ -384,6 +384,7 @@
</span><span class="cx">         Source/WebKit2/Shared/gtk/LayerTreeContextGtk.cpp \
</span><span class="cx">         Source/WebKit2/Shared/gtk/NativeWebKeyboardEventGtk.cpp \
</span><span class="cx">         Source/WebKit2/Shared/gtk/NativeWebMouseEventGtk.cpp \
</span><ins>+        Source/WebKit2/Shared/gtk/NativeWebTouchEventGtk.cpp \
</ins><span class="cx">         Source/WebKit2/Shared/gtk/NativeWebWheelEventGtk.cpp \
</span><span class="cx">         Source/WebKit2/Shared/gtk/PrintInfoGtk.cpp \
</span><span class="cx">         Source/WebKit2/Shared/gtk/ProcessExecutablePathGtk.cpp \
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/PlatformGTK.cmake (163748 => 163749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/PlatformGTK.cmake        2014-02-09 10:31:33 UTC (rev 163748)
+++ trunk/Source/WebKit2/PlatformGTK.cmake        2014-02-09 10:55:50 UTC (rev 163749)
</span><span class="lines">@@ -56,6 +56,7 @@
</span><span class="cx">     Shared/gtk/LayerTreeContextGtk.cpp
</span><span class="cx">     Shared/gtk/NativeWebKeyboardEventGtk.cpp
</span><span class="cx">     Shared/gtk/NativeWebMouseEventGtk.cpp
</span><ins>+    Shared/gtk/NativeWebTouchEventGtk.cpp
</ins><span class="cx">     Shared/gtk/NativeWebWheelEventGtk.cpp
</span><span class="cx">     Shared/gtk/PrintInfoGtk.cpp
</span><span class="cx">     Shared/gtk/ProcessExecutablePathGtk.cpp
</span><span class="lines">@@ -565,6 +566,8 @@
</span><span class="cx">         Shared/WebKeyboardEvent.cpp
</span><span class="cx">         Shared/WebKit2Initialize.cpp
</span><span class="cx">         Shared/WebMouseEvent.cpp
</span><ins>+        Shared/WebPlatformTouchPoint.cpp
+        Shared/WebTouchEvent.cpp
</ins><span class="cx">         Shared/WebWheelEvent.cpp
</span><span class="cx"> 
</span><span class="cx">         Shared/Plugins/NPIdentifierData.cpp
</span><span class="lines">@@ -583,6 +586,7 @@
</span><span class="cx"> 
</span><span class="cx">         Shared/gtk/NativeWebKeyboardEventGtk.cpp
</span><span class="cx">         Shared/gtk/NativeWebMouseEventGtk.cpp
</span><ins>+        Shared/gtk/NativeWebTouchEventGtk.cpp
</ins><span class="cx">         Shared/gtk/NativeWebWheelEventGtk.cpp
</span><span class="cx">         Shared/gtk/ProcessExecutablePathGtk.cpp
</span><span class="cx">         Shared/gtk/WebEventFactory.cpp
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedNativeWebTouchEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/NativeWebTouchEvent.h (163748 => 163749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/NativeWebTouchEvent.h        2014-02-09 10:31:33 UTC (rev 163748)
+++ trunk/Source/WebKit2/Shared/NativeWebTouchEvent.h        2014-02-09 10:55:50 UTC (rev 163749)
</span><span class="lines">@@ -31,9 +31,10 @@
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> OBJC_CLASS UIWebTouchEventsGestureRecognizer;
</span><del>-#endif // PLATFORM(IOS)
-
-#if PLATFORM(EFL)
</del><ins>+#elif PLATFORM(GTK)
+#include &lt;WebCore/GUniquePtrGtk.h&gt;
+#include &lt;WebCore/GtkTouchContextHelper.h&gt;
+#elif PLATFORM(EFL)
</ins><span class="cx"> #include &quot;EwkTouchEvent.h&quot;
</span><span class="cx"> #include &lt;WebCore/AffineTransform.h&gt;
</span><span class="cx"> #include &lt;wtf/RefPtr.h&gt;
</span><span class="lines">@@ -46,8 +47,12 @@
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     explicit NativeWebTouchEvent(UIWebTouchEventsGestureRecognizer *);
</span><span class="cx">     const UIWebTouchEventsGestureRecognizer* nativeEvent() const { return m_nativeEvent.get(); }
</span><del>-#endif
-#if PLATFORM(EFL)
</del><ins>+#elif PLATFORM(GTK)
+    NativeWebTouchEvent(const NativeWebTouchEvent&amp;);
+    NativeWebTouchEvent(GdkEvent*, WebCore::GtkTouchContextHelper&amp;);
+    const GdkEvent* nativeEvent() const { return m_nativeEvent.get(); }
+    const WebCore::GtkTouchContextHelper&amp; touchContext() const { return m_touchContext; }
+#elif PLATFORM(EFL)
</ins><span class="cx">     NativeWebTouchEvent(EwkTouchEvent*, const WebCore::AffineTransform&amp;);
</span><span class="cx">     const EwkTouchEvent* nativeEvent() const { return m_nativeEvent.get(); }
</span><span class="cx"> #endif
</span><span class="lines">@@ -55,8 +60,10 @@
</span><span class="cx"> private:
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     RetainPtr&lt;UIWebTouchEventsGestureRecognizer&gt; m_nativeEvent;
</span><del>-#endif
-#if PLATFORM(EFL)
</del><ins>+#elif PLATFORM(GTK)
+    GUniquePtr&lt;GdkEvent&gt; m_nativeEvent;
+    const WebCore::GtkTouchContextHelper&amp; m_touchContext;
+#elif PLATFORM(EFL)
</ins><span class="cx">     RefPtr&lt;EwkTouchEvent&gt; m_nativeEvent;
</span><span class="cx"> #endif
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedgtkNativeWebTouchEventGtkcppfromrev163748trunkSourceWebKit2SharedgtkWebEventFactoryh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/Shared/gtk/NativeWebTouchEventGtk.cpp (from rev 163748, trunk/Source/WebKit2/Shared/gtk/WebEventFactory.h) (0 => 163749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/gtk/NativeWebTouchEventGtk.cpp                                (rev 0)
+++ trunk/Source/WebKit2/Shared/gtk/NativeWebTouchEventGtk.cpp        2014-02-09 10:55:50 UTC (rev 163749)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+/*
+ * Copyright (C) 2013 Carlos Garnacho &lt;carlosg@gnome.org&gt;
+ *
+ * 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.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;NativeWebTouchEvent.h&quot;
+
+#include &quot;WebEventFactory.h&quot;
+#include &lt;gdk/gdk.h&gt;
+
+namespace WebKit {
+
+NativeWebTouchEvent::NativeWebTouchEvent(GdkEvent* event, WebCore::GtkTouchContextHelper&amp; context)
+    : WebTouchEvent(WebEventFactory::createWebTouchEvent(event, context))
+    , m_nativeEvent(gdk_event_copy(event))
+    , m_touchContext(context)
+{
+}
+
+NativeWebTouchEvent::NativeWebTouchEvent(const NativeWebTouchEvent&amp; event)
+    : WebTouchEvent(WebEventFactory::createWebTouchEvent(event.nativeEvent(), event.touchContext()))
+    , m_nativeEvent(gdk_event_copy(event.nativeEvent()))
+    , m_touchContext(event.touchContext())
+{
+}
+
+} // namespace WebKit
</ins></span></pre></div>
<a id="trunkSourceWebKit2SharedgtkWebEventFactorycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/gtk/WebEventFactory.cpp (163748 => 163749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/gtk/WebEventFactory.cpp        2014-02-09 10:31:33 UTC (rev 163748)
+++ trunk/Source/WebKit2/Shared/gtk/WebEventFactory.cpp        2014-02-09 10:55:50 UTC (rev 163749)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> #include &lt;WebCore/GtkVersioning.h&gt;
</span><span class="cx"> #include &lt;gdk/gdk.h&gt;
</span><span class="cx"> #include &lt;gdk/gdkkeysyms.h&gt;
</span><ins>+#include &lt;gtk/gtk.h&gt;
</ins><span class="cx"> #include &lt;wtf/ASCIICType.h&gt;
</span><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="lines">@@ -203,4 +204,75 @@
</span><span class="cx">                             gdk_event_get_time(event));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#ifndef GTK_API_VERSION_2
+static WebPlatformTouchPoint::TouchPointState touchPhaseFromEvents(const GdkEvent* current, const GdkEvent* event)
+{
+    if (gdk_event_get_event_sequence(current) != gdk_event_get_event_sequence(event))
+        return WebPlatformTouchPoint::TouchStationary;
+
+    switch (current-&gt;type) {
+    case GDK_TOUCH_UPDATE:
+        return WebPlatformTouchPoint::TouchMoved;
+    case GDK_TOUCH_BEGIN:
+        return WebPlatformTouchPoint::TouchPressed;
+    case GDK_TOUCH_END:
+        return WebPlatformTouchPoint::TouchReleased;
+    default:
+        return WebPlatformTouchPoint::TouchStationary;
+    }
+}
+
+static void appendTouchEvent(Vector&lt;WebPlatformTouchPoint&gt;&amp; touchPointList, const GdkEvent* event, WebPlatformTouchPoint::TouchPointState state)
+{
+    uint32_t identifier = GPOINTER_TO_UINT(gdk_event_get_event_sequence(event));
+
+    gdouble x, y;
+    gdk_event_get_coords(event, &amp;x, &amp;y);
+
+    gdouble xRoot, yRoot;
+    gdk_event_get_root_coords(event, &amp;xRoot, &amp;yRoot);
+
+    WebPlatformTouchPoint touchPoint(identifier, state, IntPoint(xRoot, yRoot), IntPoint(x, y));
+    touchPointList.uncheckedAppend(touchPoint);
+}
+#endif // GTK_API_VERSION_2
+
+WebTouchEvent WebEventFactory::createWebTouchEvent(const GdkEvent* event, const WebCore::GtkTouchContextHelper&amp; touchContext)
+{
+#ifndef GTK_API_VERSION_2
+    WebEvent::Type type = WebEvent::NoType;
+    const auto&amp; touchEvents = touchContext.touchEvents();
+    int numEvents = touchEvents.size();
+
+    switch (event-&gt;type) {
+    case GDK_TOUCH_BEGIN:
+        type = WebEvent::TouchStart;
+        break;
+    case GDK_TOUCH_UPDATE:
+        type = WebEvent::TouchMove;
+        break;
+    case GDK_TOUCH_END:
+        type = WebEvent::TouchEnd;
+        ++numEvents;
+        break;
+    default:
+        ASSERT_NOT_REACHED();
+    }
+
+    Vector&lt;WebPlatformTouchPoint&gt; touchPointList;
+    touchPointList.reserveInitialCapacity(numEvents);
+
+    for (auto it = touchEvents.begin(); it != touchEvents.end(); ++it)
+        appendTouchEvent(touchPointList, it-&gt;value.get(), touchPhaseFromEvents(it-&gt;value.get(), event));
+
+    // Touch was already removed from the GtkTouchContextHelper, add it here.
+    if (event-&gt;type == GDK_TOUCH_END)
+        appendTouchEvent(touchPointList, event, WebPlatformTouchPoint::TouchReleased);
+
+    return WebTouchEvent(type, touchPointList, modifiersForEvent(event), gdk_event_get_time(event));
+#else
+    return WebTouchEvent();
+#endif // GTK_API_VERSION_2
+}
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedgtkWebEventFactoryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/gtk/WebEventFactory.h (163748 => 163749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/gtk/WebEventFactory.h        2014-02-09 10:31:33 UTC (rev 163748)
+++ trunk/Source/WebKit2/Shared/gtk/WebEventFactory.h        2014-02-09 10:55:50 UTC (rev 163749)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;WebEvent.h&quot;
</span><span class="cx"> #include &lt;WebCore/CompositionResults.h&gt;
</span><ins>+#include &lt;WebCore/GtkTouchContextHelper.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> typedef union _GdkEvent GdkEvent;
</span><span class="cx"> 
</span><span class="lines">@@ -39,6 +40,7 @@
</span><span class="cx">     static WebMouseEvent createWebMouseEvent(const GdkEvent*, int);
</span><span class="cx">     static WebWheelEvent createWebWheelEvent(const GdkEvent*);
</span><span class="cx">     static WebKeyboardEvent createWebKeyboardEvent(const GdkEvent*, const WebCore::CompositionResults&amp;);
</span><ins>+    static WebTouchEvent createWebTouchEvent(const GdkEvent*, const WebCore::GtkTouchContextHelper&amp;);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkPageClientImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp (163748 => 163749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp        2014-02-09 10:31:33 UTC (rev 163748)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp        2014-02-09 10:55:50 UTC (rev 163749)
</span><span class="lines">@@ -327,4 +327,54 @@
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(FULLSCREEN_API)
</span><span class="cx"> 
</span><ins>+void PageClientImpl::doneWithTouchEvent(const NativeWebTouchEvent&amp; event, bool wasEventHandled)
+{
+    if (wasEventHandled)
+        return;
+
+    // Emulate pointer events if unhandled.
+    const GdkEvent* touchEvent = event.nativeEvent();
+
+    if (!touchEvent-&gt;touch.emulating_pointer)
+        return;
+
+    GUniquePtr&lt;GdkEvent&gt; pointerEvent;
+
+    if (touchEvent-&gt;type == GDK_TOUCH_UPDATE) {
+        pointerEvent.reset(gdk_event_new(GDK_MOTION_NOTIFY));
+        pointerEvent-&gt;motion.time = touchEvent-&gt;touch.time;
+        pointerEvent-&gt;motion.x = touchEvent-&gt;touch.x;
+        pointerEvent-&gt;motion.y = touchEvent-&gt;touch.y;
+        pointerEvent-&gt;motion.x_root = touchEvent-&gt;touch.x_root;
+        pointerEvent-&gt;motion.y_root = touchEvent-&gt;touch.y_root;
+        pointerEvent-&gt;motion.state = touchEvent-&gt;touch.state | GDK_BUTTON1_MASK;
+    } else {
+        switch (touchEvent-&gt;type) {
+        case GDK_TOUCH_END:
+            pointerEvent.reset(gdk_event_new(GDK_BUTTON_RELEASE));
+            pointerEvent-&gt;button.state = touchEvent-&gt;touch.state | GDK_BUTTON1_MASK;
+            break;
+        case GDK_TOUCH_BEGIN:
+            pointerEvent.reset(gdk_event_new(GDK_BUTTON_PRESS));
+            break;
+        default:
+            ASSERT_NOT_REACHED();
+        }
+
+        pointerEvent-&gt;button.button = 1;
+        pointerEvent-&gt;button.time = touchEvent-&gt;touch.time;
+        pointerEvent-&gt;button.x = touchEvent-&gt;touch.x;
+        pointerEvent-&gt;button.y = touchEvent-&gt;touch.y;
+        pointerEvent-&gt;button.x_root = touchEvent-&gt;touch.x_root;
+        pointerEvent-&gt;button.y_root = touchEvent-&gt;touch.y_root;
+    }
+
+    gdk_event_set_device(pointerEvent.get(), gdk_event_get_device(touchEvent));
+    gdk_event_set_source_device(pointerEvent.get(), gdk_event_get_source_device(touchEvent));
+    pointerEvent-&gt;any.window = GDK_WINDOW(g_object_ref(touchEvent-&gt;any.window));
+    pointerEvent-&gt;any.send_event = TRUE;
+
+    gtk_widget_event(m_viewWidget, pointerEvent.get());
+}
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkPageClientImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h (163748 => 163749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h        2014-02-09 10:31:33 UTC (rev 163748)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h        2014-02-09 10:55:50 UTC (rev 163749)
</span><span class="lines">@@ -119,6 +119,8 @@
</span><span class="cx">     virtual void beganExitFullScreen(const WebCore::IntRect&amp; initialFrame, const WebCore::IntRect&amp; finalFrame) override;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    virtual void doneWithTouchEvent(const NativeWebTouchEvent&amp;, bool wasEventHandled) override;
+
</ins><span class="cx">     // Members of PageClientImpl class
</span><span class="cx">     GtkWidget* m_viewWidget;
</span><span class="cx">     DefaultUndoController m_undoController;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp (163748 => 163749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp        2014-02-09 10:31:33 UTC (rev 163748)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp        2014-02-09 10:55:50 UTC (rev 163749)
</span><span class="lines">@@ -53,6 +53,7 @@
</span><span class="cx"> #include &lt;WebCore/GUniquePtrGtk.h&gt;
</span><span class="cx"> #include &lt;WebCore/GtkClickCounter.h&gt;
</span><span class="cx"> #include &lt;WebCore/GtkDragAndDropHelper.h&gt;
</span><ins>+#include &lt;WebCore/GtkTouchContextHelper.h&gt;
</ins><span class="cx"> #include &lt;WebCore/GtkUtilities.h&gt;
</span><span class="cx"> #include &lt;WebCore/GtkVersioning.h&gt;
</span><span class="cx"> #include &lt;WebCore/NotImplemented.h&gt;
</span><span class="lines">@@ -110,6 +111,7 @@
</span><span class="cx">     GUniquePtr&lt;GdkEvent&gt; contextMenuEvent;
</span><span class="cx">     WebContextMenuProxyGtk* activeContextMenuProxy;
</span><span class="cx">     WebViewBaseInputMethodFilter inputMethodFilter;
</span><ins>+    GtkTouchContextHelper touchContext;
</ins><span class="cx"> 
</span><span class="cx">     GtkWindow* toplevelOnScreenWindow;
</span><span class="cx">     unsigned long toplevelResizeGripVisibilityID;
</span><span class="lines">@@ -272,7 +274,8 @@
</span><span class="cx">         | GDK_BUTTON_MOTION_MASK
</span><span class="cx">         | GDK_BUTTON1_MOTION_MASK
</span><span class="cx">         | GDK_BUTTON2_MOTION_MASK
</span><del>-        | GDK_BUTTON3_MOTION_MASK;
</del><ins>+        | GDK_BUTTON3_MOTION_MASK
+        | GDK_TOUCH_MASK;
</ins><span class="cx"> 
</span><span class="cx">     gint attributesMask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
</span><span class="cx"> 
</span><span class="lines">@@ -712,6 +715,19 @@
</span><span class="cx">     return TRUE;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static gboolean webkitWebViewBaseTouchEvent(GtkWidget* widget, GdkEventTouch* event)
+{
+    WebKitWebViewBasePrivate* priv = WEBKIT_WEB_VIEW_BASE(widget)-&gt;priv;
+
+    if (priv-&gt;authenticationDialog)
+        return TRUE;
+
+    priv-&gt;touchContext.handleEvent(reinterpret_cast&lt;GdkEvent*&gt;(event));
+    priv-&gt;pageProxy-&gt;handleTouchEvent(NativeWebTouchEvent(reinterpret_cast&lt;GdkEvent*&gt;(event), priv-&gt;touchContext));
+
+    return TRUE;
+}
+
</ins><span class="cx"> static gboolean webkitWebViewBaseQueryTooltip(GtkWidget* widget, gint x, gint y, gboolean keyboardMode, GtkTooltip* tooltip)
</span><span class="cx"> {
</span><span class="cx">     WebKitWebViewBasePrivate* priv = WEBKIT_WEB_VIEW_BASE(widget)-&gt;priv;
</span><span class="lines">@@ -896,6 +912,7 @@
</span><span class="cx">     widgetClass-&gt;button_release_event = webkitWebViewBaseButtonReleaseEvent;
</span><span class="cx">     widgetClass-&gt;scroll_event = webkitWebViewBaseScrollEvent;
</span><span class="cx">     widgetClass-&gt;motion_notify_event = webkitWebViewBaseMotionNotifyEvent;
</span><ins>+    widgetClass-&gt;touch_event = webkitWebViewBaseTouchEvent;
</ins><span class="cx">     widgetClass-&gt;query_tooltip = webkitWebViewBaseQueryTooltip;
</span><span class="cx"> #if ENABLE(DRAG_SUPPORT)
</span><span class="cx">     widgetClass-&gt;drag_end = webkitWebViewBaseDragEnd;
</span></span></pre></div>
<a id="trunkSourceautotoolsSetupWebKitFeaturesm4"></a>
<div class="modfile"><h4>Modified: trunk/Source/autotools/SetupWebKitFeatures.m4 (163748 => 163749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/autotools/SetupWebKitFeatures.m4        2014-02-09 10:31:33 UTC (rev 163748)
+++ trunk/Source/autotools/SetupWebKitFeatures.m4        2014-02-09 10:55:50 UTC (rev 163749)
</span><span class="lines">@@ -159,7 +159,7 @@
</span><span class="cx">     ENABLE_TEMPLATE_ELEMENT=1 \
</span><span class="cx">     ENABLE_SATURATED_LAYOUT_ARITHMETIC=1\
</span><span class="cx">     ENABLE_TEXT_AUTOSIZING=0 \
</span><del>-    ENABLE_TOUCH_EVENTS=0 \
</del><ins>+    ENABLE_TOUCH_EVENTS=1 \
</ins><span class="cx">     ENABLE_TOUCH_ICON_LOADING=0 \
</span><span class="cx">     ENABLE_USER_TIMING=0 \
</span><span class="cx">     ENABLE_VIBRATION=0 \
</span></span></pre></div>
<a id="trunkSourcecmakeOptionsGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/cmake/OptionsGTK.cmake (163748 => 163749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/cmake/OptionsGTK.cmake        2014-02-09 10:31:33 UTC (rev 163748)
+++ trunk/Source/cmake/OptionsGTK.cmake        2014-02-09 10:55:50 UTC (rev 163749)
</span><span class="lines">@@ -66,7 +66,7 @@
</span><span class="cx"> WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SHARED_WORKERS ON)
</span><span class="cx"> WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SPELLCHECK ON)
</span><span class="cx"> WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_TEMPLATE_ELEMENT ON)
</span><del>-WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_TOUCH_EVENTS OFF)
</del><ins>+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_TOUCH_EVENTS ON)
</ins><span class="cx"> WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_USERSELECT_ALL ON)
</span><span class="cx"> WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_VIBRATION OFF)
</span><span class="cx"> WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_VIDEO ON)
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (163748 => 163749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2014-02-09 10:31:33 UTC (rev 163748)
+++ trunk/Tools/ChangeLog        2014-02-09 10:55:50 UTC (rev 163749)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2014-02-09  Carlos Garnacho  &lt;carlosg@gnome.org&gt;
+
+        [GTK] Enable touch features
+        https://bugs.webkit.org/show_bug.cgi?id=98931
+
+        Reviewed by Carlos Garcia Campos.
+
+        * WebKitTestRunner/EventSenderProxy.h:
+        * WebKitTestRunner/gtk/EventSenderProxyGtk.cpp:
+        (WTR::updateEventCoordinates):
+        (WTR::EventSenderProxy::createTouchEvent):
+        (WTR::EventSenderProxy::addTouchPoint):
+        (WTR::EventSenderProxy::updateTouchPoint):
+        (WTR::EventSenderProxy::sendUpdatedTouchEvents):
+        (WTR::EventSenderProxy::setTouchPointRadius):
+        (WTR::EventSenderProxy::setTouchModifier): Implement touch event proxying.
+
</ins><span class="cx"> 2014-02-08  Andreas Kling  &lt;akling@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Let Instruments time profiler run until tests finish.
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreegtkEventSendercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/gtk/EventSender.cpp (163748 => 163749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/gtk/EventSender.cpp        2014-02-09 10:31:33 UTC (rev 163748)
+++ trunk/Tools/DumpRenderTree/gtk/EventSender.cpp        2014-02-09 10:55:50 UTC (rev 163749)
</span><span class="lines">@@ -912,6 +912,11 @@
</span><span class="cx">     return JSValueMakeUndefined(context);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static JSValueRef clearTouchPointsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    return JSValueMakeUndefined(context);
+}
+
</ins><span class="cx"> static JSStaticFunction staticFunctions[] = {
</span><span class="cx">     { &quot;mouseScrollBy&quot;, mouseScrollByCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span><span class="cx">     { &quot;continuousMouseScrollBy&quot;, continuousMouseScrollByCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span></span></pre></div>
<a id="trunkToolsScriptswebkitperlFeatureListpm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitperl/FeatureList.pm (163748 => 163749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitperl/FeatureList.pm        2014-02-09 10:31:33 UTC (rev 163748)
+++ trunk/Tools/Scripts/webkitperl/FeatureList.pm        2014-02-09 10:55:50 UTC (rev 163749)
</span><span class="lines">@@ -426,7 +426,7 @@
</span><span class="cx">       define =&gt; &quot;WTF_USE_TILED_BACKING_STORE&quot;, default =&gt; isEfl(), value =&gt; \$tiledBackingStoreSupport },
</span><span class="cx"> 
</span><span class="cx">     { option =&gt; &quot;touch-events&quot;, desc =&gt; &quot;Toggle Touch Events support&quot;,
</span><del>-      define =&gt; &quot;ENABLE_TOUCH_EVENTS&quot;, default =&gt; (isIOSWebKit() || isEfl()), value =&gt; \$touchEventsSupport },
</del><ins>+      define =&gt; &quot;ENABLE_TOUCH_EVENTS&quot;, default =&gt; (isIOSWebKit() || isEfl() || isGtk()), value =&gt; \$touchEventsSupport },
</ins><span class="cx"> 
</span><span class="cx">     { option =&gt; &quot;touch-slider&quot;, desc =&gt; &quot;Toggle Touch Slider support&quot;,
</span><span class="cx">       define =&gt; &quot;ENABLE_TOUCH_SLIDER&quot;, default =&gt; 0, value =&gt; \$touchSliderSupport },
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerEventSenderProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/EventSenderProxy.h (163748 => 163749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/EventSenderProxy.h        2014-02-09 10:31:33 UTC (rev 163748)
+++ trunk/Tools/WebKitTestRunner/EventSenderProxy.h        2014-02-09 10:55:50 UTC (rev 163749)
</span><span class="lines">@@ -28,9 +28,13 @@
</span><span class="cx"> #define EventSenderProxy_h
</span><span class="cx"> 
</span><span class="cx"> #include &lt;wtf/Deque.h&gt;
</span><ins>+#include &lt;wtf/HashMap.h&gt;
+#include &lt;wtf/Vector.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(GTK)
</span><ins>+#include &lt;WebCore/GUniquePtrGtk.h&gt;
</ins><span class="cx"> #include &lt;gdk/gdk.h&gt;
</span><ins>+#include &lt;wtf/HashSet.h&gt;
</ins><span class="cx"> #elif PLATFORM(EFL)
</span><span class="cx"> #include &lt;WebKit2/EWebKit2.h&gt;
</span><span class="cx"> #endif
</span><span class="lines">@@ -90,6 +94,8 @@
</span><span class="cx"> #if PLATFORM(GTK)
</span><span class="cx">     void sendOrQueueEvent(GdkEvent*);
</span><span class="cx">     GdkEvent* createMouseButtonEvent(GdkEventType, unsigned button, WKEventModifiers);
</span><ins>+    GUniquePtr&lt;GdkEvent&gt; createTouchEvent(GdkEventType, int id);
+    void sendUpdatedTouchEvents();
</ins><span class="cx"> #elif PLATFORM(EFL)
</span><span class="cx">     void sendOrQueueEvent(const WTREvent&amp;);
</span><span class="cx">     void dispatchEvent(const WTREvent&amp;);
</span><span class="lines">@@ -110,6 +116,8 @@
</span><span class="cx"> #elif PLATFORM(GTK)
</span><span class="cx">     Deque&lt;WTREventQueueItem&gt; m_eventQueue;
</span><span class="cx">     unsigned m_mouseButtonCurrentlyDown;
</span><ins>+    Vector&lt;GUniquePtr&lt;GdkEvent&gt;&gt; m_touchEvents;
+    HashSet&lt;int&gt; m_updatedTouchEvents;
</ins><span class="cx"> #elif PLATFORM(EFL)
</span><span class="cx">     Deque&lt;WTREvent&gt; m_eventQueue;
</span><span class="cx">     WKEventMouseButton m_mouseButton;
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnergtkEventSenderProxyGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/gtk/EventSenderProxyGtk.cpp (163748 => 163749)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/gtk/EventSenderProxyGtk.cpp        2014-02-09 10:31:33 UTC (rev 163748)
+++ trunk/Tools/WebKitTestRunner/gtk/EventSenderProxyGtk.cpp        2014-02-09 10:55:50 UTC (rev 163749)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;EventSenderProxy.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;NotImplemented.h&quot;
</ins><span class="cx"> #include &quot;PlatformWebView.h&quot;
</span><span class="cx"> #include &quot;TestController.h&quot;
</span><span class="cx"> #include &lt;gdk/gdkkeysyms.h&gt;
</span><span class="lines">@@ -441,4 +442,120 @@
</span><span class="cx">     m_time += milliseconds / 1000.0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void updateEventCoordinates(GdkEvent* touchEvent, int x, int y)
+{
+    touchEvent-&gt;touch.x = x;
+    touchEvent-&gt;touch.y = y;
+
+    int xRoot, yRoot;
+    gdk_window_get_root_coords(touchEvent-&gt;touch.window, x, y, &amp;xRoot, &amp;yRoot);
+    touchEvent-&gt;touch.x_root = xRoot;
+    touchEvent-&gt;touch.y_root = yRoot;
+}
+
+GUniquePtr&lt;GdkEvent&gt; EventSenderProxy::createTouchEvent(GdkEventType eventType, int id)
+{
+    GUniquePtr&lt;GdkEvent&gt; touchEvent(gdk_event_new(eventType));
+
+    touchEvent-&gt;touch.sequence = static_cast&lt;GdkEventSequence*&gt;(GINT_TO_POINTER(id));
+    touchEvent-&gt;touch.window = gtk_widget_get_window(GTK_WIDGET(m_testController-&gt;mainWebView()-&gt;platformView()));
+    g_object_ref(touchEvent-&gt;touch.window);
+    gdk_event_set_device(touchEvent.get(), gdk_device_manager_get_client_pointer(gdk_display_get_device_manager(gdk_window_get_display(touchEvent-&gt;button.window))));
+    touchEvent-&gt;touch.time = GDK_CURRENT_TIME;
+
+    return touchEvent;
+}
+
+void EventSenderProxy::addTouchPoint(int x, int y)
+{
+    // Touch ID is array index plus one, so 0 is skipped.
+    GUniquePtr&lt;GdkEvent&gt; event = createTouchEvent(static_cast&lt;GdkEventType&gt;(GDK_TOUCH_BEGIN), m_touchEvents.size() + 1);
+    updateEventCoordinates(event.get(), x, y);
+    m_touchEvents.append(std::move(event));
+    m_updatedTouchEvents.add(GPOINTER_TO_INT(event-&gt;touch.sequence));
+}
+
+void EventSenderProxy::updateTouchPoint(int index, int x, int y)
+{
+    ASSERT(index &gt;= 0 &amp;&amp; index &lt; m_touchEvents.size());
+
+    const auto&amp; event = m_touchEvents[index];
+    ASSERT(event);
+
+    event-&gt;type = GDK_TOUCH_UPDATE;
+    updateEventCoordinates(event.get(), x, y);
+    m_updatedTouchEvents.add(GPOINTER_TO_INT(event-&gt;touch.sequence));
+}
+
+void EventSenderProxy::sendUpdatedTouchEvents()
+{
+    for (auto id : m_updatedTouchEvents)
+        sendOrQueueEvent(gdk_event_copy(m_touchEvents[id - 1].get()));
+
+    m_updatedTouchEvents.clear();
+}
+
+void EventSenderProxy::touchStart()
+{
+    sendUpdatedTouchEvents();
+}
+
+void EventSenderProxy::touchMove()
+{
+    sendUpdatedTouchEvents();
+}
+
+void EventSenderProxy::touchEnd()
+{
+    sendUpdatedTouchEvents();
+}
+
+void EventSenderProxy::touchCancel()
+{
+    notImplemented();
+}
+
+void EventSenderProxy::clearTouchPoints()
+{
+    m_updatedTouchEvents.clear();
+    m_touchEvents.clear();
+}
+
+void EventSenderProxy::releaseTouchPoint(int index)
+{
+    ASSERT(index &gt;= 0 &amp;&amp; index &lt; m_touchEvents.size());
+
+    const auto&amp; event = m_touchEvents[index];
+    event-&gt;type = GDK_TOUCH_END;
+    m_updatedTouchEvents.add(GPOINTER_TO_INT(event-&gt;touch.sequence));
+}
+
+void EventSenderProxy::cancelTouchPoint(int index)
+{
+    notImplemented();
+}
+
+void EventSenderProxy::setTouchPointRadius(int radiusX, int radiusY)
+{
+    notImplemented();
+}
+
+void EventSenderProxy::setTouchModifier(WKEventModifiers modifier, bool enable)
+{
+    guint state = webkitModifiersToGDKModifiers(modifier);
+
+    for (const auto&amp; event : m_touchEvents) {
+        if (event-&gt;type == GDK_TOUCH_END)
+            continue;
+
+        if (enable)
+            event-&gt;touch.state |= state;
+        else
+            event-&gt;touch.state &amp;= ~(state);
+
+        m_updatedTouchEvents.add(GPOINTER_TO_INT(event-&gt;touch.sequence));
+    }
+}
+
+
</ins><span class="cx"> } // namespace WTR
</span></span></pre>
</div>
</div>

</body>
</html>