Add two (currently unused) new member functions to ScrollElasticityControllerClient
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Dec 2011 18:18:23 +0000 (18:18 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Dec 2011 18:18:23 +0000 (18:18 +0000)
https://bugs.webkit.org/show_bug.cgi?id=75179

Reviewed by Dan Bernstein.

This is so we'll be able to move more code to ScrollElasticityController.

* platform/mac/ScrollAnimatorMac.h:
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::pinnedInDirection):
(WebCore::ScrollAnimatorMac::immediateScrollByWithoutContentEdgeConstraints):
* platform/mac/ScrollElasticityController.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@103634 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/mac/ScrollAnimatorMac.h
Source/WebCore/platform/mac/ScrollAnimatorMac.mm
Source/WebCore/platform/mac/ScrollElasticityController.h

index cf1114e..b23d6a5 100644 (file)
@@ -1,3 +1,18 @@
+2011-12-23  Anders Carlsson  <andersca@apple.com>
+
+        Add two (currently unused) new member functions to ScrollElasticityControllerClient
+        https://bugs.webkit.org/show_bug.cgi?id=75179
+
+        Reviewed by Dan Bernstein.
+
+        This is so we'll be able to move more code to ScrollElasticityController.
+
+        * platform/mac/ScrollAnimatorMac.h:
+        * platform/mac/ScrollAnimatorMac.mm:
+        (WebCore::ScrollAnimatorMac::pinnedInDirection):
+        (WebCore::ScrollAnimatorMac::immediateScrollByWithoutContentEdgeConstraints):
+        * platform/mac/ScrollElasticityController.h:
+
 2011-12-23  Simon Fraser  <simon.fraser@apple.com>
 
         Blur filter doesn't invalidate enough
index 4ac0e57..29c13aa 100644 (file)
@@ -124,11 +124,12 @@ private:
 
     void immediateScrollTo(const FloatPoint&);
     void immediateScrollBy(const FloatSize&);
-    void immediateScrollByWithoutContentEdgeConstraints(const FloatSize&);
 
 #if ENABLE(RUBBER_BANDING)
     /// ScrollElasticityControllerClient member functions.
     virtual IntSize stretchAmount() OVERRIDE;
+    virtual bool pinnedInDirection(const FloatSize&) OVERRIDE;
+    virtual void immediateScrollByWithoutContentEdgeConstraints(const FloatSize&) OVERRIDE;
     virtual void startSnapRubberbandTimer() OVERRIDE;
     virtual void stopSnapRubberbandTimer() OVERRIDE;
 
index c60f245..884a87d 100644 (file)
@@ -703,13 +703,6 @@ void ScrollAnimatorMac::immediateScrollBy(const FloatSize& delta)
     notifyPositionChanged();
 }
 
-void ScrollAnimatorMac::immediateScrollByWithoutContentEdgeConstraints(const FloatSize& delta)
-{
-    m_scrollableArea->setConstrainsScrollingToContentEdge(false);
-    immediateScrollBy(delta);
-    m_scrollableArea->setConstrainsScrollingToContentEdge(true);
-}
-
 void ScrollAnimatorMac::immediateScrollToPointForScrollAnimation(const FloatPoint& newPosition)
 {
     ASSERT(m_scrollAnimationHelper);
@@ -1067,6 +1060,18 @@ IntSize ScrollAnimatorMac::stretchAmount()
     return m_scrollableArea->overhangAmount();
 }
 
+bool ScrollAnimatorMac::pinnedInDirection(const FloatSize& direction)
+{
+    return pinnedInDirection(direction.width(), direction.height());
+}
+
+void ScrollAnimatorMac::immediateScrollByWithoutContentEdgeConstraints(const FloatSize& delta)
+{
+    m_scrollableArea->setConstrainsScrollingToContentEdge(false);
+    immediateScrollBy(delta);
+    m_scrollableArea->setConstrainsScrollingToContentEdge(true);
+}
+
 void ScrollAnimatorMac::startSnapRubberbandTimer()
 {
     m_snapRubberBandTimer.startRepeating(1.0 / 60.0);
index 486370b..f1b89b2 100644 (file)
@@ -40,7 +40,8 @@ protected:
 
 public:
     virtual IntSize stretchAmount() = 0;
-
+    virtual bool pinnedInDirection(const FloatSize&) = 0;
+    virtual void immediateScrollByWithoutContentEdgeConstraints(const FloatSize&) = 0;
     virtual void startSnapRubberbandTimer() = 0;
     virtual void stopSnapRubberbandTimer() = 0;
 };