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

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

<h3>Log Message</h3>
<pre>Source/WebCore: Sideways 'wobble' when scrolling with trackpad on Mavericks
https://bugs.webkit.org/show_bug.cgi?id=127521
-and corresponding-
&lt;rdar://problem/14137306&gt;

Reviewed by Simon Fraser.

This patch takes http://trac.webkit.org/changeset/154535 which introduced 
filtering wheel events for overflow areas to try to make them less sensitive to X 
deltas when scrolling in a primarily Y direction, and it factors that code out 
into its own class, now called WheelEventDeltaTracker. So now this new class can 
use the same code to filter events for WebKit2’s EventDispatcher.

Files for WheelEventDeltaTracker.
* CMakeLists.txt:
* GNUmakefile.list.am:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:

WK2 needs these new WheelEventDeltaTracker functions.
* WebCore.exp.in:

Move a bunch of code over to WheelEventDeltaTracker and use
m_recentWheelEventTracker to serve the same purpose.
* page/EventHandler.cpp:
(WebCore::EventHandler::EventHandler):
(WebCore::EventHandler::handleWheelEvent):
(WebCore::EventHandler::defaultWheelEventHandler):
* page/EventHandler.h:

Allow horizontal rubber banding now that we have some event filtering in place.
* page/FrameView.cpp:
(WebCore::FrameView::FrameView):

New files. Most of this code was from EventHandler.
* page/WheelEventDeltaTracker.cpp: Added.
(WebCore::WheelEventDeltaTracker::WheelEventDeltaTracker):
(WebCore::WheelEventDeltaTracker::~WheelEventDeltaTracker):
(WebCore::WheelEventDeltaTracker::beginTrackingDeltas):
(WebCore::WheelEventDeltaTracker::endTrackingDeltas):
(WebCore::WheelEventDeltaTracker::recordWheelEventDelta):
(WebCore::deltaIsPredominantlyVertical):
(WebCore::WheelEventDeltaTracker::dominantScrollGestureDirection):
* page/WheelEventDeltaTracker.h: Added.
(WebCore::WheelEventDeltaTracker::isTrackingDeltas):

New function to clone events while zero-ing out certain deltas.
* platform/PlatformWheelEvent.h:
(WebCore::PlatformWheelEvent::copyIgnoringHorizontalDelta):
(WebCore::PlatformWheelEvent::copyIgnoringVerticalDelta):

Source/WebKit2: Sideways 'wobble' when scrolling with trackpad on Mavericks
https://bugs.webkit.org/show_bug.cgi?id=127521
-and corresponding-
&lt;rdar://problem/14137306&gt;

Reviewed by Simon Fraser.

