Title: [135638] trunk/Source
Revision
135638
Author
[email protected]
Date
2012-11-23 16:42:39 -0800 (Fri, 23 Nov 2012)

Log Message

Remove unused ScrollByPixelVelocity
https://bugs.webkit.org/show_bug.cgi?id=102840

Reviewed by Sam Weinig.

Source/WebCore:

https://bugs.webkit.org/show_bug.cgi?id=80311 wrongly introduced a new
kind of scroll: "ScrollByPixelVelocity". This code is not used on any platform
and will not be of use in the future so this patch removes it.

No new tests: code removal/cleanup.

* page/EventHandler.cpp:
(WebCore::EventHandler::defaultWheelEventHandler):
(WebCore::EventHandler::handleGestureEvent):
* platform/PlatformWheelEvent.h:
* platform/ScrollAnimator.cpp:
(WebCore::ScrollAnimator::handleWheelEvent):
* platform/ScrollAnimatorNone.cpp:
(WebCore::ScrollAnimatorNone::ScrollAnimatorNone):
(WebCore::ScrollAnimatorNone::scroll):
(WebCore::ScrollAnimatorNone::cancelAnimations):
(WebCore::ScrollAnimatorNone::animationTimerFired):
* platform/ScrollAnimatorNone.h:
(ScrollAnimatorNone):
* platform/ScrollTypes.h:
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::scroll):

Source/WebKit/chromium:

Removed test for deleted code.

* tests/ScrollAnimatorNoneTest.cpp:

Source/WTF:

The GESTURE_ANIMATION feature turns on code in WebCore is unused.
Remove it.

No new tests: code removal/cleanup.

* wtf/Platform.h:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (135637 => 135638)


--- trunk/Source/WTF/ChangeLog	2012-11-23 23:20:20 UTC (rev 135637)
+++ trunk/Source/WTF/ChangeLog	2012-11-24 00:42:39 UTC (rev 135638)
@@ -1,3 +1,17 @@
+2012-11-23  Robert Kroeger  <[email protected]>
+
+        Remove unused ScrollByPixelVelocity
+        https://bugs.webkit.org/show_bug.cgi?id=102840
+
+        Reviewed by Sam Weinig.
+
+        The GESTURE_ANIMATION feature turns on code in WebCore is unused.
+        Remove it.
+
+        No new tests: code removal/cleanup.
+
+        * wtf/Platform.h:
+
 2012-11-23  Laszlo Gombos  <[email protected]>
 
         [EFL] Define WTF_PLATFORM_EFL in Platform.h

Modified: trunk/Source/WTF/wtf/Platform.h (135637 => 135638)


--- trunk/Source/WTF/wtf/Platform.h	2012-11-23 23:20:20 UTC (rev 135637)
+++ trunk/Source/WTF/wtf/Platform.h	2012-11-24 00:42:39 UTC (rev 135638)
@@ -824,14 +824,6 @@
 #endif
 #endif
 
-#if !defined(ENABLE_GESTURE_ANIMATION)
-#if PLATFORM(QT) || !ENABLE(SMOOTH_SCROLLING)
-#define ENABLE_GESTURE_ANIMATION 0
-#else
-#define ENABLE_GESTURE_ANIMATION 1
-#endif
-#endif
-
 #if !defined(ENABLE_SATURATED_LAYOUT_ARITHMETIC)
 #define ENABLE_SATURATED_LAYOUT_ARITHMETIC 0
 #endif

Modified: trunk/Source/WebCore/ChangeLog (135637 => 135638)


--- trunk/Source/WebCore/ChangeLog	2012-11-23 23:20:20 UTC (rev 135637)
+++ trunk/Source/WebCore/ChangeLog	2012-11-24 00:42:39 UTC (rev 135638)
@@ -1,3 +1,33 @@
+2012-11-23  Robert Kroeger  <[email protected]>
+
+        Remove unused ScrollByPixelVelocity
+        https://bugs.webkit.org/show_bug.cgi?id=102840
+
+        Reviewed by Sam Weinig.
+
+        https://bugs.webkit.org/show_bug.cgi?id=80311 wrongly introduced a new
+        kind of scroll: "ScrollByPixelVelocity". This code is not used on any platform
+        and will not be of use in the future so this patch removes it.
+
+        No new tests: code removal/cleanup.
+
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::defaultWheelEventHandler):
+        (WebCore::EventHandler::handleGestureEvent):
+        * platform/PlatformWheelEvent.h:
+        * platform/ScrollAnimator.cpp:
+        (WebCore::ScrollAnimator::handleWheelEvent):
+        * platform/ScrollAnimatorNone.cpp:
+        (WebCore::ScrollAnimatorNone::ScrollAnimatorNone):
+        (WebCore::ScrollAnimatorNone::scroll):
+        (WebCore::ScrollAnimatorNone::cancelAnimations):
+        (WebCore::ScrollAnimatorNone::animationTimerFired):
+        * platform/ScrollAnimatorNone.h:
+        (ScrollAnimatorNone):
+        * platform/ScrollTypes.h:
+        * platform/ScrollableArea.cpp:
+        (WebCore::ScrollableArea::scroll):
+
 2012-11-23  Adenilson Cavalcanti  <[email protected]>
 
         Removing unnecessary RenderBox friend access in RenderObject

