Changeset 104312 in webkit
- Timestamp:
- Jan 6, 2012 12:01:55 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r104308 r104312 1 2012-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 1 17 2012-01-06 Wei James <james.wei@intel.com> 2 18 -
trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.h
r103634 r104312 124 124 125 125 void immediateScrollTo(const FloatPoint&); 126 void immediateScrollBy(const FloatSize&);127 126 128 127 #if ENABLE(RUBBER_BANDING) … … 131 130 virtual bool pinnedInDirection(const FloatSize&) OVERRIDE; 132 131 virtual void immediateScrollByWithoutContentEdgeConstraints(const FloatSize&) OVERRIDE; 132 virtual void immediateScrollBy(const FloatSize&) OVERRIDE; 133 133 virtual void startSnapRubberbandTimer() OVERRIDE; 134 134 virtual void stopSnapRubberbandTimer() OVERRIDE; -
trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm
r103634 r104312 1145 1145 bool shouldStretch = false; 1146 1146 1147 IntSize stretchAmount = m_scroll ableArea->overhangAmount();1147 IntSize stretchAmount = m_scrollElasticityController.m_client->stretchAmount(); 1148 1148 1149 1149 isHorizontallyStretched = stretchAmount.width(); … … 1208 1208 if (deltaY != 0) { 1209 1209 deltaY *= scrollWheelMultiplier(); 1210 immediateScrollBy(FloatSize(0, deltaY));1210 m_scrollElasticityController.m_client->immediateScrollBy(FloatSize(0, deltaY)); 1211 1211 } 1212 1212 if (deltaX != 0) { 1213 1213 deltaX *= scrollWheelMultiplier(); 1214 immediateScrollBy(FloatSize(deltaX, 0));1214 m_scrollElasticityController.m_client->immediateScrollBy(FloatSize(deltaX, 0)); 1215 1215 } 1216 1216 } else { … … 1221 1221 deltaX *= scrollWheelMultiplier(); 1222 1222 1223 immediateScrollByWithoutContentEdgeConstraints(FloatSize(deltaX, 0));1223 m_scrollElasticityController.m_client->immediateScrollByWithoutContentEdgeConstraints(FloatSize(deltaX, 0)); 1224 1224 deltaX = 0; 1225 1225 } … … 1231 1231 deltaY *= scrollWheelMultiplier(); 1232 1232 1233 immediateScrollByWithoutContentEdgeConstraints(FloatSize(0, deltaY));1233 m_scrollElasticityController.m_client->immediateScrollByWithoutContentEdgeConstraints(FloatSize(0, deltaY)); 1234 1234 deltaY = 0; 1235 1235 } 1236 1236 1237 IntSize stretchAmount = m_scroll ableArea->overhangAmount();1237 IntSize stretchAmount = m_scrollElasticityController.m_client->stretchAmount(); 1238 1238 1239 1239 if (m_scrollElasticityController.m_momentumScrollInProgress) { … … 1250 1250 FloatSize dampedDelta(ceilf(elasticDeltaForReboundDelta(m_scrollElasticityController.m_stretchScrollForce.width())), ceilf(elasticDeltaForReboundDelta(m_scrollElasticityController.m_stretchScrollForce.height()))); 1251 1251 1252 immediateScrollByWithoutContentEdgeConstraints(dampedDelta - stretchAmount);1252 m_scrollElasticityController.m_client->immediateScrollByWithoutContentEdgeConstraints(dampedDelta - stretchAmount); 1253 1253 } 1254 1254 } -
trunk/Source/WebCore/platform/mac/ScrollElasticityController.h
r103634 r104312 42 42 virtual IntSize stretchAmount() = 0; 43 43 virtual bool pinnedInDirection(const FloatSize&) = 0; 44 virtual void immediateScrollBy(const FloatSize&) = 0; 44 45 virtual void immediateScrollByWithoutContentEdgeConstraints(const FloatSize&) = 0; 45 46 virtual void startSnapRubberbandTimer() = 0; … … 56 57 57 58 private: 58 ScrollElasticityControllerClient* m_client;59 60 59 void stopSnapRubberbandTimer(); 61 60 … … 63 62 // the rubber-band related code from ScrollAnimatorMac is being moved over. 64 63 public: 64 ScrollElasticityControllerClient* m_client; 65 65 66 bool m_inScrollGesture; 66 67 bool m_momentumScrollInProgress;
Note: See TracChangeset
for help on using the changeset viewer.