<!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>[188860] 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/188860">188860</a></dd>
<dt>Author</dt> <dd>wenson_hsieh@apple.com</dd>
<dt>Date</dt> <dd>2015-08-24 08:23:21 -0700 (Mon, 24 Aug 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Use _NSScrollingPredominantAxisFilter for wheel event filtering on Mac
https://bugs.webkit.org/show_bug.cgi?id=147320

Reviewed by Simon Fraser.

Refactored to use a predominant axis filter instead of a predominant axis tracker. This allows us to
employ AppKit's _NSScrollingPredominantAxisFilter when possible, and use the wheel event delta tracker
Source/WebCore:

as a fallback. Here, we refactor EventHandler to use the new filters for overflow scrolling and replace
the MainFrame's WheelEventDeltaTracker with an appropriate type of WheelEventDeltaFilter.

In the case where an _NSScrollingPredominantAxisFilter is unavailable, the platform-invariant wheel
event delta filter simply uses the existing wheel event delta tracker to compute the current predominant
axis. It uses the predominant axis to determine which axis (if any) should have its delta zeroed out.

This patch also introduces NSScrollingInputFilterSPI.h, which either imports the internal input filter
header from AppKit or declares relevant interfaces and functions.

No new tests, since this change does not add new functionality.

* CMakeLists.txt: Add page/WheelEventDeltaFilter.cpp.
* WebCore.vcxproj/WebCore.vcxproj: Add WheelEventDeltaFilter.cpp and WheelEventDeltaFilter.h.
* WebCore.vcxproj/WebCore.vcxproj.filters: Add WheelEventDeltaFilter.cpp and WheelEventDeltaFilter.h.
* WebCore.xcodeproj/project.pbxproj: Add WheelEventDeltaFilter.cpp, WheelEventDeltaFilter.h, and their Mac counterparts.
* page/EventHandler.cpp:
(WebCore::didScrollInScrollableArea): Refactored to no longer handle axes separately.
(WebCore::handleWheelEventInAppropriateEnclosingBox): Ditto.
(WebCore::EventHandler::platformRecordWheelEvent): Refactored to update the wheel delta filter.
(WebCore::EventHandler::clearLatchedState): Ditto.
(WebCore::EventHandler::defaultWheelEventHandler): Refactored to use wheel delta filters. No longer splits wheel events
        and handles them on separate axes.
(WebCore::didScrollInScrollableAreaForSingleAxis): Deleted.
(WebCore::handleWheelEventInAppropriateEnclosingBoxForSingleAxis): Deleted.
* page/EventHandler.h:
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame): Initializes the appropriate type of WheelEventDeltaFilter.
* page/MainFrame.h:
* page/WheelEventDeltaFilter.cpp: Added.
(WebCore::WheelEventDeltaFilter::WheelEventDeltaFilter):
(WebCore::WheelEventDeltaFilter::~WheelEventDeltaFilter):
(WebCore::WheelEventDeltaFilter::create):
(WebCore::BasicWheelEventDeltaFilter::BasicWheelEventDeltaFilter):
(WebCore::BasicWheelEventDeltaFilter::updateFromDelta):
(WebCore::BasicWheelEventDeltaFilter::beginFilteringDeltas):
(WebCore::BasicWheelEventDeltaFilter::endFilteringDeltas):
(WebCore::deltaIsPredominantlyVertical):
(WebCore::BasicWheelEventDeltaFilter::dominantScrollGestureDirection):
* page/WheelEventDeltaFilter.h: Refactored WheelEventDeltaTracker logic to work as a filter instead.
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::platformPrepareForWheelEvents): Refactored to use wheel delta filters.
(WebCore::EventHandler::platformRecordWheelEvent): Ditto.
* page/mac/WheelEventDeltaFilterMac.h: Wraps the new _NSScrollingPredominantAxisFilter.
* page/mac/WheelEventDeltaFilterMac.mm: Added.
(WebCore::WheelEventDeltaFilterMac::WheelEventDeltaFilterMac):
(WebCore::WheelEventDeltaFilterMac::beginFilteringDeltas):
(WebCore::WheelEventDeltaFilterMac::updateFromDelta):
(WebCore::WheelEventDeltaFilterMac::endFilteringDeltas):
* platform/PlatformWheelEvent.h:
(WebCore::PlatformWheelEvent::copyWithDeltas): Used to create a copy of the platform wheel event with filtered deltas.
(WebCore::PlatformWheelEvent::copyIgnoringHorizontalDelta): Deleted. No longer necessary, since we won't be handling wheel
        events on separate axes.
(WebCore::PlatformWheelEvent::copyIgnoringVerticalDelta): Ditto.
* platform/spi/mac/NSScrollingInputFilterSPI.h: Added.

Source/WebKit2:

as a fallback. Here, we refactor EventDispatcher to use the new filters for mainframe scrolling.

No new tests, since this change does not add new functionality.

* WebProcess/WebPage/EventDispatcher.cpp: Include WheelEventDeltaFilterMac.h when necessary.
(WebKit::EventDispatcher::EventDispatcher): Initialize a WheelEventDeltaFilterMac when possible. Otherwise,
    fall back to a BasicWheelEventDeltaFilter.
(WebKit::EventDispatcher::wheelEvent): Use filtered deltas to initialize the platform wheel event instead
    of zeroing out non-predominant axes.
* WebProcess/WebPage/EventDispatcher.h: Replace m_recentWheelEventDeltaTracker with m_recentWheelEventDeltaFilter.</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="#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="#trunkSourceWebCorepageMainFramecpp">trunk/Source/WebCore/page/MainFrame.cpp</a></li>
<li><a href="#trunkSourceWebCorepageMainFrameh">trunk/Source/WebCore/page/MainFrame.h</a></li>
<li><a href="#trunkSourceWebCorepagemacEventHandlerMacmm">trunk/Source/WebCore/page/mac/EventHandlerMac.mm</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="#trunkSourceWebCorepageWheelEventDeltaFiltercpp">trunk/Source/WebCore/page/WheelEventDeltaFilter.cpp</a></li>
<li><a href="#trunkSourceWebCorepageWheelEventDeltaFilterh">trunk/Source/WebCore/page/WheelEventDeltaFilter.h</a></li>
<li><a href="#trunkSourceWebCorepagemacWheelEventDeltaFilterMach">trunk/Source/WebCore/page/mac/WheelEventDeltaFilterMac.h</a></li>
<li><a href="#trunkSourceWebCorepagemacWheelEventDeltaFilterMacmm">trunk/Source/WebCore/page/mac/WheelEventDeltaFilterMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformspimacNSScrollingInputFilterSPIh">trunk/Source/WebCore/platform/spi/mac/NSScrollingInputFilterSPI.h</a></li>
</ul>

