<!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>[182334] trunk/Source/WebCore</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/182334">182334</a></dd>
<dt>Author</dt> <dd>bfulgham@apple.com</dd>
<dt>Date</dt> <dd>2015-04-03 14:32:59 -0700 (Fri, 03 Apr 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Expand test infrastructure to support scrolling tests
https://bugs.webkit.org/show_bug.cgi?id=143383

Reviewed by Darin Adler.

No new tests: No change in behavior.

This is an initial set of changes that clean up a few things I noticed while extending testing support
for scroll animations and wheel event gestures.
1. Reduce the amount of #ifdef code in EventHandler{Mac}.
2. Consolidate the idea of an &quot;End Gesture&quot; in the PlatformWheelEvent class.
3. Remove a number of unneeded null checks in EventHandler.
4. ScrollController must always have a client, so hold a reference instead of using a pointer.

* page/EventHandler.cpp:
(WebCore::EventHandler::platformNotifyIfEndGesture): Renamed from 'platformNotifySnapIfNecessary'.
(WebCore::EventHandler::handleWheelEvent): Call 'platformNotifySnapIfNecessary' at method exit points.
(WebCore::EventHandler::platformNotifySnapIfNecessary): Deleted.
* page/EventHandler.h:
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::platformCompleteWheelEvent):  Remove unneeded null checks for 'view'. Remove
CSS_SNAP-specific call to 'platformNotifySnapIfNecessary'. This logic is now handled in the new
'platformNotifyIfEndGesture' method.
(WebCore::EventHandler::platformNotifyIfEndGesture): Renamed from 'platformNotifySnapIfNecessary'.
(WebCore::EventHandler::platformNotifySnapIfNecessary): Deleted.
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac): Pass 'this' as
reference to ScrollController constructor.
* platform/PlatformWheelEvent.h:
(WebCore::PlatformWheelEvent::shouldResetLatching): Call new 'isEndGesture' method.
(WebCore::PlatformWheelEvent::isEndGesture): Added method to encapsulate some code that was duplicated
in a number of places.
* platform/ScrollAnimator.cpp:
(WebCore::ScrollAnimator::ScrollAnimator): Pass 'this' as reference to ScrollController constructor.
* platform/cocoa/ScrollController.h:
* platform/cocoa/ScrollController.mm:
(WebCore::ScrollController::ScrollController): Update to reflect m_client is now a reference.
(WebCore::ScrollController::handleWheelEvent): Ditto.
(WebCore::ScrollController::snapRubberBandTimerFired): Ditto. Also, a drive-by fix for ending rubberband
snapping. This end-state wasn't deactivating the timer (even when the animation finished). This isn't a
huge problem, but I (will) rely on the state of the animation timer in a future patch to decide if
tests should run or continue waiting.
(WebCore::ScrollController::isRubberBandInProgress): Ditto.
(WebCore::ScrollController::startSnapRubberbandTimer): Ditto.
(WebCore::ScrollController::stopSnapRubberbandTimer): Ditto.
(WebCore::ScrollController::shouldRubberBandInHorizontalDirection): Ditto.
(WebCore::ScrollController::processWheelEventForScrollSnapOnAxis): Ditto.
(WebCore::ScrollController::startScrollSnapTimer): Ditto.
(WebCore::ScrollController::stopScrollSnapTimer): Ditto.
(WebCore::ScrollController::scrollSnapAnimationUpdate): Ditto.
(WebCore::ScrollController::beginScrollSnapAnimation): Ditto.
(WebCore::ScrollController::computeSnapDelta): Ditto.
(WebCore::ScrollController::computeGlideDelta): Ditto.
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::gestureShouldBeginSnap): Use new PlatformWheelEvent::isEndGesture() method.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</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="#trunkSourceWebCorepagemacEventHandlerMacmm">trunk/Source/WebCore/page/mac/EventHandlerMac.mm</a></li>
<li><a href="#trunkSourceWebCorepagescrollingmacScrollingTreeFrameScrollingNodeMacmm">trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformPlatformWheelEventh">trunk/Source/WebCore/platform/PlatformWheelEvent.h</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollAnimatorcpp">trunk/Source/WebCore/platform/ScrollAnimator.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformcocoaScrollControllerh">trunk/Source/WebCore/platform/cocoa/ScrollController.h</a></li>
<li><a href="#trunkSourceWebCoreplatformcocoaScrollControllermm">trunk/Source/WebCore/platform/cocoa/ScrollController.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmacScrollAnimatorMacmm">trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (182333 => 182334)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-04-03 21:21:24 UTC (rev 182333)
+++ trunk/Source/WebCore/ChangeLog        2015-04-03 21:32:59 UTC (rev 182334)
</span><span class="lines">@@ -1,3 +1,61 @@
</span><ins>+2015-04-03  Brent Fulgham  &lt;bfulgham@apple.com&gt;
+
+        Expand test infrastructure to support scrolling tests
+        https://bugs.webkit.org/show_bug.cgi?id=143383
+
+        Reviewed by Darin Adler.
+
+        No new tests: No change in behavior.
+
+        This is an initial set of changes that clean up a few things I noticed while extending testing support
+        for scroll animations and wheel event gestures.
+        1. Reduce the amount of #ifdef code in EventHandler{Mac}.
+        2. Consolidate the idea of an &quot;End Gesture&quot; in the PlatformWheelEvent class.
+        3. Remove a number of unneeded null checks in EventHandler.
+        4. ScrollController must always have a client, so hold a reference instead of using a pointer.
+
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::platformNotifyIfEndGesture): Renamed from 'platformNotifySnapIfNecessary'.
+        (WebCore::EventHandler::handleWheelEvent): Call 'platformNotifySnapIfNecessary' at method exit points.
+        (WebCore::EventHandler::platformNotifySnapIfNecessary): Deleted.
+        * page/EventHandler.h:
+        * page/mac/EventHandlerMac.mm:
+        (WebCore::EventHandler::platformCompleteWheelEvent):  Remove unneeded null checks for 'view'. Remove
+        CSS_SNAP-specific call to 'platformNotifySnapIfNecessary'. This logic is now handled in the new
+        'platformNotifyIfEndGesture' method.
+        (WebCore::EventHandler::platformNotifyIfEndGesture): Renamed from 'platformNotifySnapIfNecessary'.
+        (WebCore::EventHandler::platformNotifySnapIfNecessary): Deleted.
+        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac): Pass 'this' as
+        reference to ScrollController constructor.
+        * platform/PlatformWheelEvent.h:
+        (WebCore::PlatformWheelEvent::shouldResetLatching): Call new 'isEndGesture' method.
+        (WebCore::PlatformWheelEvent::isEndGesture): Added method to encapsulate some code that was duplicated
+        in a number of places.
+        * platform/ScrollAnimator.cpp:
+        (WebCore::ScrollAnimator::ScrollAnimator): Pass 'this' as reference to ScrollController constructor.
+        * platform/cocoa/ScrollController.h:
+        * platform/cocoa/ScrollController.mm:
+        (WebCore::ScrollController::ScrollController): Update to reflect m_client is now a reference.
+        (WebCore::ScrollController::handleWheelEvent): Ditto.
+        (WebCore::ScrollController::snapRubberBandTimerFired): Ditto. Also, a drive-by fix for ending rubberband
+        snapping. This end-state wasn't deactivating the timer (even when the animation finished). This isn't a
+        huge problem, but I (will) rely on the state of the animation timer in a future patch to decide if
+        tests should run or continue waiting.
+        (WebCore::ScrollController::isRubberBandInProgress): Ditto.
+        (WebCore::ScrollController::startSnapRubberbandTimer): Ditto.
+        (WebCore::ScrollController::stopSnapRubberbandTimer): Ditto.
+        (WebCore::ScrollController::shouldRubberBandInHorizontalDirection): Ditto.
+        (WebCore::ScrollController::processWheelEventForScrollSnapOnAxis): Ditto.
+        (WebCore::ScrollController::startScrollSnapTimer): Ditto.
+        (WebCore::ScrollController::stopScrollSnapTimer): Ditto.
+        (WebCore::ScrollController::scrollSnapAnimationUpdate): Ditto.
+        (WebCore::ScrollController::beginScrollSnapAnimation): Ditto.
+        (WebCore::ScrollController::computeSnapDelta): Ditto.
+        (WebCore::ScrollController::computeGlideDelta): Ditto.
+        * platform/mac/ScrollAnimatorMac.mm:
+        (WebCore::gestureShouldBeginSnap): Use new PlatformWheelEvent::isEndGesture() method.
+
</ins><span class="cx"> 2015-04-03  Chris Fleizach  &lt;cfleizach@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         AX: Toggling check box state not speaking using plain space, not VO space.
</span></span></pre></div>
<a id="trunkSourceWebCorepageEventHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/EventHandler.cpp (182333 => 182334)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/EventHandler.cpp        2015-04-03 21:21:24 UTC (rev 182333)
+++ trunk/Source/WebCore/page/EventHandler.cpp        2015-04-03 21:32:59 UTC (rev 182334)
</span><span class="lines">@@ -2627,11 +2627,9 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if ENABLE(CSS_SCROLL_SNAP)
-void EventHandler::platformNotifySnapIfNecessary(const PlatformWheelEvent&amp;, ScrollableArea&amp;)
</del><ins>+void EventHandler::platformNotifyIfEndGesture(const PlatformWheelEvent&amp;, ScrollableArea*)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -2682,6 +2680,7 @@
</span><span class="cx">                     m_isHandlingWheelEvent = false;
</span><span class="cx">                     if (scrollableArea)
</span><span class="cx">                         scrollableArea-&gt;setScrolledProgrammatically(false);
</span><ins>+                    platformNotifyIfEndGesture(adjustedEvent, scrollableArea);
</ins><span class="cx">                     if (!widget-&gt;platformWidget())
</span><span class="cx">                         return true;
</span><span class="cx">                     return platformCompletePlatformWidgetWheelEvent(event, *widget, scrollableContainer.get());
</span><span class="lines">@@ -2697,10 +2696,7 @@
</span><span class="cx">                 scrollableArea-&gt;setScrolledProgrammatically(false);
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-#if ENABLE(CSS_SCROLL_SNAP)
-            if (scrollableArea)
-                platformNotifySnapIfNecessary(adjustedEvent, *scrollableArea);
-#endif
</del><ins>+            platformNotifyIfEndGesture(adjustedEvent, scrollableArea);
</ins><span class="cx">             return true;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -2708,7 +2704,9 @@
</span><span class="cx">     if (scrollableArea)
</span><span class="cx">         scrollableArea-&gt;setScrolledProgrammatically(false);
</span><span class="cx"> 
</span><del>-    return platformCompleteWheelEvent(event, scrollableContainer.get(), scrollableArea);
</del><ins>+    bool handledEvent = platformCompleteWheelEvent(event, scrollableContainer.get(), scrollableArea);
+    platformNotifyIfEndGesture(adjustedEvent, scrollableArea);
+    return handledEvent;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void EventHandler::clearLatchedState()
</span></span></pre></div>
<a id="trunkSourceWebCorepageEventHandlerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/EventHandler.h (182333 => 182334)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/EventHandler.h        2015-04-03 21:21:24 UTC (rev 182333)
+++ trunk/Source/WebCore/page/EventHandler.h        2015-04-03 21:32:59 UTC (rev 182334)
</span><span class="lines">@@ -210,11 +210,8 @@
</span><span class="cx">     void platformRecordWheelEvent(const PlatformWheelEvent&amp;);
</span><span class="cx">     bool platformCompleteWheelEvent(const PlatformWheelEvent&amp;, ContainerNode* scrollableContainer, ScrollableArea*);
</span><span class="cx">     bool platformCompletePlatformWidgetWheelEvent(const PlatformWheelEvent&amp;, const Widget&amp;, ContainerNode* scrollableContainer);
</span><ins>+    void platformNotifyIfEndGesture(const PlatformWheelEvent&amp;, ScrollableArea*);
</ins><span class="cx"> 
</span><del>-#if ENABLE(CSS_SCROLL_SNAP)
-    void platformNotifySnapIfNecessary(const PlatformWheelEvent&amp;, ScrollableArea&amp;);
-#endif
-
</del><span class="cx"> #if ENABLE(IOS_TOUCH_EVENTS) || ENABLE(IOS_GESTURE_EVENTS)
</span><span class="cx">     typedef Vector&lt;RefPtr&lt;Touch&gt;&gt; TouchArray;
</span><span class="cx">     typedef HashMap&lt;EventTarget*, TouchArray*&gt; EventTargetTouchMap;
</span></span></pre></div>
<a id="trunkSourceWebCorepagemacEventHandlerMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/mac/EventHandlerMac.mm (182333 => 182334)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/mac/EventHandlerMac.mm        2015-04-03 21:21:24 UTC (rev 182333)
+++ trunk/Source/WebCore/page/mac/EventHandlerMac.mm        2015-04-03 21:32:59 UTC (rev 182334)
</span><span class="lines">@@ -938,6 +938,7 @@
</span><span class="cx"> bool EventHandler::platformCompleteWheelEvent(const PlatformWheelEvent&amp; wheelEvent, ContainerNode* scrollableContainer, ScrollableArea* scrollableArea)
</span><span class="cx"> {
</span><span class="cx">     // We do another check on the frame view because the event handler can run JS which results in the frame getting destroyed.
</span><ins>+    ASSERT(m_frame.view());
</ins><span class="cx">     FrameView* view = m_frame.view();
</span><span class="cx"> 
</span><span class="cx">     ScrollLatchingState* latchingState = m_frame.mainFrame().latchingState();
</span><span class="lines">@@ -954,7 +955,9 @@
</span><span class="cx">         if (!latchingState-&gt;startedGestureAtScrollLimit())
</span><span class="cx">             view = frameViewForLatchingState(m_frame, latchingState);
</span><span class="cx"> 
</span><del>-        bool didHandleWheelEvent = view &amp;&amp; view-&gt;wheelEvent(wheelEvent);
</del><ins>+        ASSERT(view);
+
+        bool didHandleWheelEvent = view-&gt;wheelEvent(wheelEvent);
</ins><span class="cx">         if (scrollableContainer == latchingState-&gt;scrollableContainer()) {
</span><span class="cx">             // If we are just starting a scroll event, and have nowhere left to scroll, allow
</span><span class="cx">             // the enclosing frame to handle the scroll.
</span><span class="lines">@@ -962,20 +965,14 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // If the platform widget is handling the event, we always want to return false.
</span><del>-        if (view &amp;&amp; scrollableArea == view &amp;&amp; view-&gt;platformWidget())
</del><ins>+        if (scrollableArea == view &amp;&amp; view-&gt;platformWidget())
</ins><span class="cx">             didHandleWheelEvent = false;
</span><span class="cx">         
</span><span class="cx">         return didHandleWheelEvent;
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    bool didHandleEvent = view ? view-&gt;wheelEvent(wheelEvent) : false;
</del><ins>+    bool didHandleEvent = view-&gt;wheelEvent(wheelEvent);
</ins><span class="cx">     m_isHandlingWheelEvent = false;
</span><del>-
-#if ENABLE(CSS_SCROLL_SNAP)
-    if (scrollableArea)
-        platformNotifySnapIfNecessary(wheelEvent, *scrollableArea);
-#endif
-
</del><span class="cx">     return didHandleEvent;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -995,16 +992,19 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if ENABLE(CSS_SCROLL_SNAP)
-void EventHandler::platformNotifySnapIfNecessary(const PlatformWheelEvent&amp; wheelEvent, ScrollableArea&amp; scrollableArea)
</del><ins>+void EventHandler::platformNotifyIfEndGesture(const PlatformWheelEvent&amp; wheelEvent, ScrollableArea* scrollableArea)
</ins><span class="cx"> {
</span><ins>+    if (!scrollableArea)
+        return;
+
</ins><span class="cx">     // Special case handling for ending wheel gesture to activate snap animation:
</span><span class="cx">     if (wheelEvent.phase() != PlatformWheelEventPhaseEnded &amp;&amp; wheelEvent.momentumPhase() != PlatformWheelEventPhaseEnded)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (ScrollAnimator* scrollAnimator = scrollableArea.existingScrollAnimator())
</del><ins>+#if ENABLE(CSS_SCROLL_SNAP)
+    if (ScrollAnimator* scrollAnimator = scrollableArea-&gt;existingScrollAnimator())
</ins><span class="cx">         scrollAnimator-&gt;processWheelEventForScrollSnap(wheelEvent);
</span><ins>+#endif
</ins><span class="cx"> }
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingmacScrollingTreeFrameScrollingNodeMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm (182333 => 182334)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm        2015-04-03 21:21:24 UTC (rev 182333)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm        2015-04-03 21:32:59 UTC (rev 182334)
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx"> 
</span><span class="cx"> ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac(ScrollingTree&amp; scrollingTree, ScrollingNodeID nodeID)
</span><span class="cx">     : ScrollingTreeFrameScrollingNode(scrollingTree, nodeID)
</span><del>-    , m_scrollController(this)
</del><ins>+    , m_scrollController(*this)
</ins><span class="cx">     , m_verticalScrollbarPainter(0)
</span><span class="cx">     , m_horizontalScrollbarPainter(0)
</span><span class="cx">     , m_lastScrollHadUnfilledPixels(false)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformPlatformWheelEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/PlatformWheelEvent.h (182333 => 182334)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/PlatformWheelEvent.h        2015-04-03 21:21:24 UTC (rev 182333)
+++ trunk/Source/WebCore/platform/PlatformWheelEvent.h        2015-04-03 21:32:59 UTC (rev 182334)
</span><span class="lines">@@ -162,26 +162,10 @@
</span><span class="cx">         unsigned scrollCount() const { return m_scrollCount; }
</span><span class="cx">         float unacceleratedScrollingDeltaX() const { return m_unacceleratedScrollingDeltaX; }
</span><span class="cx">         float unacceleratedScrollingDeltaY() const { return m_unacceleratedScrollingDeltaY; }
</span><del>-        bool useLatchedEventElement() const
-        {
-            return m_phase == PlatformWheelEventPhaseBegan || m_phase == PlatformWheelEventPhaseChanged
-                || m_momentumPhase == PlatformWheelEventPhaseBegan || m_momentumPhase == PlatformWheelEventPhaseChanged
-                || (m_phase == PlatformWheelEventPhaseEnded &amp;&amp; m_momentumPhase == PlatformWheelEventPhaseNone);
-        }
-        bool shouldConsiderLatching() const
-        {
-            return m_phase == PlatformWheelEventPhaseBegan || m_phase == PlatformWheelEventPhaseMayBegin;
-        }
-        bool shouldResetLatching() const
-        {
-            if (m_phase == PlatformWheelEventPhaseCancelled || m_phase == PlatformWheelEventPhaseMayBegin)
-                return true;
-            
-            if (m_phase == PlatformWheelEventPhaseNone &amp;&amp; m_momentumPhase == PlatformWheelEventPhaseEnded)
-                return true;
-            
-            return false;
-        }
</del><ins>+        bool useLatchedEventElement() const;
+        bool shouldConsiderLatching() const;
+        bool shouldResetLatching() const;
+        bool isEndGesture() const;
</ins><span class="cx"> #else
</span><span class="cx">         bool useLatchedEventElement() const { return false; }
</span><span class="cx"> #endif
</span><span class="lines">@@ -210,6 +194,31 @@
</span><span class="cx"> #endif
</span><span class="cx">     };
</span><span class="cx"> 
</span><ins>+#if PLATFORM(COCOA)
+    inline bool PlatformWheelEvent::useLatchedEventElement() const
+    {
+        return m_phase == PlatformWheelEventPhaseBegan || m_phase == PlatformWheelEventPhaseChanged
+        || m_momentumPhase == PlatformWheelEventPhaseBegan || m_momentumPhase == PlatformWheelEventPhaseChanged
+        || (m_phase == PlatformWheelEventPhaseEnded &amp;&amp; m_momentumPhase == PlatformWheelEventPhaseNone);
+    }
+    
+    inline bool PlatformWheelEvent::shouldConsiderLatching() const
+    {
+        return m_phase == PlatformWheelEventPhaseBegan || m_phase == PlatformWheelEventPhaseMayBegin;
+    }
+    
+    inline bool PlatformWheelEvent::shouldResetLatching() const
+    {
+        return m_phase == PlatformWheelEventPhaseCancelled || m_phase == PlatformWheelEventPhaseMayBegin || isEndGesture();
+    }
+    
+    inline bool PlatformWheelEvent::isEndGesture() const
+    {
+        return m_phase == PlatformWheelEventPhaseNone &amp;&amp; m_momentumPhase == PlatformWheelEventPhaseEnded;
+    }
+
+#endif
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // PlatformWheelEvent_h
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollAnimatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollAnimator.cpp (182333 => 182334)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollAnimator.cpp        2015-04-03 21:21:24 UTC (rev 182333)
+++ trunk/Source/WebCore/platform/ScrollAnimator.cpp        2015-04-03 21:32:59 UTC (rev 182334)
</span><span class="lines">@@ -50,7 +50,7 @@
</span><span class="cx"> ScrollAnimator::ScrollAnimator(ScrollableArea&amp; scrollableArea)
</span><span class="cx">     : m_scrollableArea(scrollableArea)
</span><span class="cx"> #if (ENABLE(CSS_SCROLL_SNAP) || ENABLE(RUBBER_BANDING)) &amp;&amp; PLATFORM(MAC)
</span><del>-    , m_scrollController(this)
</del><ins>+    , m_scrollController(*this)
</ins><span class="cx"> #endif
</span><span class="cx">     , m_currentPosX(0)
</span><span class="cx">     , m_currentPosY(0)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformcocoaScrollControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/cocoa/ScrollController.h (182333 => 182334)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cocoa/ScrollController.h        2015-04-03 21:21:24 UTC (rev 182333)
+++ trunk/Source/WebCore/platform/cocoa/ScrollController.h        2015-04-03 21:32:59 UTC (rev 182334)
</span><span class="lines">@@ -99,7 +99,7 @@
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(ScrollController);
</span><span class="cx"> 
</span><span class="cx"> public:
</span><del>-    explicit ScrollController(ScrollControllerClient*);
</del><ins>+    explicit ScrollController(ScrollControllerClient&amp;);
</ins><span class="cx"> 
</span><span class="cx">     bool handleWheelEvent(const PlatformWheelEvent&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -141,7 +141,7 @@
</span><span class="cx">     const ScrollSnapAnimatorState&amp; scrollSnapPointState(ScrollEventAxis) const;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    ScrollControllerClient* m_client;
</del><ins>+    ScrollControllerClient&amp; m_client;
</ins><span class="cx">     
</span><span class="cx">     CFTimeInterval m_lastMomentumScrollTimestamp;
</span><span class="cx">     FloatSize m_overflowScrollDelta;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformcocoaScrollControllermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/cocoa/ScrollController.mm (182333 => 182334)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cocoa/ScrollController.mm        2015-04-03 21:21:24 UTC (rev 182333)
+++ trunk/Source/WebCore/platform/cocoa/ScrollController.mm        2015-04-03 21:32:59 UTC (rev 182334)
</span><span class="lines">@@ -120,7 +120,7 @@
</span><span class="cx">     return multiplier;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ScrollController::ScrollController(ScrollControllerClient* client)
</del><ins>+ScrollController::ScrollController(ScrollControllerClient&amp; client)
</ins><span class="cx">     : m_client(client)
</span><span class="cx">     , m_lastMomentumScrollTimestamp(0)
</span><span class="cx">     , m_startTime(0)
</span><span class="lines">@@ -144,7 +144,7 @@
</span><span class="cx"> #endif
</span><span class="cx">     if (wheelEvent.phase() == PlatformWheelEventPhaseBegan) {
</span><span class="cx">         // First, check if we should rubber-band at all.
</span><del>-        if (m_client-&gt;pinnedInDirection(FloatSize(-wheelEvent.deltaX(), 0))
</del><ins>+        if (m_client.pinnedInDirection(FloatSize(-wheelEvent.deltaX(), 0))
</ins><span class="cx">             &amp;&amp; !shouldRubberBandInHorizontalDirection(wheelEvent))
</span><span class="cx">             return false;
</span><span class="cx"> 
</span><span class="lines">@@ -154,7 +154,7 @@
</span><span class="cx">         m_lastMomentumScrollTimestamp = 0;
</span><span class="cx">         m_momentumVelocity = FloatSize();
</span><span class="cx"> 
</span><del>-        IntSize stretchAmount = m_client-&gt;stretchAmount();
</del><ins>+        IntSize stretchAmount = m_client.stretchAmount();
</ins><span class="cx">         m_stretchScrollForce.setWidth(reboundDeltaForElasticDelta(stretchAmount.width()));
</span><span class="cx">         m_stretchScrollForce.setHeight(reboundDeltaForElasticDelta(stretchAmount.height()));
</span><span class="cx">         m_overflowScrollDelta = FloatSize();
</span><span class="lines">@@ -184,7 +184,7 @@
</span><span class="cx">     // Reset overflow values because we may decide to remove delta at various points and put it into overflow.
</span><span class="cx">     m_overflowScrollDelta = FloatSize();
</span><span class="cx"> 
</span><del>-    IntSize stretchAmount = m_client-&gt;stretchAmount();
</del><ins>+    IntSize stretchAmount = m_client.stretchAmount();
</ins><span class="cx">     bool isVerticallyStretched = stretchAmount.height();
</span><span class="cx">     bool isHorizontallyStretched = stretchAmount.width();
</span><span class="cx"> 
</span><span class="lines">@@ -228,7 +228,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if (isVerticallyStretched) {
</span><del>-            if (!isHorizontallyStretched &amp;&amp; m_client-&gt;pinnedInDirection(FloatSize(deltaX, 0))) {
</del><ins>+            if (!isHorizontallyStretched &amp;&amp; m_client.pinnedInDirection(FloatSize(deltaX, 0))) {
</ins><span class="cx">                 // Stretching only in the vertical.
</span><span class="cx">                 if (deltaY &amp;&amp; (fabsf(deltaX / deltaY) &lt; rubberbandDirectionLockStretchRatio))
</span><span class="cx">                     deltaX = 0;
</span><span class="lines">@@ -240,7 +240,7 @@
</span><span class="cx">             }
</span><span class="cx">         } else if (isHorizontallyStretched) {
</span><span class="cx">             // Stretching only in the horizontal.
</span><del>-            if (m_client-&gt;pinnedInDirection(FloatSize(0, deltaY))) {
</del><ins>+            if (m_client.pinnedInDirection(FloatSize(0, deltaY))) {
</ins><span class="cx">                 if (deltaX &amp;&amp; (fabsf(deltaY / deltaX) &lt; rubberbandDirectionLockStretchRatio))
</span><span class="cx">                     deltaY = 0;
</span><span class="cx">                 else if (fabsf(deltaY) &lt; rubberbandMinimumRequiredDeltaBeforeStretch) {
</span><span class="lines">@@ -251,7 +251,7 @@
</span><span class="cx">             }
</span><span class="cx">         } else {
</span><span class="cx">             // Not stretching at all yet.
</span><del>-            if (m_client-&gt;pinnedInDirection(FloatSize(deltaX, deltaY))) {
</del><ins>+            if (m_client.pinnedInDirection(FloatSize(deltaX, deltaY))) {
</ins><span class="cx">                 if (fabsf(deltaY) &gt;= fabsf(deltaX)) {
</span><span class="cx">                     if (fabsf(deltaX) &lt; rubberbandMinimumRequiredDeltaBeforeStretch) {
</span><span class="cx">                         m_overflowScrollDelta.setWidth(m_overflowScrollDelta.width() + deltaX);
</span><span class="lines">@@ -268,37 +268,37 @@
</span><span class="cx">         if (!(shouldStretch || isVerticallyStretched || isHorizontallyStretched)) {
</span><span class="cx">             if (deltaY) {
</span><span class="cx">                 deltaY *= scrollWheelMultiplier();
</span><del>-                m_client-&gt;immediateScrollBy(FloatSize(0, deltaY));
</del><ins>+                m_client.immediateScrollBy(FloatSize(0, deltaY));
</ins><span class="cx">             }
</span><span class="cx">             if (deltaX) {
</span><span class="cx">                 deltaX *= scrollWheelMultiplier();
</span><del>-                m_client-&gt;immediateScrollBy(FloatSize(deltaX, 0));
</del><ins>+                m_client.immediateScrollBy(FloatSize(deltaX, 0));
</ins><span class="cx">             }
</span><span class="cx">         } else {
</span><del>-            if (!m_client-&gt;allowsHorizontalStretching(wheelEvent)) {
</del><ins>+            if (!m_client.allowsHorizontalStretching(wheelEvent)) {
</ins><span class="cx">                 deltaX = 0;
</span><span class="cx">                 eventCoalescedDeltaX = 0;
</span><del>-            } else if (deltaX &amp;&amp; !isHorizontallyStretched &amp;&amp; !m_client-&gt;pinnedInDirection(FloatSize(deltaX, 0))) {
</del><ins>+            } else if (deltaX &amp;&amp; !isHorizontallyStretched &amp;&amp; !m_client.pinnedInDirection(FloatSize(deltaX, 0))) {
</ins><span class="cx">                 deltaX *= scrollWheelMultiplier();
</span><span class="cx"> 
</span><del>-                m_client-&gt;immediateScrollByWithoutContentEdgeConstraints(FloatSize(deltaX, 0));
</del><ins>+                m_client.immediateScrollByWithoutContentEdgeConstraints(FloatSize(deltaX, 0));
</ins><span class="cx">                 deltaX = 0;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            if (!m_client-&gt;allowsVerticalStretching(wheelEvent)) {
</del><ins>+            if (!m_client.allowsVerticalStretching(wheelEvent)) {
</ins><span class="cx">                 deltaY = 0;
</span><span class="cx">                 eventCoalescedDeltaY = 0;
</span><del>-            } else if (deltaY &amp;&amp; !isVerticallyStretched &amp;&amp; !m_client-&gt;pinnedInDirection(FloatSize(0, deltaY))) {
</del><ins>+            } else if (deltaY &amp;&amp; !isVerticallyStretched &amp;&amp; !m_client.pinnedInDirection(FloatSize(0, deltaY))) {
</ins><span class="cx">                 deltaY *= scrollWheelMultiplier();
</span><span class="cx"> 
</span><del>-                m_client-&gt;immediateScrollByWithoutContentEdgeConstraints(FloatSize(0, deltaY));
</del><ins>+                m_client.immediateScrollByWithoutContentEdgeConstraints(FloatSize(0, deltaY));
</ins><span class="cx">                 deltaY = 0;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            IntSize stretchAmount = m_client-&gt;stretchAmount();
</del><ins>+            IntSize stretchAmount = m_client.stretchAmount();
</ins><span class="cx"> 
</span><span class="cx">             if (m_momentumScrollInProgress) {
</span><del>-                if ((m_client-&gt;pinnedInDirection(FloatSize(eventCoalescedDeltaX, eventCoalescedDeltaY)) || (fabsf(eventCoalescedDeltaX) + fabsf(eventCoalescedDeltaY) &lt;= 0)) &amp;&amp; m_lastMomentumScrollTimestamp) {
</del><ins>+                if ((m_client.pinnedInDirection(FloatSize(eventCoalescedDeltaX, eventCoalescedDeltaY)) || (fabsf(eventCoalescedDeltaX) + fabsf(eventCoalescedDeltaY) &lt;= 0)) &amp;&amp; m_lastMomentumScrollTimestamp) {
</ins><span class="cx">                     m_ignoreMomentumScrolls = true;
</span><span class="cx">                     m_momentumScrollInProgress = false;
</span><span class="cx">                     snapRubberBand();
</span><span class="lines">@@ -310,7 +310,7 @@
</span><span class="cx"> 
</span><span class="cx">             FloatSize dampedDelta(ceilf(elasticDeltaForReboundDelta(m_stretchScrollForce.width())), ceilf(elasticDeltaForReboundDelta(m_stretchScrollForce.height())));
</span><span class="cx"> 
</span><del>-            m_client-&gt;immediateScrollByWithoutContentEdgeConstraints(dampedDelta - stretchAmount);
</del><ins>+            m_client.immediateScrollByWithoutContentEdgeConstraints(dampedDelta - stretchAmount);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">         CFTimeInterval timeDelta = [NSDate timeIntervalSinceReferenceDate] - m_startTime;
</span><span class="cx"> 
</span><span class="cx">         if (m_startStretch == FloatSize()) {
</span><del>-            m_startStretch = m_client-&gt;stretchAmount();
</del><ins>+            m_startStretch = m_client.stretchAmount();
</ins><span class="cx">             if (m_startStretch == FloatSize()) {
</span><span class="cx">                 stopSnapRubberbandTimer();
</span><span class="cx"> 
</span><span class="lines">@@ -355,7 +355,7 @@
</span><span class="cx">                 return;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            m_origOrigin = m_client-&gt;absoluteScrollPosition() - m_startStretch;
</del><ins>+            m_origOrigin = m_client.absoluteScrollPosition() - m_startStretch;
</ins><span class="cx">             m_origVelocity = m_momentumVelocity;
</span><span class="cx"> 
</span><span class="cx">             // Just like normal scrolling, prefer vertical rubberbanding
</span><span class="lines">@@ -363,11 +363,11 @@
</span><span class="cx">                 m_origVelocity.setWidth(0);
</span><span class="cx"> 
</span><span class="cx">             // Don't rubber-band horizontally if it's not possible to scroll horizontally
</span><del>-            if (!m_client-&gt;canScrollHorizontally())
</del><ins>+            if (!m_client.canScrollHorizontally())
</ins><span class="cx">                 m_origVelocity.setWidth(0);
</span><span class="cx"> 
</span><span class="cx">             // Don't rubber-band vertically if it's not possible to scroll vertically
</span><del>-            if (!m_client-&gt;canScrollVertically())
</del><ins>+            if (!m_client.canScrollVertically())
</ins><span class="cx">                 m_origVelocity.setHeight(0);
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -375,14 +375,14 @@
</span><span class="cx">             roundToDevicePixelTowardZero(elasticDeltaForTimeDelta(m_startStretch.height(), -m_origVelocity.height(), (float)timeDelta)));
</span><span class="cx"> 
</span><span class="cx">         if (fabs(delta.x()) &gt;= 1 || fabs(delta.y()) &gt;= 1) {
</span><del>-            m_client-&gt;immediateScrollByWithoutContentEdgeConstraints(FloatSize(delta.x(), delta.y()) - m_client-&gt;stretchAmount());
</del><ins>+            m_client.immediateScrollByWithoutContentEdgeConstraints(FloatSize(delta.x(), delta.y()) - m_client.stretchAmount());
</ins><span class="cx"> 
</span><del>-            FloatSize newStretch = m_client-&gt;stretchAmount();
</del><ins>+            FloatSize newStretch = m_client.stretchAmount();
</ins><span class="cx"> 
</span><span class="cx">             m_stretchScrollForce.setWidth(reboundDeltaForElasticDelta(newStretch.width()));
</span><span class="cx">             m_stretchScrollForce.setHeight(reboundDeltaForElasticDelta(newStretch.height()));
</span><span class="cx">         } else {
</span><del>-            m_client-&gt;adjustScrollPositionToBoundsIfNecessary();
</del><ins>+            m_client.adjustScrollPositionToBoundsIfNecessary();
</ins><span class="cx"> 
</span><span class="cx">             stopSnapRubberbandTimer();
</span><span class="cx">             m_stretchScrollForce = FloatSize();
</span><span class="lines">@@ -394,6 +394,8 @@
</span><span class="cx">     } else {
</span><span class="cx">         m_startTime = [NSDate timeIntervalSinceReferenceDate];
</span><span class="cx">         m_startStretch = FloatSize();
</span><ins>+        if (!isRubberBandInProgress())
+            stopSnapRubberbandTimer();
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -402,18 +404,18 @@
</span><span class="cx">     if (!m_inScrollGesture &amp;&amp; !m_momentumScrollInProgress &amp;&amp; !m_snapRubberbandTimerIsActive)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    return !m_client-&gt;stretchAmount().isZero();
</del><ins>+    return !m_client.stretchAmount().isZero();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ScrollController::startSnapRubberbandTimer()
</span><span class="cx"> {
</span><del>-    m_client-&gt;startSnapRubberbandTimer();
</del><ins>+    m_client.startSnapRubberbandTimer();
</ins><span class="cx">     m_snapRubberbandTimer.startRepeating(1.0 / 60.0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ScrollController::stopSnapRubberbandTimer()
</span><span class="cx"> {
</span><del>-    m_client-&gt;stopSnapRubberbandTimer();
</del><ins>+    m_client.stopSnapRubberbandTimer();
</ins><span class="cx">     m_snapRubberbandTimer.stop();
</span><span class="cx">     m_snapRubberbandTimerIsActive = false;
</span><span class="cx"> }
</span><span class="lines">@@ -441,9 +443,9 @@
</span><span class="cx"> bool ScrollController::shouldRubberBandInHorizontalDirection(const PlatformWheelEvent&amp; wheelEvent)
</span><span class="cx"> {
</span><span class="cx">     if (wheelEvent.deltaX() &gt; 0)
</span><del>-        return m_client-&gt;shouldRubberBandInDirection(ScrollLeft);
</del><ins>+        return m_client.shouldRubberBandInDirection(ScrollLeft);
</ins><span class="cx">     if (wheelEvent.deltaX() &lt; 0)
</span><del>-        return m_client-&gt;shouldRubberBandInDirection(ScrollRight);
</del><ins>+        return m_client.shouldRubberBandInDirection(ScrollRight);
</ins><span class="cx"> 
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="lines">@@ -526,7 +528,7 @@
</span><span class="cx">         // Begin tracking wheel deltas for glide prediction.
</span><span class="cx">         endScrollSnapAnimation(axis, ScrollSnapState::UserInteraction);
</span><span class="cx">         snapState.pushInitialWheelDelta(wheelDelta);
</span><del>-        snapState.m_beginTrackingWheelDeltaOffset = m_client-&gt;scrollOffsetOnAxis(axis);
</del><ins>+        snapState.m_beginTrackingWheelDeltaOffset = m_client.scrollOffsetOnAxis(axis);
</ins><span class="cx">         break;
</span><span class="cx">             
</span><span class="cx">     case WheelEventStatus::InertialScrolling:
</span><span class="lines">@@ -608,14 +610,14 @@
</span><span class="cx"> {
</span><span class="cx">     RunLoop::Timer&lt;ScrollController&gt;&amp; scrollSnapTimer = axis == ScrollEventAxis::Horizontal ? m_horizontalScrollSnapTimer : m_verticalScrollSnapTimer;
</span><span class="cx">     if (!scrollSnapTimer.isActive()) {
</span><del>-        m_client-&gt;startScrollSnapTimer(axis);
</del><ins>+        m_client.startScrollSnapTimer(axis);
</ins><span class="cx">         scrollSnapTimer.startRepeating(1.0 / 60.0);
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ScrollController::stopScrollSnapTimer(ScrollEventAxis axis)
</span><span class="cx"> {
</span><del>-    m_client-&gt;stopScrollSnapTimer(axis);
</del><ins>+    m_client.stopScrollSnapTimer(axis);
</ins><span class="cx">     RunLoop::Timer&lt;ScrollController&gt;&amp; scrollSnapTimer = axis == ScrollEventAxis::Horizontal ? m_horizontalScrollSnapTimer : m_verticalScrollSnapTimer;
</span><span class="cx">     scrollSnapTimer.stop();
</span><span class="cx"> }
</span><span class="lines">@@ -645,7 +647,7 @@
</span><span class="cx">     ASSERT(snapState.m_currentState == ScrollSnapState::Gliding || snapState.m_currentState == ScrollSnapState::Snapping);
</span><span class="cx">     float delta = snapState.m_currentState == ScrollSnapState::Snapping ? computeSnapDelta(axis) : computeGlideDelta(axis);
</span><span class="cx">     if (delta)
</span><del>-        m_client-&gt;immediateScrollOnAxis(axis, delta);
</del><ins>+        m_client.immediateScrollOnAxis(axis, delta);
</ins><span class="cx">     else
</span><span class="cx">         endScrollSnapAnimation(axis, ScrollSnapState::DestinationReached);
</span><span class="cx"> }
</span><span class="lines">@@ -678,13 +680,13 @@
</span><span class="cx">     
</span><span class="cx">     ScrollSnapAnimatorState&amp; snapState = scrollSnapPointState(axis);
</span><span class="cx"> 
</span><del>-    LayoutUnit offset = m_client-&gt;scrollOffsetOnAxis(axis);
</del><ins>+    LayoutUnit offset = m_client.scrollOffsetOnAxis(axis);
</ins><span class="cx">     float initialWheelDelta = newState == ScrollSnapState::Gliding ? snapState.averageInitialWheelDelta() : 0;
</span><span class="cx">     LayoutUnit projectedScrollDestination = newState == ScrollSnapState::Gliding ? snapState.m_beginTrackingWheelDeltaOffset + LayoutUnit(projectedInertialScrollDistance(initialWheelDelta)) : offset;
</span><span class="cx">     if (snapState.m_snapOffsets.isEmpty())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    float scaleFactor = m_client-&gt;pageScaleFactor();
</del><ins>+    float scaleFactor = m_client.pageScaleFactor();
</ins><span class="cx">     
</span><span class="cx">     projectedScrollDestination = std::min(std::max(LayoutUnit(projectedScrollDestination / scaleFactor), snapState.m_snapOffsets.first()), snapState.m_snapOffsets.last());
</span><span class="cx">     snapState.m_initialOffset = offset;
</span><span class="lines">@@ -743,7 +745,7 @@
</span><span class="cx"> {
</span><span class="cx">     const ScrollSnapAnimatorState&amp; snapState = scrollSnapPointState(axis);
</span><span class="cx"> 
</span><del>-    LayoutUnit offset = m_client-&gt;scrollOffsetOnAxis(axis);
</del><ins>+    LayoutUnit offset = m_client.scrollOffsetOnAxis(axis);
</ins><span class="cx">     bool canComputeSnap =  (snapState.m_initialOffset &lt;= offset &amp;&amp; offset &lt; snapState.m_targetOffset) || (snapState.m_targetOffset &lt; offset &amp;&amp; offset &lt;= snapState.m_initialOffset);
</span><span class="cx">     if (snapState.m_currentState != ScrollSnapState::Snapping || !canComputeSnap)
</span><span class="cx">         return 0;
</span><span class="lines">@@ -790,7 +792,7 @@
</span><span class="cx"> {
</span><span class="cx">     const ScrollSnapAnimatorState&amp; snapState = scrollSnapPointState(axis);
</span><span class="cx"> 
</span><del>-    LayoutUnit offset = m_client-&gt;scrollOffsetOnAxis(axis);
</del><ins>+    LayoutUnit offset = m_client.scrollOffsetOnAxis(axis);
</ins><span class="cx">     bool canComputeGlide = (snapState.m_initialOffset &lt;= offset &amp;&amp; offset &lt; snapState.m_targetOffset) || (snapState.m_targetOffset &lt; offset &amp;&amp; offset &lt;= snapState.m_initialOffset);
</span><span class="cx">     if (snapState.m_currentState != ScrollSnapState::Gliding || !canComputeGlide)
</span><span class="cx">         return 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacScrollAnimatorMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm (182333 => 182334)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm        2015-04-03 21:21:24 UTC (rev 182333)
+++ trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm        2015-04-03 21:32:59 UTC (rev 182334)
</span><span class="lines">@@ -1154,10 +1154,8 @@
</span><span class="cx">     if (!snapOffsets)
</span><span class="cx">         return false;
</span><span class="cx">     
</span><del>-    if ((wheelEvent.phase() != PlatformWheelEventPhaseEnded)
-        &amp;&amp; !(wheelEvent.phase() == PlatformWheelEventPhaseNone &amp;&amp; wheelEvent.momentumPhase() == PlatformWheelEventPhaseEnded)) {
</del><ins>+    if (wheelEvent.phase() != PlatformWheelEventPhaseEnded &amp;&amp; !wheelEvent.isEndGesture())
</ins><span class="cx">         return false;
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     return true;
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>