Modified: trunk/Source/WebCore/page/EventHandler.cpp (135637 => 135638)


--- trunk/Source/WebCore/page/EventHandler.cpp	2012-11-23 23:20:20 UTC (rev 135637)
+++ trunk/Source/WebCore/page/EventHandler.cpp	2012-11-24 00:42:39 UTC (rev 135638)
@@ -2481,7 +2481,7 @@
         return;
     
     Node* stopNode = m_previousWheelScrolledNode.get();
-    ScrollGranularity granularity = m_baseEventType == PlatformEvent::GestureScrollEnd ? ScrollByPixelVelocity : wheelGranularityToScrollGranularity(wheelEvent->granularity());
+    ScrollGranularity granularity = wheelGranularityToScrollGranularity(wheelEvent->granularity());
     
     // 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).
@@ -2588,8 +2588,6 @@
     switch (gestureEvent.type()) {
     case PlatformEvent::GestureScrollBegin:
         return handleGestureScrollCore(gestureEvent, ScrollByPixelWheelEvent, false);
-    case PlatformEvent::GestureScrollEnd:
-        return handleGestureScrollCore(gestureEvent, ScrollByPixelVelocityWheelEvent, true);
     case PlatformEvent::GestureScrollUpdate:
         return handleGestureScrollUpdate(gestureEvent);
     case PlatformEvent::GestureTap:
@@ -2600,6 +2598,7 @@
         return handleGestureLongPress(gestureEvent);
     case PlatformEvent::GestureTwoFingerTap:
         return handleGestureTwoFingerTap(gestureEvent);
+    case PlatformEvent::GestureScrollEnd:
     case PlatformEvent::GestureDoubleTap:
     case PlatformEvent::GesturePinchBegin:
     case PlatformEvent::GesturePinchEnd:

Modified: trunk/Source/WebCore/platform/PlatformWheelEvent.h (135637 => 135638)


--- trunk/Source/WebCore/platform/PlatformWheelEvent.h	2012-11-23 23:20:20 UTC (rev 135637)
+++ trunk/Source/WebCore/platform/PlatformWheelEvent.h	2012-11-24 00:42:39 UTC (rev 135638)
@@ -58,7 +58,6 @@
     enum PlatformWheelEventGranularity {
         ScrollByPageWheelEvent,
         ScrollByPixelWheelEvent,
-        ScrollByPixelVelocityWheelEvent
     };
 
 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))

Modified: trunk/Source/WebCore/platform/ScrollAnimator.cpp (135637 => 135638)