<h3>Removed 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 (188859 => 188860)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2015-08-24 13:39:11 UTC (rev 188859)
+++ trunk/Source/WebCore/CMakeLists.txt        2015-08-24 15:23:21 UTC (rev 188860)
</span><span class="lines">@@ -2003,7 +2003,7 @@
</span><span class="cx">     page/UserContentController.cpp
</span><span class="cx">     page/UserContentURLPattern.cpp
</span><span class="cx">     page/VisitedLinkStore.cpp
</span><del>-    page/WheelEventDeltaTracker.cpp
</del><ins>+    page/WheelEventDeltaFilter.cpp
</ins><span class="cx">     page/WheelEventTestTrigger.cpp
</span><span class="cx">     page/WindowFeatures.cpp
</span><span class="cx">     page/WindowFocusAllowedIndicator.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (188859 => 188860)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-08-24 13:39:11 UTC (rev 188859)
+++ trunk/Source/WebCore/ChangeLog        2015-08-24 15:23:21 UTC (rev 188860)
</span><span class="lines">@@ -1,3 +1,68 @@
</span><ins>+2015-08-24  Wenson Hsieh  &lt;wenson_hsieh@apple.com&gt;
+
+        Use _NSScrollingPredominantAxisFilter for wheel event filtering on Mac
+        https://bugs.webkit.org/show_bug.cgi?id=147320
+
+        Reviewed by Simon Fraser.
+
+        Refactored to use a predominant axis filter instead of a predominant axis tracker. This allows us to
+        employ AppKit's _NSScrollingPredominantAxisFilter when possible, and use the wheel event delta tracker
+        as a fallback. Here, we refactor EventHandler to use the new filters for overflow scrolling and replace
+        the MainFrame's WheelEventDeltaTracker with an appropriate type of WheelEventDeltaFilter.
+
+        In the case where an _NSScrollingPredominantAxisFilter is unavailable, the platform-invariant wheel
+        event delta filter simply uses the existing wheel event delta tracker to compute the current predominant
+        axis. It uses the predominant axis to determine which axis (if any) should have its delta zeroed out.
+
+        This patch also introduces NSScrollingInputFilterSPI.h, which either imports the internal input filter
+        header from AppKit or declares relevant interfaces and functions.
+
+        No new tests, since this change does not add new functionality.
+
+        * CMakeLists.txt: Add page/WheelEventDeltaFilter.cpp.
+        * WebCore.vcxproj/WebCore.vcxproj: Add WheelEventDeltaFilter.cpp and WheelEventDeltaFilter.h.
+        * WebCore.vcxproj/WebCore.vcxproj.filters: Add WheelEventDeltaFilter.cpp and WheelEventDeltaFilter.h.
+        * WebCore.xcodeproj/project.pbxproj: Add WheelEventDeltaFilter.cpp, WheelEventDeltaFilter.h, and their Mac counterparts.
+        * page/EventHandler.cpp:
+        (WebCore::didScrollInScrollableArea): Refactored to no longer handle axes separately.
+        (WebCore::handleWheelEventInAppropriateEnclosingBox): Ditto.
+        (WebCore::EventHandler::platformRecordWheelEvent): Refactored to update the wheel delta filter.
+        (WebCore::EventHandler::clearLatchedState): Ditto.
+        (WebCore::EventHandler::defaultWheelEventHandler): Refactored to use wheel delta filters. No longer splits wheel events
+                and handles them on separate axes.
+        (WebCore::didScrollInScrollableAreaForSingleAxis): Deleted.
+        (WebCore::handleWheelEventInAppropriateEnclosingBoxForSingleAxis): Deleted.
+        * page/EventHandler.h:
+        * page/MainFrame.cpp:
+        (WebCore::MainFrame::MainFrame): Initializes the appropriate type of WheelEventDeltaFilter.
+        * page/MainFrame.h:
+        * page/WheelEventDeltaFilter.cpp: Added.
+        (WebCore::WheelEventDeltaFilter::WheelEventDeltaFilter):
+        (WebCore::WheelEventDeltaFilter::~WheelEventDeltaFilter):
+        (WebCore::WheelEventDeltaFilter::create):
+        (WebCore::BasicWheelEventDeltaFilter::BasicWheelEventDeltaFilter):
+        (WebCore::BasicWheelEventDeltaFilter::updateFromDelta):
+        (WebCore::BasicWheelEventDeltaFilter::beginFilteringDeltas):
+        (WebCore::BasicWheelEventDeltaFilter::endFilteringDeltas):
+        (WebCore::deltaIsPredominantlyVertical):
+        (WebCore::BasicWheelEventDeltaFilter::dominantScrollGestureDirection):
+        * page/WheelEventDeltaFilter.h: Refactored WheelEventDeltaTracker logic to work as a filter instead.
+        * page/mac/EventHandlerMac.mm:
+        (WebCore::EventHandler::platformPrepareForWheelEvents): Refactored to use wheel delta filters.
+        (WebCore::EventHandler::platformRecordWheelEvent): Ditto.
+        * page/mac/WheelEventDeltaFilterMac.h: Wraps the new _NSScrollingPredominantAxisFilter.
+        * page/mac/WheelEventDeltaFilterMac.mm: Added.
+        (WebCore::WheelEventDeltaFilterMac::WheelEventDeltaFilterMac):
+        (WebCore::WheelEventDeltaFilterMac::beginFilteringDeltas):
+        (WebCore::WheelEventDeltaFilterMac::updateFromDelta):
+        (WebCore::WheelEventDeltaFilterMac::endFilteringDeltas):
+        * platform/PlatformWheelEvent.h:
+        (WebCore::PlatformWheelEvent::copyWithDeltas): Used to create a copy of the platform wheel event with filtered deltas.
+        (WebCore::PlatformWheelEvent::copyIgnoringHorizontalDelta): Deleted. No longer necessary, since we won't be handling wheel
+                events on separate axes.
+        (WebCore::PlatformWheelEvent::copyIgnoringVerticalDelta): Ditto.
+        * platform/spi/mac/NSScrollingInputFilterSPI.h: Added.
+
</ins><span class="cx"> 2015-08-24  Michael Catanzaro  &lt;mcatanzaro@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, fix typo in a comment (&quot;unsused&quot; -&gt; &quot;unused&quot;)
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (188859 => 188860)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-08-24 13:39:11 UTC (rev 188859)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-08-24 15:23:21 UTC (rev 188860)
</span><span class="lines">@@ -7341,7 +7341,7 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\page\UserContentURLPattern.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\page\VisitedLinkStore.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\fileapi\WebKitBlobBuilder.cpp&quot; /&gt;
</span><del>-    &lt;ClCompile Include=&quot;..\page\WheelEventDeltaTracker.cpp&quot; /&gt;
</del><ins>+    &lt;ClCompile Include=&quot;..\page\WheelEventDeltaFilter.cpp&quot; /&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\page\WheelEventTestTrigger.cpp&quot; /&gt;
</span><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="lines">@@ -20779,7 +20779,7 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\page\VisitedLinkStore.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><del>-    &lt;ClInclude Include=&quot;..\page\WheelEventDeltaTracker.h&quot; /&gt;
</del><ins>+    &lt;ClInclude Include=&quot;..\page\WheelEventDeltaFilter.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\page\WheelEventTestTrigger.h&quot; /&gt;
</span><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></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (188859 => 188860)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2015-08-24 13:39:11 UTC (rev 188859)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2015-08-24 15:23:21 UTC (rev 188860)
</span><span class="lines">@@ -813,7 +813,7 @@
</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><del>-    &lt;ClCompile Include=&quot;..\page\WheelEventDeltaTracker.cpp&quot;&gt;
</del><ins>+    &lt;ClCompile Include=&quot;..\page\WheelEventDeltaFilter.cpp&quot;&gt;
</ins><span class="cx">       &lt;Filter&gt;page&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\page\WheelEventTestTrigger.cpp&quot;&gt;
</span><span class="lines">@@ -7844,7 +7844,7 @@
</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><del>-    &lt;ClInclude Include=&quot;..\page\WheelEventDeltaTracker.h&quot;&gt;
</del><ins>+    &lt;ClInclude Include=&quot;..\page\WheelEventDeltaFilter.h&quot;&gt;
</ins><span class="cx">       &lt;Filter&gt;page&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\page\WheelEventTestTrigger.h&quot;&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (188859 => 188860)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-08-24 13:39:11 UTC (rev 188859)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-08-24 15:23:21 UTC (rev 188860)
</span><span class="lines">@@ -1178,6 +1178,7 @@
</span><span class="cx">                 2E0888D41148848A00AF4265 /* JSDOMFormData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E0888D21148848A00AF4265 /* JSDOMFormData.cpp */; };
</span><span class="cx">                 2E0888D51148848A00AF4265 /* JSDOMFormData.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E0888D31148848A00AF4265 /* JSDOMFormData.h */; };
</span><span class="cx">                 2E0888E6114884E200AF4265 /* JSDOMFormDataCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E0888E5114884E200AF4265 /* JSDOMFormDataCustom.cpp */; };
</span><ins>+                2E19516B1B6598D200DF6EEF /* WheelEventDeltaFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E19516A1B6598D200DF6EEF /* WheelEventDeltaFilter.cpp */; };
</ins><span class="cx">                 2E2D99CD10E2BBDA00496337 /* JSBlob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E2D99CB10E2BBDA00496337 /* JSBlob.cpp */; };
</span><span class="cx">                 2E2D99CE10E2BBDA00496337 /* JSBlob.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E2D99CC10E2BBDA00496337 /* JSBlob.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 2E2D99E710E2BC1C00496337 /* DOMBlob.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E2D99E510E2BC1C00496337 /* DOMBlob.h */; };
</span><span class="lines">@@ -1218,9 +1219,11 @@
</span><span class="cx">                 2E75841F12779ADA0062628B /* FileReaderLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E75841C12779ADA0062628B /* FileReaderLoaderClient.h */; };
</span><span class="cx">                 2E94F43B119207DA00B7F75D /* JSFileReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E94F439119207DA00B7F75D /* JSFileReader.cpp */; };
</span><span class="cx">                 2E94F43C119207DA00B7F75D /* JSFileReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E94F43A119207DA00B7F75D /* JSFileReader.h */; };
</span><ins>+                2E9B5D8F1B66A94E008C6A24 /* WheelEventDeltaFilterMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E9B5D8E1B66A94E008C6A24 /* WheelEventDeltaFilterMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 2EA768040FE7126400AB9C8A /* WorkerScriptLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EA768030FE7126400AB9C8A /* WorkerScriptLoaderClient.h */; };
</span><span class="cx">                 2EB4BCD2121F03E300EC4885 /* BlobResourceHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2EB4BCD0121F03E300EC4885 /* BlobResourceHandle.cpp */; };
</span><span class="cx">                 2EB4BCD3121F03E300EC4885 /* BlobResourceHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EB4BCD1121F03E300EC4885 /* BlobResourceHandle.h */; };
</span><ins>+                2EBBC3D81B65988300F5253D /* WheelEventDeltaFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EBBC3D71B65988300F5253D /* WheelEventDeltaFilter.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 2ECF7ADC10162B3800427DE7 /* JSErrorEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2ECF7ADA10162B3800427DE7 /* JSErrorEvent.cpp */; };
</span><span class="cx">                 2ECF7ADD10162B3800427DE7 /* JSErrorEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 2ECF7ADB10162B3800427DE7 /* JSErrorEvent.h */; };
</span><span class="cx">                 2ECF7AE110162B5800427DE7 /* ErrorEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2ECF7ADE10162B5800427DE7 /* ErrorEvent.cpp */; };
</span><span class="lines">@@ -1235,6 +1238,7 @@
</span><span class="cx">                 2EDF369C122C94B4002F7D4E /* FileReaderSync.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2EDF369A122C94B4002F7D4E /* FileReaderSync.cpp */; };
</span><span class="cx">                 2EDF369D122C94B4002F7D4E /* FileReaderSync.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EDF369B122C94B4002F7D4E /* FileReaderSync.h */; };
</span><span class="cx">                 2EDF369F122C94C8002F7D4E /* FileException.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EDF369E122C94C8002F7D4E /* FileException.h */; };
</span><ins>+                2EEEE55C1B66A047008E2CBC /* WheelEventDeltaFilterMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2EEEE55B1B66A047008E2CBC /* WheelEventDeltaFilterMac.mm */; };
</ins><span class="cx">                 2EF1BFEA121C9F4200C27627 /* FileStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2EF1BFE8121C9F4200C27627 /* FileStream.cpp */; };
</span><span class="cx">                 2EF1BFEB121C9F4200C27627 /* FileStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EF1BFE9121C9F4200C27627 /* FileStream.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 2EF1BFF9121CB0CE00C27627 /* FileStreamClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EF1BFF8121CB0CE00C27627 /* FileStreamClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -3513,8 +3517,6 @@
</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><del>-                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, ); }; };
</del><span class="cx">                 93EF7D551954F13900DFB71D /* ScrollingStateNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93EF7D541954E98F00DFB71D /* ScrollingStateNode.mm */; };
</span><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="lines">@@ -6460,6 +6462,7 @@
</span><span class="cx">                 F3D4C47912E07663003DA150 /* InspectorDOMDebuggerAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = F3D4C47712E07663003DA150 /* InspectorDOMDebuggerAgent.h */; };
</span><span class="cx">                 F3F5CF1112ED81A80084C569 /* InspectorConsoleInstrumentation.h in Headers */ = {isa = PBXBuildFile; fileRef = F3F5CF1012ED81A80084C569 /* InspectorConsoleInstrumentation.h */; };
</span><span class="cx">                 F3F5CF1312ED81B30084C569 /* InspectorDatabaseInstrumentation.h in Headers */ = {isa = PBXBuildFile; fileRef = F3F5CF1212ED81B30084C569 /* InspectorDatabaseInstrumentation.h */; };
</span><ins>+                F40EA8AB1B867E4400CE5581 /* NSScrollingInputFilterSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = F40EA8AA1B867D6500CE5581 /* NSScrollingInputFilterSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 F42FFB461984B71600F6837F /* LengthRepeat.h in Headers */ = {isa = PBXBuildFile; fileRef = F42FFB451984B71600F6837F /* LengthRepeat.h */; };
</span><span class="cx">                 F45C231D1995B73B00A6E2E3 /* AxisScrollSnapOffsets.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F45C231B1995B73B00A6E2E3 /* AxisScrollSnapOffsets.cpp */; };
</span><span class="cx">                 F45C231E1995B73B00A6E2E3 /* AxisScrollSnapOffsets.h in Headers */ = {isa = PBXBuildFile; fileRef = F45C231C1995B73B00A6E2E3 /* AxisScrollSnapOffsets.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -8387,6 +8390,7 @@
</span><span class="cx">                 2E0888D21148848A00AF4265 /* JSDOMFormData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMFormData.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2E0888D31148848A00AF4265 /* JSDOMFormData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMFormData.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2E0888E5114884E200AF4265 /* JSDOMFormDataCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMFormDataCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                2E19516A1B6598D200DF6EEF /* WheelEventDeltaFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WheelEventDeltaFilter.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 2E2D99CB10E2BBDA00496337 /* JSBlob.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSBlob.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2E2D99CC10E2BBDA00496337 /* JSBlob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBlob.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2E2D99E510E2BC1C00496337 /* DOMBlob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMBlob.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -8429,9 +8433,11 @@
</span><span class="cx">                 2E75841C12779ADA0062628B /* FileReaderLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileReaderLoaderClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2E94F439119207DA00B7F75D /* JSFileReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFileReader.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2E94F43A119207DA00B7F75D /* JSFileReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFileReader.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                2E9B5D8E1B66A94E008C6A24 /* WheelEventDeltaFilterMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WheelEventDeltaFilterMac.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 2EA768030FE7126400AB9C8A /* WorkerScriptLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkerScriptLoaderClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2EB4BCD0121F03E300EC4885 /* BlobResourceHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BlobResourceHandle.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2EB4BCD1121F03E300EC4885 /* BlobResourceHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlobResourceHandle.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                2EBBC3D71B65988300F5253D /* WheelEventDeltaFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WheelEventDeltaFilter.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 2ECF7ADA10162B3800427DE7 /* JSErrorEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSErrorEvent.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2ECF7ADB10162B3800427DE7 /* JSErrorEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSErrorEvent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2ECF7ADE10162B5800427DE7 /* ErrorEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ErrorEvent.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -8447,6 +8453,7 @@
</span><span class="cx">                 2EDF369A122C94B4002F7D4E /* FileReaderSync.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileReaderSync.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2EDF369B122C94B4002F7D4E /* FileReaderSync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileReaderSync.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2EDF369E122C94C8002F7D4E /* FileException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileException.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                2EEEE55B1B66A047008E2CBC /* WheelEventDeltaFilterMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WheelEventDeltaFilterMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 2EF1BFE8121C9F4200C27627 /* FileStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileStream.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2EF1BFE9121C9F4200C27627 /* FileStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileStream.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2EF1BFF8121CB0CE00C27627 /* FileStreamClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileStreamClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -10868,8 +10875,6 @@
</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><del>-                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;; };
</del><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">@@ -14189,6 +14194,7 @@
</span><span class="cx">                 F3D4C47712E07663003DA150 /* InspectorDOMDebuggerAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDOMDebuggerAgent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 F3F5CF1012ED81A80084C569 /* InspectorConsoleInstrumentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorConsoleInstrumentation.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 F3F5CF1212ED81B30084C569 /* InspectorDatabaseInstrumentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDatabaseInstrumentation.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                F40EA8AA1B867D6500CE5581 /* NSScrollingInputFilterSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSScrollingInputFilterSPI.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 F42FFB451984B71600F6837F /* LengthRepeat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LengthRepeat.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 F45C231B1995B73B00A6E2E3 /* AxisScrollSnapOffsets.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AxisScrollSnapOffsets.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 F45C231C1995B73B00A6E2E3 /* AxisScrollSnapOffsets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AxisScrollSnapOffsets.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -17266,8 +17272,8 @@
</span><span class="cx">                                 7C48A6D2191C9D8E00026674 /* WebKitNamespace.idl */,
</span><span class="cx">                                 494BD7930F55C8EE00747828 /* WebKitPoint.h */,
</span><span class="cx">                                 494BD7940F55C8EE00747828 /* WebKitPoint.idl */,
</span><del>-                                93EC449F188F4BB800661DF1 /* WheelEventDeltaTracker.cpp */,
-                                93EC44A0188F4BB800661DF1 /* WheelEventDeltaTracker.h */,
</del><ins>+                                2E19516A1B6598D200DF6EEF /* WheelEventDeltaFilter.cpp */,
+                                2EBBC3D71B65988300F5253D /* WheelEventDeltaFilter.h */,
</ins><span class="cx">                                 7AE335EF1ACB09E200E401EF /* WheelEventTestTrigger.cpp */,
</span><span class="cx">                                 7AE335F01ACB09E200E401EF /* WheelEventTestTrigger.h */,
</span><span class="cx">                                 7C4189AC1B07CBF2000FA757 /* WindowEventHandlers.idl */,
</span><span class="lines">@@ -18125,6 +18131,7 @@
</span><span class="cx">                                 9321D58F1A3906FA008052BE /* NSImmediateActionGestureRecognizerSPI.h */,
</span><span class="cx">                                 937F4CCD1A2D4B0100BB39F5 /* NSMenuSPI.h */,
</span><span class="cx">                                 93F1E1EB1A40FDDC00348D13 /* NSPopoverSPI.h */,
</span><ins>+                                F40EA8AA1B867D6500CE5581 /* NSScrollingInputFilterSPI.h */,
</ins><span class="cx">                                 2DCB837719F99BBA00A7FBE4 /* NSSharingServicePickerSPI.h */,
</span><span class="cx">                                 2DCB837819F99BBA00A7FBE4 /* NSSharingServiceSPI.h */,
</span><span class="cx">                                 937F4CCB1A2D48C100BB39F5 /* QuickLookMacSPI.h */,
</span><span class="lines">@@ -18158,6 +18165,8 @@
</span><span class="cx">                                 2D4F96F41A1ECC240098BF88 /* TextIndicatorWindow.mm */,
</span><span class="cx">                                 26255F0218878E110006E1FD /* UserAgentMac.mm */,
</span><span class="cx">                                 F587854C02DE375901EA4122 /* WebCoreFrameView.h */,
</span><ins>+                                2EEEE55B1B66A047008E2CBC /* WheelEventDeltaFilterMac.mm */,
+                                2E9B5D8E1B66A94E008C6A24 /* WheelEventDeltaFilterMac.h */,
</ins><span class="cx">                         );
</span><span class="cx">                         path = mac;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -24035,6 +24044,7 @@
</span><span class="cx">                                 FD31600812B0267600C1A359 /* AudioDestinationNode.h in Headers */,
</span><span class="cx">                                 FD31608012B026F700C1A359 /* AudioDSPKernel.h in Headers */,
</span><span class="cx">                                 FD31608212B026F700C1A359 /* AudioDSPKernelProcessor.h in Headers */,
</span><ins>+                                F40EA8AB1B867E4400CE5581 /* NSScrollingInputFilterSPI.h in Headers */,
</ins><span class="cx">                                 FD31608312B026F700C1A359 /* AudioFileReader.h in Headers */,
</span><span class="cx">                                 CD5596921475B678001D0BD0 /* AudioFileReaderIOS.h in Headers */,
</span><span class="cx">                                 FD3160BF12B0272A00C1A359 /* AudioFileReaderMac.h in Headers */,
</span><span class="lines">@@ -25359,6 +25369,7 @@
</span><span class="cx">                                 CE12524D1A1A77DE00864480 /* IOPMLibSPI.h in Headers */,
</span><span class="cx">                                 44DEF6431A6FF92700D45EEC /* IOReturnSPI.h in Headers */,
</span><span class="cx">                                 2D0B4AAB18DA1CCD00434DE1 /* IOSurface.h in Headers */,
</span><ins>+                                2E9B5D8F1B66A94E008C6A24 /* WheelEventDeltaFilterMac.h in Headers */,
</ins><span class="cx">                                 1C21E57D183ED1FF001C289D /* IOSurfacePool.h in Headers */,
</span><span class="cx">                                 44DFF6431A6FF92700D45EEC /* IOSurfaceSPI.h in Headers */,
</span><span class="cx">                                 44EFF6431A6FF92700D45EEC /* IOTypesSPI.h in Headers */,
</span><span class="lines">@@ -25715,6 +25726,7 @@
</span><span class="cx">                                 1AFE119A0CBFFCC4003017FA /* JSSQLResultSetRowList.h in Headers */,
</span><span class="cx">                                 B59DD6A511902A62007E9684 /* JSSQLStatementCallback.h in Headers */,
</span><span class="cx">                                 B59DD6A911902A71007E9684 /* JSSQLStatementErrorCallback.h in Headers */,
</span><ins>+                                2EBBC3D81B65988300F5253D /* WheelEventDeltaFilter.h in Headers */,
</ins><span class="cx">                                 BC82432A0D0CE8A200460C8F /* JSSQLTransaction.h in Headers */,
</span><span class="cx">                                 B59DD69D11902A42007E9684 /* JSSQLTransactionCallback.h in Headers */,
</span><span class="cx">                                 B59DD6A111902A52007E9684 /* JSSQLTransactionErrorCallback.h in Headers */,
</span><span class="lines">@@ -27437,7 +27449,6 @@
</span><span class="cx">                                 A91C9FC31B659A6700AFFD54 /* AccessibilityTreeItem.h in Headers */,
</span><span class="cx">                                 F55B3DE01251F12D003EF269 /* WeekInputType.h in Headers */,
</span><span class="cx">                                 85031B510A44EFC700F992E0 /* WheelEvent.h in Headers */,
</span><del>-                                93EC44A2188F4BB800661DF1 /* WheelEventDeltaTracker.h in Headers */,
</del><span class="cx">                                 7AE335F21ACB09E200E401EF /* WheelEventTestTrigger.h in Headers */,
</span><span class="cx">                                 9380F47409A11AB4001FDB34 /* Widget.h in Headers */,
</span><span class="cx">                                 1411DCB1164C39A800D49BC1 /* WidthCache.h in Headers */,
</span><span class="lines">@@ -30372,6 +30383,7 @@
</span><span class="cx">                                 B22279AD0D00BF220071B782 /* SVGDefsElement.cpp in Sources */,
</span><span class="cx">                                 B22279B00D00BF220071B782 /* SVGDescElement.cpp in Sources */,
</span><span class="cx">                                 B22279B30D00BF220071B782 /* SVGDocument.cpp in Sources */,
</span><ins>+                                2EEEE55C1B66A047008E2CBC /* WheelEventDeltaFilterMac.mm in Sources */,
</ins><span class="cx">                                 B28C6A270D00C44800334AA4 /* SVGDocumentExtensions.cpp in Sources */,
</span><span class="cx">                                 B22279B60D00BF220071B782 /* SVGElement.cpp in Sources */,
</span><span class="cx">                                 A833C8520A2CF52800D57664 /* SVGElementFactory.cpp in Sources */,
</span><span class="lines">@@ -30466,6 +30478,7 @@
</span><span class="cx">                                 B2227A8B0D00BF220071B782 /* SVGPointList.cpp in Sources */,
</span><span class="cx">                                 B2227A8E0D00BF220071B782 /* SVGPolyElement.cpp in Sources */,
</span><span class="cx">                                 B2227A900D00BF220071B782 /* SVGPolygonElement.cpp in Sources */,
</span><ins>+                                2E19516B1B6598D200DF6EEF /* WheelEventDeltaFilter.cpp in Sources */,
</ins><span class="cx">                                 B2227A930D00BF220071B782 /* SVGPolylineElement.cpp in Sources */,
</span><span class="cx">                                 B2227A960D00BF220071B782 /* SVGPreserveAspectRatio.cpp in Sources */,
</span><span class="cx">                                 B543B85717EB758F003BE93A /* SVGPropertyInfo.cpp in Sources */,
</span><span class="lines">@@ -30765,7 +30778,6 @@
</span><span class="cx">                                 CD8203111395ACE700F956C6 /* WebWindowAnimation.mm in Sources */,
</span><span class="cx">                                 F55B3DDF1251F12D003EF269 /* WeekInputType.cpp in Sources */,
</span><span class="cx">                                 85031B500A44EFC700F992E0 /* WheelEvent.cpp in Sources */,
</span><del>-                                93EC44A1188F4BB800661DF1 /* WheelEventDeltaTracker.cpp in Sources */,
</del><span class="cx">                                 7AE335F11ACB09E200E401EF /* WheelEventTestTrigger.cpp in Sources */,
</span><span class="cx">                                 9380F47309A11AB4001FDB34 /* Widget.cpp in Sources */,
</span><span class="cx">                                 E453904D0EAFD637003695C8 /* WidgetIOS.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorepageEventHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/EventHandler.cpp (188859 => 188860)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/EventHandler.cpp        2015-08-24 13:39:11 UTC (rev 188859)
+++ trunk/Source/WebCore/page/EventHandler.cpp        2015-08-24 15:23:21 UTC (rev 188860)
</span><span class="lines">@@ -287,17 +287,22 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline bool didScrollInScrollableAreaForSingleAxis(ScrollableArea* scrollableArea, WheelEvent* wheelEvent, ScrollEventAxis axis)
</del><ins>+static inline bool didScrollInScrollableArea(ScrollableArea* scrollableArea, WheelEvent* wheelEvent)
</ins><span class="cx"> {
</span><del>-    float delta = axis == ScrollEventAxis::Vertical ? wheelEvent-&gt;deltaY() : wheelEvent-&gt;deltaX();
-    ScrollDirection negativeDirection = axis == ScrollEventAxis::Vertical ? ScrollUp : ScrollLeft;
-    ScrollDirection positiveDirection = axis == ScrollEventAxis::Vertical ? ScrollDown : ScrollRight;
-    return scrollableArea-&gt;scroll(delta &lt; 0 ? negativeDirection : positiveDirection, wheelGranularityToScrollGranularity(wheelEvent-&gt;deltaMode()), delta &gt; 0 ? delta : -delta);
</del><ins>+    ScrollGranularity scrollGranularity = wheelGranularityToScrollGranularity(wheelEvent-&gt;deltaMode());
+    bool didHandleWheelEvent = false;
+    if (float absoluteDelta = std::abs(wheelEvent-&gt;deltaX()))
+        didHandleWheelEvent |= scrollableArea-&gt;scroll(wheelEvent-&gt;deltaX() &gt; 0 ? ScrollRight : ScrollLeft, scrollGranularity, absoluteDelta);
+    
+    if (float absoluteDelta = std::abs(wheelEvent-&gt;deltaY()))
+        didHandleWheelEvent |= scrollableArea-&gt;scroll(wheelEvent-&gt;deltaY() &gt; 0 ? ScrollDown : ScrollUp, scrollGranularity, absoluteDelta);
+    
+    return didHandleWheelEvent;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline bool handleWheelEventInAppropriateEnclosingBoxForSingleAxis(Node* startNode, WheelEvent* wheelEvent, Element** stopElement, ScrollEventAxis axis)
</del><ins>+static inline bool handleWheelEventInAppropriateEnclosingBox(Node* startNode, WheelEvent* wheelEvent, Element** stopElement, const FloatSize&amp; filteredPlatformDelta)
</ins><span class="cx"> {
</span><del>-    bool shouldHandleEvent = (axis == ScrollEventAxis::Vertical &amp;&amp; wheelEvent-&gt;deltaY()) || (axis == ScrollEventAxis::Horizontal &amp;&amp; wheelEvent-&gt;deltaX());
</del><ins>+    bool shouldHandleEvent = wheelEvent-&gt;deltaX() || wheelEvent-&gt;deltaY();
</ins><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">     shouldHandleEvent |= wheelEvent-&gt;phase() == PlatformWheelEventPhaseEnded;
</span><span class="cx"> #if ENABLE(CSS_SCROLL_SNAP)
</span><span class="lines">@@ -309,7 +314,7 @@
</span><span class="cx"> 
</span><span class="cx">     RenderBox&amp; initialEnclosingBox = startNode-&gt;renderer()-&gt;enclosingBox();
</span><span class="cx">     if (initialEnclosingBox.isListBox())
</span><del>-        return didScrollInScrollableAreaForSingleAxis(static_cast&lt;RenderListBox*&gt;(&amp;initialEnclosingBox), wheelEvent, axis);
</del><ins>+        return didScrollInScrollableArea(static_cast&lt;RenderListBox*&gt;(&amp;initialEnclosingBox), wheelEvent);
</ins><span class="cx"> 
</span><span class="cx">     RenderBox* currentEnclosingBox = &amp;initialEnclosingBox;
</span><span class="cx">     while (currentEnclosingBox) {
</span><span class="lines">@@ -317,9 +322,9 @@
</span><span class="cx">             const PlatformWheelEvent* platformEvent = wheelEvent-&gt;wheelEvent();
</span><span class="cx">             bool scrollingWasHandled;
</span><span class="cx">             if (platformEvent != nullptr)
</span><del>-                scrollingWasHandled = boxLayer-&gt;handleWheelEvent(axis == ScrollEventAxis::Vertical ? platformEvent-&gt;copyIgnoringHorizontalDelta() : platformEvent-&gt;copyIgnoringVerticalDelta());
</del><ins>+                scrollingWasHandled = boxLayer-&gt;handleWheelEvent(platformEvent-&gt;copyWithDeltas(filteredPlatformDelta.width(), filteredPlatformDelta.height()));
</ins><span class="cx">             else
</span><del>-                scrollingWasHandled = didScrollInScrollableAreaForSingleAxis(boxLayer, wheelEvent, axis);
</del><ins>+                scrollingWasHandled = didScrollInScrollableArea(boxLayer, wheelEvent);
</ins><span class="cx"> 
</span><span class="cx">             if (scrollingWasHandled) {
</span><span class="cx">                 if (stopElement)
</span><span class="lines">@@ -2670,7 +2675,7 @@
</span><span class="cx"> 
</span><span class="cx"> void EventHandler::platformRecordWheelEvent(const PlatformWheelEvent&amp; event)
</span><span class="cx"> {
</span><del>-    m_frame.mainFrame().wheelEventDeltaTracker()-&gt;recordWheelEventDelta(event);
</del><ins>+    m_frame.mainFrame().wheelEventDeltaFilter()-&gt;updateFromDelta(FloatSize(event.deltaX(), event.deltaY()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool EventHandler::platformCompleteWheelEvent(const PlatformWheelEvent&amp; event, ContainerNode*, ScrollableArea*)
</span><span class="lines">@@ -2775,7 +2780,7 @@
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">     m_frame.mainFrame().resetLatchingState();
</span><span class="cx"> #endif
</span><del>-    m_frame.mainFrame().wheelEventDeltaTracker()-&gt;endTrackingDeltas();
</del><ins>+    m_frame.mainFrame().wheelEventDeltaFilter()-&gt;endFilteringDeltas();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void EventHandler::defaultWheelEventHandler(Node* startNode, WheelEvent* wheelEvent)
</span><span class="lines">@@ -2783,25 +2788,24 @@
</span><span class="cx">     if (!startNode || !wheelEvent)
</span><span class="cx">         return;
</span><span class="cx">     
</span><del>-    DominantScrollGestureDirection dominantDirection = DominantScrollGestureDirection::None;
-
</del><ins>+    FloatSize filteredPlatformDelta(wheelEvent-&gt;deltaX(), wheelEvent-&gt;deltaY());
+    if (const PlatformWheelEvent* platformWheelEvent = wheelEvent-&gt;wheelEvent()) {
+        filteredPlatformDelta.setWidth(platformWheelEvent-&gt;deltaX());
+        filteredPlatformDelta.setHeight(platformWheelEvent-&gt;deltaY());
+    }
+    
</ins><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">     ScrollLatchingState* latchedState = m_frame.mainFrame().latchingState();
</span><span class="cx">     Element* stopElement = latchedState ? latchedState-&gt;previousWheelScrolledElement() : nullptr;
</span><span class="cx"> 
</span><del>-    // Workaround for scrolling issues &lt;rdar://problem/14758615&gt;.
-    if (m_frame.mainFrame().wheelEventDeltaTracker()-&gt;isTrackingDeltas())
-        dominantDirection = m_frame.mainFrame().wheelEventDeltaTracker()-&gt;dominantScrollGestureDirection();
</del><ins>+    if (m_frame.mainFrame().wheelEventDeltaFilter()-&gt;isFilteringDeltas())
+        filteredPlatformDelta = m_frame.mainFrame().wheelEventDeltaFilter()-&gt;filteredDelta();
</ins><span class="cx"> #else
</span><span class="cx">     Element* stopElement = nullptr;
</span><span class="cx"> #endif
</span><span class="cx">     
</span><del>-    // Break up into two scrolls if we need to.  Diagonal movement on 
-    // a MacBook pro is an example of a 2-dimensional mouse wheel event (where both deltaX and deltaY can be set).
-    if (dominantDirection != DominantScrollGestureDirection::Vertical &amp;&amp; handleWheelEventInAppropriateEnclosingBoxForSingleAxis(startNode, wheelEvent, &amp;stopElement, ScrollEventAxis::Horizontal))
-        wheelEvent-&gt;setDefaultHandled();
</del><span class="cx">     
</span><del>-    if (dominantDirection != DominantScrollGestureDirection::Horizontal &amp;&amp; handleWheelEventInAppropriateEnclosingBoxForSingleAxis(startNode, wheelEvent, &amp;stopElement, ScrollEventAxis::Vertical))
</del><ins>+    if (handleWheelEventInAppropriateEnclosingBox(startNode, wheelEvent, &amp;stopElement, filteredPlatformDelta))
</ins><span class="cx">         wheelEvent-&gt;setDefaultHandled();
</span><span class="cx">     
</span><span class="cx"> #if PLATFORM(MAC)
</span></span></pre></div>
<a id="trunkSourceWebCorepageEventHandlerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/EventHandler.h (188859 => 188860)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/EventHandler.h        2015-08-24 13:39:11 UTC (rev 188859)
+++ trunk/Source/WebCore/page/EventHandler.h        2015-08-24 15:23:21 UTC (rev 188860)
</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 &quot;WheelEventDeltaTracker.h&quot;
</del><ins>+#include &quot;WheelEventDeltaFilter.h&quot;
</ins><span class="cx"> #include &lt;memory&gt;
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> #include &lt;wtf/RefPtr.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebCorepageMainFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/MainFrame.cpp (188859 => 188860)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/MainFrame.cpp        2015-08-24 13:39:11 UTC (rev 188859)
+++ trunk/Source/WebCore/page/MainFrame.cpp        2015-08-24 15:23:21 UTC (rev 188860)
</span><span class="lines">@@ -32,12 +32,12 @@
</span><span class="cx"> #include &quot;PageOverlayController.h&quot;
</span><span class="cx"> #include &quot;ScrollLatchingState.h&quot;
</span><span class="cx"> #include &quot;Settings.h&quot;
</span><del>-#include &quot;WheelEventDeltaTracker.h&quot;
</del><ins>+#include &quot;WheelEventDeltaFilter.h&quot;
</ins><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> #include &quot;ServicesOverlayController.h&quot;
</span><del>-#endif
</del><ins>+#endif /* PLATFORM(MAC) */
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx">     , m_servicesOverlayController(std::make_unique&lt;ServicesOverlayController&gt;(*this))
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><del>-    , m_recentWheelEventDeltaTracker(std::make_unique&lt;WheelEventDeltaTracker&gt;())
</del><ins>+    , m_recentWheelEventDeltaFilter(WheelEventDeltaFilter::create())
</ins><span class="cx">     , m_pageOverlayController(std::make_unique&lt;PageOverlayController&gt;(*this))
</span><span class="cx">     , m_diagnosticLoggingClient(configuration.diagnosticLoggingClient)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCorepageMainFrameh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/MainFrame.h (188859 => 188860)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/MainFrame.h        2015-08-24 13:39:11 UTC (rev 188859)
+++ trunk/Source/WebCore/page/MainFrame.h        2015-08-24 15:23:21 UTC (rev 188860)
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx"> class PageOverlayController;
</span><span class="cx"> class ScrollLatchingState;
</span><span class="cx"> class ServicesOverlayController;
</span><del>-class WheelEventDeltaTracker;
</del><ins>+class WheelEventDeltaFilter;
</ins><span class="cx"> 
</span><span class="cx"> class MainFrame final : public Frame {
</span><span class="cx"> public:
</span><span class="lines">@@ -47,7 +47,7 @@
</span><span class="cx">     void selfOnlyRef();
</span><span class="cx">     void selfOnlyDeref();
</span><span class="cx"> 
</span><del>-    WheelEventDeltaTracker* wheelEventDeltaTracker() { return m_recentWheelEventDeltaTracker.get(); }
</del><ins>+    WheelEventDeltaFilter* wheelEventDeltaFilter() { return m_recentWheelEventDeltaFilter.get(); }
</ins><span class="cx">     PageOverlayController&amp; pageOverlayController() { return *m_pageOverlayController; }
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="lines">@@ -77,7 +77,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    std::unique_ptr&lt;WheelEventDeltaTracker&gt; m_recentWheelEventDeltaTracker;
</del><ins>+    std::unique_ptr&lt;WheelEventDeltaFilter&gt; m_recentWheelEventDeltaFilter;
</ins><span class="cx">     std::unique_ptr&lt;PageOverlayController&gt; m_pageOverlayController;
</span><span class="cx">     DiagnosticLoggingClient* m_diagnosticLoggingClient;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorepageWheelEventDeltaFiltercppfromrev188859trunkSourceWebCorepageWheelEventDeltaTrackercpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/page/WheelEventDeltaFilter.cpp (from rev 188859, trunk/Source/WebCore/page/WheelEventDeltaTracker.cpp) (0 => 188860)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/WheelEventDeltaFilter.cpp                                (rev 0)
+++ trunk/Source/WebCore/page/WheelEventDeltaFilter.cpp        2015-08-24 15:23:21 UTC (rev 188860)
</span><span class="lines">@@ -0,0 +1,115 @@
</span><ins>+/*
+ * Copyright (C) 2015 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;WheelEventDeltaFilter.h&quot;
+
+#if PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101100
+#include &quot;WheelEventDeltaFilterMac.h&quot;
+#endif
+
+#include &quot;FloatSize.h&quot;
+
+namespace WebCore {
+    
+WheelEventDeltaFilter::WheelEventDeltaFilter()
+{
+}
+
+WheelEventDeltaFilter::~WheelEventDeltaFilter()
+{
+}
+
+std::unique_ptr&lt;WheelEventDeltaFilter&gt; WheelEventDeltaFilter::create()
+{
+#if PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101100
+    return std::make_unique&lt;WheelEventDeltaFilterMac&gt;();
+#else
+    return std::make_unique&lt;BasicWheelEventDeltaFilter&gt;();
+#endif
+}
+
+BasicWheelEventDeltaFilter::BasicWheelEventDeltaFilter()
+    : WheelEventDeltaFilter()
+{
+}
+
+const size_t basicWheelEventDeltaFilterWindowSize = 3;
+
+void BasicWheelEventDeltaFilter::updateFromDelta(const FloatSize&amp; delta)
+{
+    m_currentFilteredDelta = delta;
+    if (!m_isFilteringDeltas)
+        return;
+    
+    m_recentWheelEventDeltas.append(delta);
+    if (m_recentWheelEventDeltas.size() &gt; basicWheelEventDeltaFilterWindowSize)
+        m_recentWheelEventDeltas.removeFirst();
+    
+    DominantScrollGestureDirection scrollDirection = dominantScrollGestureDirection();
+    if (scrollDirection == DominantScrollGestureDirection::Vertical)
+        m_currentFilteredDelta.setWidth(0);
+    else if (scrollDirection == DominantScrollGestureDirection::Horizontal)
+        m_currentFilteredDelta.setHeight(0);
+}
+
+void BasicWheelEventDeltaFilter::beginFilteringDeltas()
+{
+    m_recentWheelEventDeltas.clear();
+    m_isFilteringDeltas = true;
+}
+
+void BasicWheelEventDeltaFilter::endFilteringDeltas()
+{
+    m_currentFilteredDelta = FloatSize(0, 0);
+    m_isFilteringDeltas = false;
+}
+
+static inline bool deltaIsPredominantlyVertical(const FloatSize&amp; delta)
+{
+    return fabs(delta.height()) &gt; fabs(delta.width());
+}
+
+DominantScrollGestureDirection BasicWheelEventDeltaFilter::dominantScrollGestureDirection() const
+{
+    bool allVertical = m_recentWheelEventDeltas.size();
+    bool allHorizontal = m_recentWheelEventDeltas.size();
+    
+    for (const auto&amp; delta : m_recentWheelEventDeltas) {
+        bool isVertical = deltaIsPredominantlyVertical(delta);
+        allVertical &amp;= isVertical;
+        allHorizontal &amp;= !isVertical;
+    }
+    
+    if (allVertical)
+        return DominantScrollGestureDirection::Vertical;
+    
+    if (allHorizontal)
+        return DominantScrollGestureDirection::Horizontal;
+    
+    return DominantScrollGestureDirection::None;
+}
+
+};
</ins></span></pre></div>
<a id="trunkSourceWebCorepageWheelEventDeltaFilterhfromrev188859trunkSourceWebCorepageWheelEventDeltaTrackerh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/page/WheelEventDeltaFilter.h (from rev 188859, trunk/Source/WebCore/page/WheelEventDeltaTracker.h) (0 => 188860)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/WheelEventDeltaFilter.h                                (rev 0)
+++ trunk/Source/WebCore/page/WheelEventDeltaFilter.h        2015-08-24 15:23:21 UTC (rev 188860)
</span><span class="lines">@@ -0,0 +1,81 @@
</span><ins>+/*
+ * Copyright (C) 2015 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 WheelEventDeltaFilter_h
+#define WheelEventDeltaFilter_h
+
+#include &quot;FloatSize.h&quot;
+#include &lt;wtf/Deque.h&gt;
+
+namespace WebCore {
+
+class PlatformWheelEvent;
+
+class WheelEventDeltaFilter {
+public:
+    WheelEventDeltaFilter();
+    virtual ~WheelEventDeltaFilter();
+
+    WEBCORE_EXPORT static std::unique_ptr&lt;WheelEventDeltaFilter&gt; create();
+    WEBCORE_EXPORT virtual void updateFromDelta(const FloatSize&amp;) = 0;
+    WEBCORE_EXPORT virtual void beginFilteringDeltas() = 0;
+    WEBCORE_EXPORT virtual void endFilteringDeltas() = 0;
+    WEBCORE_EXPORT bool isFilteringDeltas() const
+    {
+        return m_isFilteringDeltas;
+    }
+    
+    WEBCORE_EXPORT FloatSize filteredDelta() const
+    {
+        return m_currentFilteredDelta;
+    }
+
+protected:
+    FloatSize m_currentFilteredDelta;
+    bool m_isFilteringDeltas { false };
+};
+
+enum class DominantScrollGestureDirection {
+    None,
+    Vertical,
+    Horizontal
+};
+
+class BasicWheelEventDeltaFilter final : public WheelEventDeltaFilter {
+public:
+    BasicWheelEventDeltaFilter();
+    virtual void updateFromDelta(const FloatSize&amp;) override;
+    virtual void beginFilteringDeltas() override;
+    virtual void endFilteringDeltas() override;
+
+private:
+    DominantScrollGestureDirection dominantScrollGestureDirection() const;
+
+    Deque&lt;FloatSize&gt; m_recentWheelEventDeltas;
+};
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCorepageWheelEventDeltaTrackercpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/page/WheelEventDeltaTracker.cpp (188859 => 188860)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/WheelEventDeltaTracker.cpp        2015-08-24 13:39:11 UTC (rev 188859)
+++ trunk/Source/WebCore/page/WheelEventDeltaTracker.cpp        2015-08-24 15:23:21 UTC (rev 188860)
</span><span class="lines">@@ -1,86 +0,0 @@
</span><del>-/*
- * 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();
-
-    for (const auto&amp; delta : m_recentWheelEventDeltas) {
-        bool isVertical = deltaIsPredominantlyVertical(delta);
-        allVertical &amp;= isVertical;
-        allHorizontal &amp;= !isVertical;
-    }
-    
-    if (allVertical)
-        return DominantScrollGestureDirection::Vertical;
-
-    if (allHorizontal)
-        return DominantScrollGestureDirection::Horizontal;
-    
-    return DominantScrollGestureDirection::None;
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCorepageWheelEventDeltaTrackerh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/page/WheelEventDeltaTracker.h (188859 => 188860)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/WheelEventDeltaTracker.h        2015-08-24 13:39:11 UTC (rev 188859)
+++ trunk/Source/WebCore/page/WheelEventDeltaTracker.h        2015-08-24 15:23:21 UTC (rev 188860)
</span><span class="lines">@@ -1,66 +0,0 @@
</span><del>-/*
- * 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 final {
-public:
-    WEBCORE_EXPORT WheelEventDeltaTracker();
-    WEBCORE_EXPORT ~WheelEventDeltaTracker();
-
-    WEBCORE_EXPORT void beginTrackingDeltas();
-    WEBCORE_EXPORT void endTrackingDeltas();
-
-    bool isTrackingDeltas() const { return m_isTrackingDeltas; }
-
-    WEBCORE_EXPORT void recordWheelEventDelta(const PlatformWheelEvent&amp;);
-    WEBCORE_EXPORT DominantScrollGestureDirection dominantScrollGestureDirection() const;
-
-private:
-    Deque&lt;FloatSize&gt; m_recentWheelEventDeltas;
-    bool m_isTrackingDeltas;
-
-};
-
-} // namespace WebCore
-
-#endif // WheelEventDeltaTracker_h
</del></span></pre></div>
<a id="trunkSourceWebCorepagemacEventHandlerMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/mac/EventHandlerMac.mm (188859 => 188860)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/mac/EventHandlerMac.mm        2015-08-24 13:39:11 UTC (rev 188859)
+++ trunk/Source/WebCore/page/mac/EventHandlerMac.mm        2015-08-24 15:23:21 UTC (rev 188860)
</span><span class="lines">@@ -954,7 +954,7 @@
</span><span class="cx">                 latchingState-&gt;setScrollableContainer(scrollableContainer);
</span><span class="cx">                 latchingState-&gt;setWidgetIsLatched(result.isOverWidget());
</span><span class="cx">                 isOverWidget = latchingState-&gt;widgetIsLatched();
</span><del>-                m_frame.mainFrame().wheelEventDeltaTracker()-&gt;beginTrackingDeltas();
</del><ins>+                m_frame.mainFrame().wheelEventDeltaFilter()-&gt;beginFilteringDeltas();
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">     } else if (wheelEvent.shouldResetLatching())
</span><span class="lines">@@ -982,16 +982,15 @@
</span><span class="cx"> {
</span><span class="cx">     switch (wheelEvent.phase()) {
</span><span class="cx">         case PlatformWheelEventPhaseBegan:
</span><del>-            m_frame.mainFrame().wheelEventDeltaTracker()-&gt;beginTrackingDeltas();
</del><ins>+            m_frame.mainFrame().wheelEventDeltaFilter()-&gt;beginFilteringDeltas();
</ins><span class="cx">             break;
</span><span class="cx">         case PlatformWheelEventPhaseEnded:
</span><del>-            m_frame.mainFrame().wheelEventDeltaTracker()-&gt;endTrackingDeltas();
</del><ins>+            m_frame.mainFrame().wheelEventDeltaFilter()-&gt;endFilteringDeltas();
</ins><span class="cx">             break;
</span><span class="cx">         default:
</span><span class="cx">             break;
</span><span class="cx">     }
</span><del>-
-    m_frame.mainFrame().wheelEventDeltaTracker()-&gt;recordWheelEventDelta(wheelEvent);
</del><ins>+    m_frame.mainFrame().wheelEventDeltaFilter()-&gt;updateFromDelta(FloatSize(wheelEvent.deltaX(), wheelEvent.deltaY()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static FrameView* frameViewForLatchingState(Frame&amp; frame, ScrollLatchingState* latchingState)
</span></span></pre></div>
<a id="trunkSourceWebCorepagemacWheelEventDeltaFilterMachfromrev188859trunkSourceWebCorepageWheelEventDeltaTrackerh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/page/mac/WheelEventDeltaFilterMac.h (from rev 188859, trunk/Source/WebCore/page/WheelEventDeltaTracker.h) (0 => 188860)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/mac/WheelEventDeltaFilterMac.h                                (rev 0)
+++ trunk/Source/WebCore/page/mac/WheelEventDeltaFilterMac.h        2015-08-24 15:23:21 UTC (rev 188860)
</span><span class="lines">@@ -0,0 +1,55 @@
</span><ins>+/*
+ * Copyright (C) 2015 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 WheelEventDeltaFilterMac_h
+#define WheelEventDeltaFilterMac_h
+
+#if PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101100
+
+#include &quot;WheelEventDeltaFilter.h&quot;
+#include &lt;wtf/RetainPtr.h&gt;
+
+OBJC_CLASS _NSScrollingPredominantAxisFilter;
+
+namespace WebCore {
+
+class WheelEventDeltaFilterMac final : public WheelEventDeltaFilter {
+public:
+    WheelEventDeltaFilterMac();
+
+    virtual void updateFromDelta(const FloatSize&amp;) override;
+    virtual void beginFilteringDeltas() override;
+    virtual void endFilteringDeltas() override;
+
+private:
+    RetainPtr&lt;_NSScrollingPredominantAxisFilter&gt; m_predominantAxisFilter;
+    double m_beginFilteringDeltasTime { 0 };
+};
+
+}
+
+#endif /* PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101100 */
+
+#endif /* WheelEventDeltaFilterMac_h */
</ins></span></pre></div>
<a id="trunkSourceWebCorepagemacWheelEventDeltaFilterMacmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/page/mac/WheelEventDeltaFilterMac.mm (0 => 188860)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/mac/WheelEventDeltaFilterMac.mm                                (rev 0)
+++ trunk/Source/WebCore/page/mac/WheelEventDeltaFilterMac.mm        2015-08-24 15:23:21 UTC (rev 188860)
</span><span class="lines">@@ -0,0 +1,69 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101100
+
+#include &quot;config.h&quot;
+#include &quot;WheelEventDeltaFilterMac.h&quot;
+
+#import &quot;NSScrollingInputFilterSPI.h&quot;
+#import &lt;wtf/CurrentTime.h&gt;
+
+namespace WebCore {
+
+WheelEventDeltaFilterMac::WheelEventDeltaFilterMac()
+    : WheelEventDeltaFilter()
+    , m_predominantAxisFilter(adoptNS([[_NSScrollingPredominantAxisFilter alloc] init]))
+{
+}
+
+void WheelEventDeltaFilterMac::beginFilteringDeltas()
+{
+    m_beginFilteringDeltasTime = monotonicallyIncreasingTime();
+    m_isFilteringDeltas = true;
+}
+
+void WheelEventDeltaFilterMac::updateFromDelta(const FloatSize&amp; delta)
+{
+    if (!m_isFilteringDeltas)
+        return;
+
+    NSPoint filteredDeltaResult;
+    NSPoint filteredVelocityResult;
+    [m_predominantAxisFilter filterInputDelta:CGPointMake(delta.width(), delta.height()) timestamp:monotonicallyIncreasingTime() - m_beginFilteringDeltasTime outputDelta:&amp;filteredDeltaResult velocity:&amp;filteredVelocityResult];
+    m_currentFilteredDelta = FloatSize(filteredDeltaResult.x, filteredDeltaResult.y);
+}
+
+void WheelEventDeltaFilterMac::endFilteringDeltas()
+{
+    m_currentFilteredDelta = FloatSize(0, 0);
+    m_beginFilteringDeltasTime = 0;
+    [m_predominantAxisFilter reset];
+    m_isFilteringDeltas = false;
+}
+
+}
+
+#endif /* PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101100 */
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformPlatformWheelEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/PlatformWheelEvent.h (188859 => 188860)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/PlatformWheelEvent.h        2015-08-24 13:39:11 UTC (rev 188859)
+++ trunk/Source/WebCore/platform/PlatformWheelEvent.h        2015-08-24 15:23:21 UTC (rev 188860)
</span><span class="lines">@@ -119,20 +119,14 @@
</span><span class="cx">             return copy;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        PlatformWheelEvent copyIgnoringHorizontalDelta() const
</del><ins>+        PlatformWheelEvent copyWithDeltas(float deltaX, float deltaY) const
</ins><span class="cx">         {
</span><span class="cx">             PlatformWheelEvent copy = *this;
</span><del>-            copy.m_deltaX = 0;
</del><ins>+            copy.m_deltaX = deltaX;
+            copy.m_deltaY = deltaY;
</ins><span class="cx">             return copy;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        PlatformWheelEvent copyIgnoringVerticalDelta() const
-        {
-            PlatformWheelEvent copy = *this;
-            copy.m_deltaY = 0;
-            return copy;
-        }
-
</del><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="trunkSourceWebCoreplatformspimacNSScrollingInputFilterSPIh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/spi/mac/NSScrollingInputFilterSPI.h (0 => 188860)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/spi/mac/NSScrollingInputFilterSPI.h                                (rev 0)
+++ trunk/Source/WebCore/platform/spi/mac/NSScrollingInputFilterSPI.h        2015-08-24 15:23:21 UTC (rev 188860)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+/*
+ * Copyright (C) 2015 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. ``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
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101100
+
+#if USE(APPLE_INTERNAL_SDK)
+
+#import &lt;AppKit/NSScrollingInputFilter_Private.h&gt;
+
+#else
+
+@interface _NSScrollingPredominantAxisFilter : NSObject;
+- (void)filterInputDelta:(NSPoint)delta timestamp:(NSTimeInterval)timestamp outputDelta:(NSPoint*)pDelta velocity:(NSPoint *)pVelocity;
+- (void)reset;
+@end
+
+#endif /* USE(APPLE_INTERNAL_SDK) */
+
+#endif /* PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101100 */
</ins></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (188859 => 188860)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-08-24 13:39:11 UTC (rev 188859)
+++ trunk/Source/WebKit2/ChangeLog        2015-08-24 15:23:21 UTC (rev 188860)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2015-08-24  Wenson Hsieh  &lt;wenson_hsieh@apple.com&gt;
+
+        Use _NSScrollingPredominantAxisFilter for wheel event filtering on Mac
+        https://bugs.webkit.org/show_bug.cgi?id=147320
+
+        Reviewed by Simon Fraser.
+
+        Refactored to use a predominant axis filter instead of a predominant axis tracker. This allows us to
+        employ AppKit's _NSScrollingPredominantAxisFilter when possible, and use the wheel event delta tracker
+        as a fallback. Here, we refactor EventDispatcher to use the new filters for mainframe scrolling.
+
+        No new tests, since this change does not add new functionality.
+
+        * WebProcess/WebPage/EventDispatcher.cpp: Include WheelEventDeltaFilterMac.h when necessary.
+        (WebKit::EventDispatcher::EventDispatcher): Initialize a WheelEventDeltaFilterMac when possible. Otherwise,
+            fall back to a BasicWheelEventDeltaFilter.
+        (WebKit::EventDispatcher::wheelEvent): Use filtered deltas to initialize the platform wheel event instead
+            of zeroing out non-predominant axes.
+        * WebProcess/WebPage/EventDispatcher.h: Replace m_recentWheelEventDeltaTracker with m_recentWheelEventDeltaFilter.
+
</ins><span class="cx"> 2015-08-23  Andy Estes  &lt;aestes@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Content Filtering] REGRESSION (r182356): Provisional URL is incorrect in didReceiveServerRedirectForProvisionalLoadForFrame when Content Filtering is enabled
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageEventDispatchercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp (188859 => 188860)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp        2015-08-24 13:39:11 UTC (rev 188859)
+++ trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp        2015-08-24 15:23:21 UTC (rev 188860)
</span><span class="lines">@@ -54,7 +54,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;, WorkQueue::Type::Serial, WorkQueue::QOS::UserInteractive))
</span><del>-    , m_recentWheelEventDeltaTracker(std::make_unique&lt;WheelEventDeltaTracker&gt;())
</del><ins>+    , m_recentWheelEventDeltaFilter(WheelEventDeltaFilter::create())
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -95,26 +95,19 @@
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     switch (wheelEvent.phase()) {
</span><span class="cx">     case PlatformWheelEventPhaseBegan:
</span><del>-        m_recentWheelEventDeltaTracker-&gt;beginTrackingDeltas();
</del><ins>+        m_recentWheelEventDeltaFilter-&gt;beginFilteringDeltas();
</ins><span class="cx">         break;
</span><span class="cx">     case PlatformWheelEventPhaseEnded:
</span><del>-        m_recentWheelEventDeltaTracker-&gt;endTrackingDeltas();
</del><ins>+        m_recentWheelEventDeltaFilter-&gt;endFilteringDeltas();
</ins><span class="cx">         break;
</span><span class="cx">     default:
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    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();
</del><ins>+    if (m_recentWheelEventDeltaFilter-&gt;isFilteringDeltas()) {
+        m_recentWheelEventDeltaFilter-&gt;updateFromDelta(FloatSize(platformWheelEvent.deltaX(), platformWheelEvent.deltaY()));
+        FloatSize filteredDelta = m_recentWheelEventDeltaFilter-&gt;filteredDelta();
+        platformWheelEvent = platformWheelEvent.copyWithDeltas(filteredDelta.width(), filteredDelta.height());
</ins><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageEventDispatcherh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.h (188859 => 188860)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.h        2015-08-24 13:39:11 UTC (rev 188859)
+++ trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.h        2015-08-24 15:23:21 UTC (rev 188860)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Connection.h&quot;
</span><span class="cx"> 
</span><del>-#include &lt;WebCore/WheelEventDeltaTracker.h&gt;
</del><ins>+#include &lt;WebCore/WheelEventDeltaFilter.h&gt;
</ins><span class="cx"> #include &lt;WebEvent.h&gt;
</span><span class="cx"> #include &lt;memory&gt;
</span><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><span class="lines">@@ -95,7 +95,7 @@
</span><span class="cx">     Lock m_scrollingTreesMutex;
</span><span class="cx">     HashMap&lt;uint64_t, RefPtr&lt;WebCore::ThreadedScrollingTree&gt;&gt; m_scrollingTrees;
</span><span class="cx"> #endif
</span><del>-    std::unique_ptr&lt;WebCore::WheelEventDeltaTracker&gt; m_recentWheelEventDeltaTracker;
</del><ins>+    std::unique_ptr&lt;WebCore::WheelEventDeltaFilter&gt; m_recentWheelEventDeltaFilter;
</ins><span class="cx"> #if ENABLE(IOS_TOUCH_EVENTS)
</span><span class="cx">     Lock m_touchEventsLock;
</span><span class="cx">     HashMap&lt;uint64_t, TouchEventQueue&gt; m_touchEvents;
</span></span></pre>
</div>
</div>

</body>
</html>