Start using WebCore::WheelEventDeltaTracker to filter events.
* WebProcess/WebPage/EventDispatcher.cpp:
(WebKit::EventDispatcher::EventDispatcher):
(WebKit::EventDispatcher::wheelEvent):
* WebProcess/WebPage/EventDispatcher.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</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="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorepageEventHandlercpp">trunk/Source/WebCore/page/EventHandler.cpp</a></li>
<li><a href="#trunkSourceWebCorepageEventHandlerh">trunk/Source/WebCore/page/EventHandler.h</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewcpp">trunk/Source/WebCore/page/FrameView.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformPlatformWheelEventh">trunk/Source/WebCore/platform/PlatformWheelEvent.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageEventDispatchercpp">trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageEventDispatcherh">trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorepageWheelEventDeltaTrackercpp">trunk/Source/WebCore/page/WheelEventDeltaTracker.cpp</a></li>
<li><a href="#trunkSourceWebCorepageWheelEventDeltaTrackerh">trunk/Source/WebCore/page/WheelEventDeltaTracker.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (163179 => 163180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2014-01-31 18:59:59 UTC (rev 163179)
+++ trunk/Source/WebCore/CMakeLists.txt        2014-01-31 19:04:21 UTC (rev 163180)
</span><span class="lines">@@ -1769,6 +1769,7 @@
</span><span class="cx">     page/UserContentController.cpp
</span><span class="cx">     page/UserContentURLPattern.cpp
</span><span class="cx">     page/VisitedLinkProvider.cpp
</span><ins>+    page/WheelEventDeltaTracker.cpp
</ins><span class="cx">     page/WindowFeatures.cpp
</span><span class="cx">     page/WindowFocusAllowedIndicator.cpp
</span><span class="cx">     page/WorkerNavigator.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (163179 => 163180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-01-31 18:59:59 UTC (rev 163179)
+++ trunk/Source/WebCore/ChangeLog        2014-01-31 19:04:21 UTC (rev 163180)
</span><span class="lines">@@ -1,3 +1,57 @@
</span><ins>+2014-01-31  Beth Dakin  &lt;bdakin@apple.com&gt;
+
+        Sideways 'wobble' when scrolling with trackpad on Mavericks
+        https://bugs.webkit.org/show_bug.cgi?id=127521
+        -and corresponding-
+        &lt;rdar://problem/14137306&gt;
+
+        Reviewed by Simon Fraser.
+
+        This patch takes http://trac.webkit.org/changeset/154535 which introduced 
+        filtering wheel events for overflow areas to try to make them less sensitive to X 
+        deltas when scrolling in a primarily Y direction, and it factors that code out 
+        into its own class, now called WheelEventDeltaTracker. So now this new class can 
+        use the same code to filter events for WebKit2’s EventDispatcher.
+
+        Files for WheelEventDeltaTracker.
+        * CMakeLists.txt:
+        * GNUmakefile.list.am:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * WebCore.xcodeproj/project.pbxproj:
+
+        WK2 needs these new WheelEventDeltaTracker functions.
+        * WebCore.exp.in:
+
+        Move a bunch of code over to WheelEventDeltaTracker and use
+        m_recentWheelEventTracker to serve the same purpose.
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::EventHandler):
+        (WebCore::EventHandler::handleWheelEvent):
+        (WebCore::EventHandler::defaultWheelEventHandler):
+        * page/EventHandler.h:
+
+        Allow horizontal rubber banding now that we have some event filtering in place.
+        * page/FrameView.cpp:
+        (WebCore::FrameView::FrameView):
+
+        New files. Most of this code was from EventHandler.
+        * page/WheelEventDeltaTracker.cpp: Added.
+        (WebCore::WheelEventDeltaTracker::WheelEventDeltaTracker):
+        (WebCore::WheelEventDeltaTracker::~WheelEventDeltaTracker):
+        (WebCore::WheelEventDeltaTracker::beginTrackingDeltas):
+        (WebCore::WheelEventDeltaTracker::endTrackingDeltas):
+        (WebCore::WheelEventDeltaTracker::recordWheelEventDelta):
+        (WebCore::deltaIsPredominantlyVertical):
+        (WebCore::WheelEventDeltaTracker::dominantScrollGestureDirection):
+        * page/WheelEventDeltaTracker.h: Added.
+        (WebCore::WheelEventDeltaTracker::isTrackingDeltas):
+
+        New function to clone events while zero-ing out certain deltas.
+        * platform/PlatformWheelEvent.h:
+        (WebCore::PlatformWheelEvent::copyIgnoringHorizontalDelta):
+        (WebCore::PlatformWheelEvent::copyIgnoringVerticalDelta):
+
</ins><span class="cx"> 2014-01-31  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Don't do logging from Range::collectSelectionRects() on iOS
</span></span></pre></div>
<a id="trunkSourceWebCoreGNUmakefilelistam"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/GNUmakefile.list.am (163179 => 163180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/GNUmakefile.list.am        2014-01-31 18:59:59 UTC (rev 163179)
+++ trunk/Source/WebCore/GNUmakefile.list.am        2014-01-31 19:04:21 UTC (rev 163180)
</span><span class="lines">@@ -4224,6 +4224,8 @@
</span><span class="cx">         Source/WebCore/page/VisitedLinkProvider.h \
</span><span class="cx">         Source/WebCore/page/WebCoreKeyboardUIMode.h \
</span><span class="cx">         Source/WebCore/page/WebKitPoint.h \
</span><ins>+        Source/WebCore/page/WheelEventDeltaTracker.cpp \
+        Source/WebCore/page/WheelEventDeltaTracker.h \
</ins><span class="cx">         Source/WebCore/page/WindowFeatures.cpp \
</span><span class="cx">         Source/WebCore/page/WindowFeatures.h \
</span><span class="cx">         Source/WebCore/page/WindowFocusAllowedIndicator.cpp \
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (163179 => 163180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-01-31 18:59:59 UTC (rev 163179)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-01-31 19:04:21 UTC (rev 163180)
</span><span class="lines">@@ -867,6 +867,10 @@
</span><span class="cx"> __ZN7WebCore22externalRepresentationEPNS_7ElementEj
</span><span class="cx"> __ZN7WebCore22systemMarketingVersionEv
</span><span class="cx"> __ZN7WebCore22userPreferredLanguagesEv
</span><ins>+__ZN7WebCore22WheelEventDeltaTracker17endTrackingDeltasEv
+__ZN7WebCore22WheelEventDeltaTracker19beginTrackingDeltasEv
+__ZN7WebCore22WheelEventDeltaTracker21recordWheelEventDeltaERKNS_18PlatformWheelEventE
+__ZN7WebCore22WheelEventDeltaTrackerC1Ev
</ins><span class="cx"> __ZN7WebCore23ApplicationCacheStorage14setMaximumSizeEx
</span><span class="cx"> __ZN7WebCore23ApplicationCacheStorage16deleteAllEntriesEv
</span><span class="cx"> __ZN7WebCore23ApplicationCacheStorage16storeCopyOfCacheERKN3WTF6StringEPNS_20ApplicationCacheHostE
</span><span class="lines">@@ -1659,6 +1663,7 @@
</span><span class="cx"> __ZNK7WebCore21RenderLayerCompositor11scrollLayerEv
</span><span class="cx"> __ZNK7WebCore21RenderLayerCompositor15rootRenderLayerEv
</span><span class="cx"> __ZNK7WebCore21UserContentURLPattern7matchesERKNS_3URLE
</span><ins>+__ZNK7WebCore22WheelEventDeltaTracker30dominantScrollGestureDirectionEv
</ins><span class="cx"> __ZNK7WebCore23ApplicationCacheStorage11maximumSizeEv
</span><span class="cx"> __ZNK7WebCore23AuthenticationChallenge20authenticationClientEv
</span><span class="cx"> __ZNK7WebCore23FrameLoaderStateMachine15firstLayoutDoneEv
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (163179 => 163180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-01-31 18:59:59 UTC (rev 163179)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-01-31 19:04:21 UTC (rev 163180)
</span><span class="lines">@@ -7067,6 +7067,7 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\page\UserContentURLPattern.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\page\VisitedLinkProvider.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\fileapi\WebKitBlobBuilder.cpp&quot; /&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\page\WheelEventDeltaTracker.cpp&quot; /&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\page\WindowFeatures.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\page\WindowFocusAllowedIndicator.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\page\WorkerNavigator.cpp&quot; /&gt;
</span><span class="lines">@@ -18847,6 +18848,7 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\page\VisitedLinkProvider.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\fileapi\WebKitBlobBuilder.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\page\WebKitPoint.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\page\WheelEventDeltaTracker.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\page\WindowFeatures.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\page\WindowFocusAllowedIndicator.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\page\WorkerNavigator.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (163179 => 163180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-01-31 18:59:59 UTC (rev 163179)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-01-31 19:04:21 UTC (rev 163180)
</span><span class="lines">@@ -798,6 +798,9 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\fileapi\WebKitBlobBuilder.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;page&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\page\WheelEventDeltaTracker.cpp&quot;&gt;
+      &lt;Filter&gt;page&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\page\WindowFeatures.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;page&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="lines">@@ -7661,6 +7664,9 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\page\WebKitPoint.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;page&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\page\WheelEventDeltaTracker.h&quot;&gt;
+      &lt;Filter&gt;page&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\page\WindowFeatures.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;page&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (163179 => 163180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-01-31 18:59:59 UTC (rev 163179)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-01-31 19:04:21 UTC (rev 163180)
</span><span class="lines">@@ -3202,6 +3202,8 @@
</span><span class="cx">                 93EB169509F880B00091F8FF /* WebCoreSystemInterface.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93EB169409F880B00091F8FF /* WebCoreSystemInterface.mm */; };
</span><span class="cx">                 93EB169709F880C00091F8FF /* WebCoreSystemInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 93EB169609F880C00091F8FF /* WebCoreSystemInterface.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 93EB355F09E37FD600F43799 /* MouseEventWithHitTestResults.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93EB355E09E37FD600F43799 /* MouseEventWithHitTestResults.cpp */; };
</span><ins>+                93EC44A1188F4BB800661DF1 /* WheelEventDeltaTracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93EC449F188F4BB800661DF1 /* WheelEventDeltaTracker.cpp */; };
+                93EC44A2188F4BB800661DF1 /* WheelEventDeltaTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 93EC44A0188F4BB800661DF1 /* WheelEventDeltaTracker.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 93F198E508245E59001E9ABC /* HTMLDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D23C02DE4396018635CA /* HTMLDocument.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 93F198E608245E59001E9ABC /* HTMLElement.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D23F02DE4396018635CA /* HTMLElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 93F198F608245E59001E9ABC /* TextResourceDecoder.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D27902DE43D7018635CA /* TextResourceDecoder.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -10142,6 +10144,8 @@
</span><span class="cx">                 93EB169409F880B00091F8FF /* WebCoreSystemInterface.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreSystemInterface.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 93EB169609F880C00091F8FF /* WebCoreSystemInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreSystemInterface.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 93EB355E09E37FD600F43799 /* MouseEventWithHitTestResults.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MouseEventWithHitTestResults.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                93EC449F188F4BB800661DF1 /* WheelEventDeltaTracker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WheelEventDeltaTracker.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                93EC44A0188F4BB800661DF1 /* WheelEventDeltaTracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WheelEventDeltaTracker.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 93EEC1E509C2877700C515D1 /* Attr.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Attr.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 93EEC1E609C2877700C515D1 /* CharacterData.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CharacterData.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 93EEC1E809C2877700C515D1 /* DocumentType.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DocumentType.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -16207,6 +16211,8 @@
</span><span class="cx">                                 BE983D95052A2E0A00892D85 /* WebCoreKeyboardUIMode.h */,
</span><span class="cx">                                 494BD7930F55C8EE00747828 /* WebKitPoint.h */,
</span><span class="cx">                                 494BD7940F55C8EE00747828 /* WebKitPoint.idl */,
</span><ins>+                                93EC449F188F4BB800661DF1 /* WheelEventDeltaTracker.cpp */,
+                                93EC44A0188F4BB800661DF1 /* WheelEventDeltaTracker.h */,
</ins><span class="cx">                                 BC8243E60D0CFD7500460C8F /* WindowFeatures.cpp */,
</span><span class="cx">                                 BC8243E70D0CFD7500460C8F /* WindowFeatures.h */,
</span><span class="cx">                                 7E99AF520B13846468FB01A5 /* WindowFocusAllowedIndicator.cpp */,
</span><span class="lines">@@ -23709,6 +23715,7 @@
</span><span class="cx">                                 77A17A7B12F2890B004E02F6 /* GraphicsTypes3D.h in Headers */,
</span><span class="cx">                                 A12705C31656BD6500C2E27C /* GridPosition.h in Headers */,
</span><span class="cx">                                 A12A1050166444FD008FA311 /* GridTrackSize.h in Headers */,
</span><ins>+                                93EC44A2188F4BB800661DF1 /* WheelEventDeltaTracker.h in Headers */,
</ins><span class="cx">                                 C50B561712119D23008B46E0 /* GroupSettings.h in Headers */,
</span><span class="cx">                                 E1FF8F65180745D800132674 /* JSSubtleCrypto.h in Headers */,
</span><span class="cx">                                 078E094017D16E1C00420AA1 /* RTCIceCandidateDescriptor.h in Headers */,
</span><span class="lines">@@ -27187,6 +27194,7 @@
</span><span class="cx">                                 A871DB2D0A150BD600B12A68 /* HTMLTablePartElement.cpp in Sources */,
</span><span class="cx">                                 A871DB300A150BD600B12A68 /* HTMLTableRowElement.cpp in Sources */,
</span><span class="cx">                                 93442CA00D2B336000338FF9 /* HTMLTableRowsCollection.cpp in Sources */,
</span><ins>+                                93EC44A1188F4BB800661DF1 /* WheelEventDeltaTracker.cpp in Sources */,
</ins><span class="cx">                                 A871DB260A150BD600B12A68 /* HTMLTableSectionElement.cpp in Sources */,
</span><span class="cx">                                 E19AC3F01824DC7900349426 /* CryptoAlgorithmSHA256.cpp in Sources */,
</span><span class="cx">                                 511EF2CB17F0FD3500E4FA16 /* JSIDBVersionChangeEvent.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorepageEventHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/EventHandler.cpp (163179 => 163180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/EventHandler.cpp        2014-01-31 18:59:59 UTC (rev 163179)
+++ trunk/Source/WebCore/page/EventHandler.cpp        2014-01-31 19:04:21 UTC (rev 163180)
</span><span class="lines">@@ -355,7 +355,7 @@
</span><span class="cx"> #endif
</span><span class="cx">     , m_mousePositionIsUnknown(true)
</span><span class="cx">     , m_mouseDownTimestamp(0)
</span><del>-    , m_inTrackingScrollGesturePhase(false)
</del><ins>+    , m_recentWheelEventDeltaTracker(adoptPtr(new WheelEventDeltaTracker))
</ins><span class="cx">     , m_widgetIsLatched(false)
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">     , m_mouseDownView(nil)
</span><span class="lines">@@ -2467,41 +2467,6 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-void EventHandler::recordWheelEventDelta(const PlatformWheelEvent&amp; event)
-{
-    const size_t recentEventCount = 3;
-    
-    m_recentWheelEventDeltas.append(FloatSize(event.deltaX(), event.deltaY()));
-    if (m_recentWheelEventDeltas.size() &gt; recentEventCount)
-        m_recentWheelEventDeltas.removeFirst();
-}
-
-static bool deltaIsPredominantlyVertical(const FloatSize&amp; delta)
-{
-    return fabs(delta.height()) &gt; fabs(delta.width());
-}
-
-EventHandler::DominantScrollGestureDirection EventHandler::dominantScrollGestureDirection() const
-{
-    bool allVertical = m_recentWheelEventDeltas.size();
-    bool allHorizontal = m_recentWheelEventDeltas.size();
-
-    Deque&lt;FloatSize&gt;::const_iterator end = m_recentWheelEventDeltas.end();
-    for (Deque&lt;FloatSize&gt;::const_iterator it = m_recentWheelEventDeltas.begin(); it != end; ++it) {
-        bool isVertical = deltaIsPredominantlyVertical(*it);
-        allVertical &amp;= isVertical;
-        allHorizontal &amp;= !isVertical;
-    }
-    
-    if (allVertical)
-        return DominantScrollDirectionVertical;
-
-    if (allHorizontal)
-        return DominantScrollDirectionHorizontal;
-    
-    return DominantScrollDirectionNone;
-}
-
</del><span class="cx"> bool EventHandler::handleWheelEvent(const PlatformWheelEvent&amp; e)
</span><span class="cx"> {
</span><span class="cx">     Document* document = m_frame.document();
</span><span class="lines">@@ -2555,18 +2520,17 @@
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">     switch (event.phase()) {
</span><span class="cx">     case PlatformWheelEventPhaseBegan:
</span><del>-        m_recentWheelEventDeltas.clear();
-        m_inTrackingScrollGesturePhase = true;
</del><ins>+        m_recentWheelEventDeltaTracker-&gt;beginTrackingDeltas();
</ins><span class="cx">         break;
</span><span class="cx">     case PlatformWheelEventPhaseEnded:
</span><del>-        m_inTrackingScrollGesturePhase = false;
</del><ins>+        m_recentWheelEventDeltaTracker-&gt;endTrackingDeltas();
</ins><span class="cx">         break;
</span><span class="cx">     default:
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    recordWheelEventDelta(event);
</del><ins>+    m_recentWheelEventDeltaTracker-&gt;recordWheelEventDelta(event);
</ins><span class="cx"> 
</span><span class="cx">     if (element) {
</span><span class="cx">         // Figure out which view to send the event to.
</span><span class="lines">@@ -2601,18 +2565,20 @@
</span><span class="cx">     
</span><span class="cx">     Element* stopElement = m_previousWheelScrolledElement.get();
</span><span class="cx">     ScrollGranularity granularity = wheelGranularityToScrollGranularity(wheelEvent-&gt;deltaMode());
</span><ins>+    DominantScrollGestureDirection dominantDirection = DominantScrollGestureDirection::None;
+
+    // Workaround for scrolling issues &lt;rdar://problem/14758615&gt;.
+#if PLATFORM(MAC)
+    if (m_recentWheelEventDeltaTracker-&gt;isTrackingDeltas())
+        dominantDirection = m_recentWheelEventDeltaTracker-&gt;dominantScrollGestureDirection();
+#endif
</ins><span class="cx">     
</span><del>-    DominantScrollGestureDirection dominantDirection = DominantScrollDirectionNone;
-    // Workaround for scrolling issues in iTunes (&lt;rdar://problem/14758615&gt;).
-    if (m_inTrackingScrollGesturePhase &amp;&amp; applicationIsITunes())
-        dominantDirection = dominantScrollGestureDirection();
-    
</del><span class="cx">     // Break up into two scrolls if we need to.  Diagonal movement on 
</span><span class="cx">     // a MacBook pro is an example of a 2-dimensional mouse wheel event (where both deltaX and deltaY can be set).
</span><del>-    if (dominantDirection != DominantScrollDirectionVertical &amp;&amp; scrollNode(wheelEvent-&gt;deltaX(), granularity, ScrollRight, ScrollLeft, startNode, &amp;stopElement, roundedIntPoint(wheelEvent-&gt;absoluteLocation())))
</del><ins>+    if (dominantDirection != DominantScrollGestureDirection::Vertical &amp;&amp; scrollNode(wheelEvent-&gt;deltaX(), granularity, ScrollRight, ScrollLeft, startNode, &amp;stopElement, roundedIntPoint(wheelEvent-&gt;absoluteLocation())))
</ins><span class="cx">         wheelEvent-&gt;setDefaultHandled();
</span><span class="cx">     
</span><del>-    if (dominantDirection != DominantScrollDirectionHorizontal &amp;&amp; scrollNode(wheelEvent-&gt;deltaY(), granularity, ScrollDown, ScrollUp, startNode, &amp;stopElement, roundedIntPoint(wheelEvent-&gt;absoluteLocation())))
</del><ins>+    if (dominantDirection != DominantScrollGestureDirection::Horizontal &amp;&amp; scrollNode(wheelEvent-&gt;deltaY(), granularity, ScrollDown, ScrollUp, startNode, &amp;stopElement, roundedIntPoint(wheelEvent-&gt;absoluteLocation())))
</ins><span class="cx">         wheelEvent-&gt;setDefaultHandled();
</span><span class="cx">     
</span><span class="cx">     if (!m_latchedWheelEventElement)
</span></span></pre></div>
<a id="trunkSourceWebCorepageEventHandlerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/EventHandler.h (163179 => 163180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/EventHandler.h        2014-01-31 18:59:59 UTC (rev 163179)
+++ trunk/Source/WebCore/page/EventHandler.h        2014-01-31 19:04:21 UTC (rev 163180)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx"> #include &quot;TextEventInputType.h&quot;
</span><span class="cx"> #include &quot;TextGranularity.h&quot;
</span><span class="cx"> #include &quot;Timer.h&quot;
</span><del>-#include &lt;wtf/Deque.h&gt;
</del><ins>+#include &quot;WheelEventDeltaTracker.h&quot;
</ins><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> #include &lt;wtf/OwnPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/RefPtr.h&gt;
</span><span class="lines">@@ -329,13 +329,6 @@
</span><span class="cx">     bool logicalScrollOverflow(ScrollLogicalDirection, ScrollGranularity, Node* startingNode = 0);
</span><span class="cx">     
</span><span class="cx">     bool shouldTurnVerticalTicksIntoHorizontal(const HitTestResult&amp;, const PlatformWheelEvent&amp;) const;
</span><del>-    void recordWheelEventDelta(const PlatformWheelEvent&amp;);
-    enum DominantScrollGestureDirection {
-        DominantScrollDirectionNone,
-        DominantScrollDirectionVertical,
-        DominantScrollDirectionHorizontal
-    };
-    DominantScrollGestureDirection dominantScrollGestureDirection() const;
</del><span class="cx">     
</span><span class="cx">     bool mouseDownMayStartSelect() const { return m_mouseDownMayStartSelect; }
</span><span class="cx"> 
</span><span class="lines">@@ -521,9 +514,8 @@
</span><span class="cx">     double m_mouseDownTimestamp;
</span><span class="cx">     PlatformMouseEvent m_mouseDown;
</span><span class="cx"> 
</span><del>-    Deque&lt;FloatSize&gt; m_recentWheelEventDeltas;
</del><ins>+    OwnPtr&lt;WheelEventDeltaTracker&gt; m_recentWheelEventDeltaTracker;
</ins><span class="cx">     RefPtr&lt;Element&gt; m_latchedWheelEventElement;
</span><del>-    bool m_inTrackingScrollGesturePhase;
</del><span class="cx">     bool m_widgetIsLatched;
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;Element&gt; m_previousWheelScrolledElement;
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.cpp (163179 => 163180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp        2014-01-31 18:59:59 UTC (rev 163179)
+++ trunk/Source/WebCore/page/FrameView.cpp        2014-01-31 19:04:21 UTC (rev 163180)
</span><span class="lines">@@ -197,7 +197,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (frame.isMainFrame()) {
</span><span class="cx">         ScrollableArea::setVerticalScrollElasticity(ScrollElasticityAllowed);
</span><del>-        ScrollableArea::setHorizontalScrollElasticity(ScrollElasticityAutomatic);
</del><ins>+        ScrollableArea::setHorizontalScrollElasticity(ScrollElasticityAllowed);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageWheelEventDeltaTrackercpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/page/WheelEventDeltaTracker.cpp (0 => 163180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/WheelEventDeltaTracker.cpp                                (rev 0)
+++ trunk/Source/WebCore/page/WheelEventDeltaTracker.cpp        2014-01-31 19:04:21 UTC (rev 163180)
</span><span class="lines">@@ -0,0 +1,87 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+
+#include &quot;WheelEventDeltaTracker.h&quot;
+
+#include &quot;PlatformWheelEvent.h&quot;
+
+namespace WebCore {
+
+WheelEventDeltaTracker::WheelEventDeltaTracker()
+    : m_isTrackingDeltas(false)
+{
+}
+
+WheelEventDeltaTracker::~WheelEventDeltaTracker()
+{
+}
+
+void WheelEventDeltaTracker::beginTrackingDeltas()
+{
+    m_recentWheelEventDeltas.clear();
+    m_isTrackingDeltas = true;
+}
+
+void WheelEventDeltaTracker::endTrackingDeltas()
+{
+    m_isTrackingDeltas = false;
+}
+
+void WheelEventDeltaTracker::recordWheelEventDelta(const PlatformWheelEvent&amp; event)
+{
+    m_recentWheelEventDeltas.append(FloatSize(event.deltaX(), event.deltaY()));
+    if (m_recentWheelEventDeltas.size() &gt; recentEventCount)
+        m_recentWheelEventDeltas.removeFirst();
+}
+
+static bool deltaIsPredominantlyVertical(const FloatSize&amp; delta)
+{
+    return fabs(delta.height()) &gt; fabs(delta.width());
+}
+
+DominantScrollGestureDirection WheelEventDeltaTracker::dominantScrollGestureDirection() const
+{
+    bool allVertical = m_recentWheelEventDeltas.size();
+    bool allHorizontal = m_recentWheelEventDeltas.size();
+
+    auto end = m_recentWheelEventDeltas.end();
+    for (auto it = m_recentWheelEventDeltas.begin(); it != end; ++it) {
+        bool isVertical = deltaIsPredominantlyVertical(*it);
+        allVertical &amp;= isVertical;
+        allHorizontal &amp;= !isVertical;
+    }
+    
+    if (allVertical)
+        return DominantScrollGestureDirection::Vertical;
+
+    if (allHorizontal)
+        return DominantScrollGestureDirection::Horizontal;
+    
+    return DominantScrollGestureDirection::None;
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorepageWheelEventDeltaTrackerh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/page/WheelEventDeltaTracker.h (0 => 163180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/WheelEventDeltaTracker.h                                (rev 0)
+++ trunk/Source/WebCore/page/WheelEventDeltaTracker.h        2014-01-31 19:04:21 UTC (rev 163180)
</span><span class="lines">@@ -0,0 +1,66 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+#ifndef WheelEventDeltaTracker_h
+#define WheelEventDeltaTracker_h
+
+#include &quot;FloatSize.h&quot;
+#include &lt;wtf/Deque.h&gt;
+
+namespace WebCore {
+
+class PlatformWheelEvent;
+
+const size_t recentEventCount = 3;
+
+enum class DominantScrollGestureDirection {
+    None,
+    Vertical,
+    Horizontal
+};
+
+class WheelEventDeltaTracker {
+public:
+    WheelEventDeltaTracker();
+    virtual ~WheelEventDeltaTracker();
+
+    void beginTrackingDeltas();
+    void endTrackingDeltas();
+
+    bool isTrackingDeltas() const { return m_isTrackingDeltas; }
+
+    void recordWheelEventDelta(const PlatformWheelEvent&amp;);
+    DominantScrollGestureDirection dominantScrollGestureDirection() const;
+
+private:
+    Deque&lt;FloatSize, recentEventCount&gt; m_recentWheelEventDeltas;
+    bool m_isTrackingDeltas;
+
+};
+
+} // namespace WebCore
+
+#endif // WheelEventDeltaTracker_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformPlatformWheelEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/PlatformWheelEvent.h (163179 => 163180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/PlatformWheelEvent.h        2014-01-31 18:59:59 UTC (rev 163179)
+++ trunk/Source/WebCore/platform/PlatformWheelEvent.h        2014-01-31 19:04:21 UTC (rev 163180)
</span><span class="lines">@@ -119,6 +119,20 @@
</span><span class="cx">             return copy;
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        PlatformWheelEvent copyIgnoringHorizontalDelta() const
+        {
+            PlatformWheelEvent copy = *this;
+            copy.m_deltaX = 0;
+            return copy;
+        }
+
+        PlatformWheelEvent copyIgnoringVerticalDelta() const
+        {
+            PlatformWheelEvent copy = *this;
+            copy.m_deltaY = 0;
+            return copy;
+        }
+
</ins><span class="cx">         const IntPoint&amp; position() const { return m_position; } // PlatformWindow coordinates.
</span><span class="cx">         const IntPoint&amp; globalPosition() const { return m_globalPosition; } // Screen coordinates.
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (163179 => 163180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-01-31 18:59:59 UTC (rev 163179)
+++ trunk/Source/WebKit2/ChangeLog        2014-01-31 19:04:21 UTC (rev 163180)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2014-01-31  Beth Dakin  &lt;bdakin@apple.com&gt;
+
+        Sideways 'wobble' when scrolling with trackpad on Mavericks
+        https://bugs.webkit.org/show_bug.cgi?id=127521
+        -and corresponding-
+        &lt;rdar://problem/14137306&gt;
+
+        Reviewed by Simon Fraser.
+
+        Start using WebCore::WheelEventDeltaTracker to filter events.
+        * WebProcess/WebPage/EventDispatcher.cpp:
+        (WebKit::EventDispatcher::EventDispatcher):
+        (WebKit::EventDispatcher::wheelEvent):
+        * WebProcess/WebPage/EventDispatcher.h:
+
</ins><span class="cx"> 2014-01-31  Zan Dobersek  &lt;zdobersek@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix the forward declaration of RawPluginMetaData in NetscapePluginModule.h
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageEventDispatchercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp (163179 => 163180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp        2014-01-31 18:59:59 UTC (rev 163179)
+++ trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp        2014-01-31 19:04:21 UTC (rev 163180)
</span><span class="lines">@@ -53,6 +53,7 @@
</span><span class="cx"> 
</span><span class="cx"> EventDispatcher::EventDispatcher()
</span><span class="cx">     : m_queue(WorkQueue::create(&quot;com.apple.WebKit.EventDispatcher&quot;))
</span><ins>+    , m_recentWheelEventDeltaTracker(adoptPtr(new WheelEventDeltaTracker))
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -88,11 +89,37 @@
</span><span class="cx"> 
</span><span class="cx"> void EventDispatcher::wheelEvent(uint64_t pageID, const WebWheelEvent&amp; wheelEvent, bool canRubberBandAtLeft, bool canRubberBandAtRight, bool canRubberBandAtTop, bool canRubberBandAtBottom)
</span><span class="cx"> {
</span><ins>+    PlatformWheelEvent platformWheelEvent = platform(wheelEvent);
+
+#if PLATFORM(MAC)
+    switch (wheelEvent.phase()) {
+    case PlatformWheelEventPhaseBegan:
+        m_recentWheelEventDeltaTracker-&gt;beginTrackingDeltas();
+        break;
+    case PlatformWheelEventPhaseEnded:
+        m_recentWheelEventDeltaTracker-&gt;endTrackingDeltas();
+        break;
+    default:
+        break;
+    }
+
+    if (m_recentWheelEventDeltaTracker-&gt;isTrackingDeltas()) {
+        m_recentWheelEventDeltaTracker-&gt;recordWheelEventDelta(platformWheelEvent);
+
+        DominantScrollGestureDirection dominantDirection = DominantScrollGestureDirection::None;
+        dominantDirection = m_recentWheelEventDeltaTracker-&gt;dominantScrollGestureDirection();
+
+        // Workaround for scrolling issues &lt;rdar://problem/14758615&gt;.
+        if (dominantDirection == DominantScrollGestureDirection::Vertical &amp;&amp; platformWheelEvent.deltaX())
+            platformWheelEvent = platformWheelEvent.copyIgnoringHorizontalDelta();
+        else if (dominantDirection == DominantScrollGestureDirection::Horizontal &amp;&amp; platformWheelEvent.deltaY())
+            platformWheelEvent = platformWheelEvent.copyIgnoringVerticalDelta();
+    }
+#endif
+
</ins><span class="cx"> #if ENABLE(ASYNC_SCROLLING)
</span><span class="cx">     MutexLocker locker(m_scrollingTreesMutex);
</span><span class="cx">     if (ThreadedScrollingTree* scrollingTree = m_scrollingTrees.get(pageID)) {
</span><del>-        PlatformWheelEvent platformWheelEvent = platform(wheelEvent);
-
</del><span class="cx">         // FIXME: It's pretty horrible that we're updating the back/forward state here.
</span><span class="cx">         // WebCore should always know the current state and know when it changes so the
</span><span class="cx">         // scrolling tree can be notified.
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageEventDispatcherh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.h (163179 => 163180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.h        2014-01-31 18:59:59 UTC (rev 163179)
+++ trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.h        2014-01-31 19:04:21 UTC (rev 163180)
</span><span class="lines">@@ -27,6 +27,8 @@
</span><span class="cx"> #define EventDispatcher_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Connection.h&quot;
</span><ins>+
+#include &lt;WebCore/WheelEventDeltaTracker.h&gt;
</ins><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><span class="cx"> #include &lt;wtf/Noncopyable.h&gt;
</span><span class="cx"> #include &lt;wtf/RefPtr.h&gt;
</span><span class="lines">@@ -76,6 +78,7 @@
</span><span class="cx">     Mutex m_scrollingTreesMutex;
</span><span class="cx">     HashMap&lt;uint64_t, RefPtr&lt;WebCore::ThreadedScrollingTree&gt;&gt; m_scrollingTrees;
</span><span class="cx"> #endif
</span><ins>+    OwnPtr&lt;WebCore::WheelEventDeltaTracker&gt; m_recentWheelEventDeltaTracker;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre>
</div>
</div>

</body>
</html>