--- trunk/Source/WebCore/platform/ScrollAnimator.cpp	2012-11-23 23:20:20 UTC (rev 135637)
+++ trunk/Source/WebCore/platform/ScrollAnimator.cpp	2012-11-24 00:42:39 UTC (rev 135638)
@@ -104,11 +104,6 @@
         || (deltaY < 0 && maxForwardScrollDelta.height() > 0)
         || (deltaY > 0 && maxBackwardScrollDelta.height() > 0)) {
         handled = true;
-        if (e.granularity() == ScrollByPixelVelocityWheelEvent) {
-            scroll(VerticalScrollbar, ScrollByPixelVelocity, 0, -deltaY);
-            scroll(HorizontalScrollbar, ScrollByPixelVelocity, 0, -deltaX);
-            return handled;
-        }
 
         if (deltaY) {
             if (e.granularity() == ScrollByPageWheelEvent) {

Modified: trunk/Source/WebCore/platform/ScrollAnimatorNone.cpp (135637 => 135638)


--- trunk/Source/WebCore/platform/ScrollAnimatorNone.cpp	2012-11-23 23:20:20 UTC (rev 135637)
+++ trunk/Source/WebCore/platform/ScrollAnimatorNone.cpp	2012-11-24 00:42:39 UTC (rev 135638)
@@ -44,12 +44,6 @@
 #include <wtf/CurrentTime.h>
 #include <wtf/PassOwnPtr.h>
 
-#if ENABLE(GESTURE_ANIMATION)
-#include "ActivePlatformGestureAnimation.h"
-#include "TouchFlingPlatformGestureCurve.h"
-#endif
-
-
 #if PLATFORM(CHROMIUM)
 #include "TraceEvent.h"
 #endif
@@ -392,9 +386,6 @@
 #else
     , m_animationActive(false)
 #endif
-    , m_firstVelocity(0)
-    , m_firstVelocitySet(false)
-    , m_firstVelocityIsVertical(false)
 {
 }
 
@@ -403,20 +394,6 @@
     stopAnimationTimerIfNeeded();
 }
 
-void ScrollAnimatorNone::fireUpAnAnimation(FloatPoint fp)
-{
-#if ENABLE(GESTURE_ANIMATION)
-    if (m_gestureAnimation)
-        m_gestureAnimation.clear();
-    m_gestureAnimation = ActivePlatformGestureAnimation::create(TouchFlingPlatformGestureCurve::createForTouchPad(fp), this);
-#endif
-#if USE(REQUEST_ANIMATION_FRAME_TIMER)
-    startNextTimer(0);
-#else
-    startNextTimer();
-#endif
-}
-
 ScrollAnimatorNone::Parameters ScrollAnimatorNone::parametersForScrollGranularity(ScrollGranularity granularity) const
 {
 #if !PLATFORM(QT)
@@ -472,21 +449,6 @@
         break;
     case ScrollByPrecisePixel:
         return ScrollAnimator::scroll(orientation, granularity, step, multiplier);
-    case ScrollByPixelVelocity:
-        // FIXME: Generalize the scroll interface to support a richer set of parameters.
-        if (m_firstVelocitySet) {
-            float x = m_firstVelocityIsVertical ? multiplier : m_firstVelocity;
-            float y = m_firstVelocityIsVertical ? m_firstVelocity : multiplier;
-            FloatPoint fp(x, y);
-            fireUpAnAnimation(fp);
-            m_firstVelocitySet = false;
-            m_firstVelocityIsVertical = false;
-        } else {
-            m_firstVelocitySet = true;
-            m_firstVelocityIsVertical = orientation == VerticalScrollbar;
-            m_firstVelocity = multiplier;
-        }
-        return true;
     }
 
     // If the individual input setting is disabled, bail.
@@ -525,9 +487,6 @@
 void ScrollAnimatorNone::cancelAnimations()
 {
     m_animationActive = false;
-#if ENABLE(GESTURE_ANIMATION)
-    m_gestureAnimation.clear();
-#endif
 }
 
 void ScrollAnimatorNone::serviceScrollAnimations()
@@ -581,15 +540,6 @@
     if (m_verticalData.m_startTime && m_verticalData.animateScroll(currentTime))
         continueAnimation = true;
 
-#if ENABLE(GESTURE_ANIMATION)
-    if (m_gestureAnimation) {
-        if (m_gestureAnimation->animate(currentTime))
-            continueAnimation = true;
-        else
-            m_gestureAnimation.clear();
-    }
-#endif
-
     if (continueAnimation)
 #if USE(REQUEST_ANIMATION_FRAME_TIMER)
         startNextTimer(max(kMinimumTimerInterval, deltaToNextFrame));

Modified: trunk/Source/WebCore/platform/ScrollAnimatorNone.h (135637 => 135638)


--- trunk/Source/WebCore/platform/ScrollAnimatorNone.h	2012-11-23 23:20:20 UTC (rev 135637)
+++ trunk/Source/WebCore/platform/ScrollAnimatorNone.h	2012-11-24 00:42:39 UTC (rev 135638)
@@ -38,7 +38,6 @@
 #endif
 
 #include "FloatPoint.h"
-#include "PlatformGestureCurveTarget.h"
 #include "ScrollAnimator.h"
 #include "Timer.h"
 #include <wtf/OwnPtr.h>
@@ -51,7 +50,7 @@
 class ActivePlatformGestureAnimation;
 struct ScrollAnimatorParameters;
 
-class ScrollAnimatorNone : public ScrollAnimator, public PlatformGestureCurveTarget {
+class ScrollAnimatorNone : public ScrollAnimator {
 public:
     explicit ScrollAnimatorNone(ScrollableArea*);
     virtual ~ScrollAnimatorNone();
@@ -159,7 +158,6 @@
     void stopAnimationTimerIfNeeded();
     bool animationTimerActive();
     void updateVisibleLengths();
-    virtual void fireUpAnAnimation(FloatPoint);
 
     PerAxisData m_horizontalData;
     PerAxisData m_verticalData;
@@ -170,14 +168,6 @@
 #else
     bool m_animationActive;
 #endif
-
-    float m_firstVelocity;
-    bool m_firstVelocitySet;
-    bool m_firstVelocityIsVertical;
-
-#if ENABLE(GESTURE_ANIMATION)
-    OwnPtr<ActivePlatformGestureAnimation> m_gestureAnimation;
-#endif
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/ScrollTypes.h (135637 => 135638)


--- trunk/Source/WebCore/platform/ScrollTypes.h	2012-11-23 23:20:20 UTC (rev 135637)
+++ trunk/Source/WebCore/platform/ScrollTypes.h	2012-11-24 00:42:39 UTC (rev 135638)
@@ -106,7 +106,6 @@
         ScrollByPage,
         ScrollByDocument,
         ScrollByPixel,
-        ScrollByPixelVelocity,
         ScrollByPrecisePixel
     };
 

Modified: trunk/Source/WebCore/platform/ScrollableArea.cpp (135637 => 135638)


--- trunk/Source/WebCore/platform/ScrollableArea.cpp	2012-11-23 23:20:20 UTC (rev 135637)
+++ trunk/Source/WebCore/platform/ScrollableArea.cpp	2012-11-24 00:42:39 UTC (rev 135638)
@@ -115,11 +115,9 @@
     case ScrollByPrecisePixel:
         step = scrollbar->pixelStep();
         break;
-    case ScrollByPixelVelocity:
-        break;
     }
 
-    if (granularity != ScrollByPixelVelocity && (direction == ScrollUp || direction == ScrollLeft))
+    if (direction == ScrollUp || direction == ScrollLeft)
         multiplier = -multiplier;
 
     return scrollAnimator()->scroll(orientation, granularity, step, multiplier);

Modified: trunk/Source/WebKit/chromium/ChangeLog (135637 => 135638)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-11-23 23:20:20 UTC (rev 135637)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-11-24 00:42:39 UTC (rev 135638)
@@ -1,3 +1,14 @@
+2012-11-23  Robert Kroeger  <[email protected]>
+
+        Remove unused ScrollByPixelVelocity
+        https://bugs.webkit.org/show_bug.cgi?id=102840
+
+        Reviewed by Sam Weinig.
+
+        Removed test for deleted code.
+
+        * tests/ScrollAnimatorNoneTest.cpp:
+
 2012-11-23  Alexis Menard  <[email protected]>
 
         [CSS3 Backgrounds and Borders] Implement new CSS3 background-position parsing.

Modified: trunk/Source/WebKit/chromium/tests/ScrollAnimatorNoneTest.cpp (135637 => 135638)


--- trunk/Source/WebKit/chromium/tests/ScrollAnimatorNoneTest.cpp	2012-11-23 23:20:20 UTC (rev 135637)
+++ trunk/Source/WebKit/chromium/tests/ScrollAnimatorNoneTest.cpp	2012-11-24 00:42:39 UTC (rev 135638)
@@ -146,30 +146,6 @@
     scrollAnimatorNone.reset();
 }
 
-TEST(ScrollAnimatorEnabled, flingScrollEncoding)
-{
-    MockScrollableArea scrollableArea(true);
-    MockScrollAnimatorNone scrollAnimatorNone(&scrollableArea);
-
-    scrollAnimatorNone.reset();
-
-    scrollAnimatorNone.scroll(HorizontalScrollbar, ScrollByPixelVelocity, 111, -42);
-    scrollAnimatorNone.scroll(VerticalScrollbar, ScrollByPixelVelocity, 222, 42);
-    EXPECT_EQ(-42, scrollAnimatorNone.m_fp.x());
-    EXPECT_EQ(42, scrollAnimatorNone.m_fp.y());
-    EXPECT_EQ(1, scrollAnimatorNone.m_count);
-    scrollAnimatorNone.reset();
-
-    scrollAnimatorNone.scroll(VerticalScrollbar, ScrollByPixelVelocity, 222, 42);
-    scrollAnimatorNone.scroll(HorizontalScrollbar, ScrollByPixelVelocity, 111, -42);
-    EXPECT_EQ(-42, scrollAnimatorNone.m_fp.x());
-    EXPECT_EQ(42, scrollAnimatorNone.m_fp.y());
-    EXPECT_EQ(1, scrollAnimatorNone.m_count);
-    scrollAnimatorNone.reset();
-}
-
-
-
 TEST(ScrollAnimatorEnabled, Disabled)
 {
     MockScrollableArea scrollableArea(false);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to