Changeset 104312 in webkit


Ignore:
Timestamp:
Jan 6, 2012 12:01:55 PM (12 years ago)
Author:
andersca@apple.com
Message:

Add ScrollElasticityControllerClient::immediateScrollBy
https://bugs.webkit.org/show_bug.cgi?id=75720

Reviewed by Andreas Kling.

Add a new ScrollElasticityControllerClient::immediateScrollBy client member function.
Also, make ScrollAnimatorMac::smoothScrollWithEvent calls go through the ScrollElasticityController
in preparation for moving that function to ScrollElasticityController.

  • platform/mac/ScrollAnimatorMac.h:
  • platform/mac/ScrollAnimatorMac.mm:

(WebCore::ScrollAnimatorMac::smoothScrollWithEvent):

  • platform/mac/ScrollElasticityController.h:
Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r104308 r104312  
     12012-01-06  Anders Carlsson  <andersca@apple.com>
     2
     3        Add ScrollElasticityControllerClient::immediateScrollBy
     4        https://bugs.webkit.org/show_bug.cgi?id=75720
     5
     6        Reviewed by Andreas Kling.
     7
     8        Add a new ScrollElasticityControllerClient::immediateScrollBy client member function.
     9        Also, make ScrollAnimatorMac::smoothScrollWithEvent calls go through the ScrollElasticityController
     10        in preparation for moving that function to ScrollElasticityController.
     11
     12        * platform/mac/ScrollAnimatorMac.h:
     13        * platform/mac/ScrollAnimatorMac.mm:
     14        (WebCore::ScrollAnimatorMac::smoothScrollWithEvent):
     15        * platform/mac/ScrollElasticityController.h:
     16
    1172012-01-06  Wei James  <james.wei@intel.com>
    218
  • trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.h

    r103634 r104312  
    124124
    125125    void immediateScrollTo(const FloatPoint&);
    126     void immediateScrollBy(const FloatSize&);
    127126
    128127#if ENABLE(RUBBER_BANDING)
     
    131130    virtual bool pinnedInDirection(const FloatSize&) OVERRIDE;
    132131    virtual void immediateScrollByWithoutContentEdgeConstraints(const FloatSize&) OVERRIDE;
     132    virtual void immediateScrollBy(const FloatSize&) OVERRIDE;
    133133    virtual void startSnapRubberbandTimer() OVERRIDE;
    134134    virtual void stopSnapRubberbandTimer() OVERRIDE;
  • trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm

    r103634 r104312  
    11451145    bool shouldStretch = false;
    11461146   
    1147     IntSize stretchAmount = m_scrollableArea->overhangAmount();
     1147    IntSize stretchAmount = m_scrollElasticityController.m_client->stretchAmount();
    11481148
    11491149    isHorizontallyStretched = stretchAmount.width();
     
    12081208            if (deltaY != 0) {
    12091209                deltaY *= scrollWheelMultiplier();
    1210                 immediateScrollBy(FloatSize(0, deltaY));
     1210                m_scrollElasticityController.m_client->immediateScrollBy(FloatSize(0, deltaY));
    12111211            }
    12121212            if (deltaX != 0) {
    12131213                deltaX *= scrollWheelMultiplier();
    1214                 immediateScrollBy(FloatSize(deltaX, 0));
     1214                m_scrollElasticityController.m_client->immediateScrollBy(FloatSize(deltaX, 0));
    12151215            }
    12161216        } else {
     
    12211221                deltaX *= scrollWheelMultiplier();
    12221222
    1223                 immediateScrollByWithoutContentEdgeConstraints(FloatSize(deltaX, 0));
     1223                m_scrollElasticityController.m_client->immediateScrollByWithoutContentEdgeConstraints(FloatSize(deltaX, 0));
    12241224                deltaX = 0;
    12251225            }
     
    12311231                deltaY *= scrollWheelMultiplier();
    12321232
    1233                 immediateScrollByWithoutContentEdgeConstraints(FloatSize(0, deltaY));
     1233                m_scrollElasticityController.m_client->immediateScrollByWithoutContentEdgeConstraints(FloatSize(0, deltaY));
    12341234                deltaY = 0;
    12351235            }
    12361236           
    1237             IntSize stretchAmount = m_scrollableArea->overhangAmount();
     1237            IntSize stretchAmount = m_scrollElasticityController.m_client->stretchAmount();
    12381238       
    12391239            if (m_scrollElasticityController.m_momentumScrollInProgress) {
     
    12501250            FloatSize dampedDelta(ceilf(elasticDeltaForReboundDelta(m_scrollElasticityController.m_stretchScrollForce.width())), ceilf(elasticDeltaForReboundDelta(m_scrollElasticityController.m_stretchScrollForce.height())));
    12511251
    1252             immediateScrollByWithoutContentEdgeConstraints(dampedDelta - stretchAmount);
     1252            m_scrollElasticityController.m_client->immediateScrollByWithoutContentEdgeConstraints(dampedDelta - stretchAmount);
    12531253        }
    12541254    }
  • trunk/Source/WebCore/platform/mac/ScrollElasticityController.h

    r103634 r104312  
    4242    virtual IntSize stretchAmount() = 0;
    4343    virtual bool pinnedInDirection(const FloatSize&) = 0;
     44    virtual void immediateScrollBy(const FloatSize&) = 0;
    4445    virtual void immediateScrollByWithoutContentEdgeConstraints(const FloatSize&) = 0;
    4546    virtual void startSnapRubberbandTimer() = 0;
     
    5657
    5758private:
    58     ScrollElasticityControllerClient* m_client;
    59 
    6059    void stopSnapRubberbandTimer();
    6160
     
    6362    // the rubber-band related code from ScrollAnimatorMac is being moved over.
    6463public:
     64    ScrollElasticityControllerClient* m_client;
     65
    6566    bool m_inScrollGesture;
    6667    bool m_momentumScrollInProgress;
Note: See TracChangeset for help on using the changeset viewer.