Changeset 96652 in webkit
- Timestamp:
- Oct 4, 2011 3:14:49 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r96651 r96652 1 2011-10-04 Anders Carlsson <andersca@apple.com> 2 3 ScrollElasticityController should keep track of the rubberband timer state 4 https://bugs.webkit.org/show_bug.cgi?id=69381 5 6 Reviewed by Sam Weinig. 7 8 Add a m_snapRubberbandTimerIsActive member variable to ScrollElasticityController 9 and use it instead of checking whether the m_snapRubberbandTimer is active. 10 11 Eventually, ScrollElasticityControllerClient will have two member functions for starting 12 and stopping the timer, and the ScrollElasticityController will call them at the appropriate times. 13 14 * platform/mac/ScrollAnimatorMac.mm: 15 (WebCore::ScrollAnimatorMac::handleWheelEvent): 16 (WebCore::ScrollAnimatorMac::beginScrollGesture): 17 It's OK to stop the timer unconditionally. 18 19 (WebCore::ScrollAnimatorMac::snapRubberBand): 20 (WebCore::ScrollAnimatorMac::snapRubberBandTimerFired): 21 * platform/mac/ScrollElasticityController.h: 22 * platform/mac/ScrollElasticityController.mm: 23 (WebCore::ScrollElasticityController::ScrollElasticityController): 24 1 25 2011-10-04 Anders Carlsson <andersca@apple.com> 2 26 -
trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm
r96651 r96652 837 837 838 838 bool isMomentumScrollEvent = (wheelEvent.momentumPhase() != PlatformWheelEventPhaseNone); 839 if (m_scrollElasticityController.m_ignoreMomentumScrolls && (isMomentumScrollEvent || m_s napRubberBandTimer.isActive())) {839 if (m_scrollElasticityController.m_ignoreMomentumScrolls && (isMomentumScrollEvent || m_scrollElasticityController.m_snapRubberbandTimerIsActive)) { 840 840 if (wheelEvent.momentumPhase() == PlatformWheelEventPhaseEnded) { 841 841 m_scrollElasticityController.m_ignoreMomentumScrolls = false; … … 1094 1094 m_scrollElasticityController.m_overflowScrollDelta = FloatSize(); 1095 1095 1096 if (m_snapRubberBandTimer.isActive())1097 m_snapRubberBandTimer.stop();1096 m_snapRubberBandTimer.stop(); 1097 m_scrollElasticityController.m_snapRubberbandTimerIsActive = false; 1098 1098 } 1099 1099 … … 1113 1113 m_scrollElasticityController.m_inScrollGesture = false; 1114 1114 1115 if (m_s napRubberBandTimer.isActive())1115 if (m_scrollElasticityController.m_snapRubberbandTimerIsActive) 1116 1116 return; 1117 1117 … … 1122 1122 1123 1123 m_snapRubberBandTimer.startRepeating(1.0/60.0); 1124 m_scrollElasticityController.m_snapRubberbandTimerIsActive = true; 1124 1125 } 1125 1126 … … 1147 1148 if (m_scrollElasticityController.m_startStretch == FloatSize()) { 1148 1149 m_snapRubberBandTimer.stop(); 1150 1149 1151 m_scrollElasticityController.m_stretchScrollForce = FloatSize(); 1150 1152 m_scrollElasticityController.m_startTime = 0; … … 1152 1154 m_scrollElasticityController.m_origOrigin = FloatPoint(); 1153 1155 m_scrollElasticityController.m_origVelocity = FloatSize(); 1156 m_scrollElasticityController.m_snapRubberbandTimerIsActive = false; 1154 1157 1155 1158 return; … … 1196 1199 1197 1200 m_snapRubberBandTimer.stop(); 1201 1198 1202 m_scrollElasticityController.m_stretchScrollForce = FloatSize(); 1199 1200 1203 m_scrollElasticityController.m_startTime = 0; 1201 1204 m_scrollElasticityController.m_startStretch = FloatSize(); 1202 1205 m_scrollElasticityController.m_origOrigin = FloatPoint(); 1203 1206 m_scrollElasticityController.m_origVelocity = FloatSize(); 1207 m_scrollElasticityController.m_snapRubberbandTimerIsActive = false; 1204 1208 } 1205 1209 } else { -
trunk/Source/WebCore/platform/mac/ScrollElasticityController.h
r96651 r96652 71 71 FloatPoint m_origOrigin; 72 72 FloatSize m_origVelocity; 73 74 bool m_snapRubberbandTimerIsActive; 73 75 }; 74 76 -
trunk/Source/WebCore/platform/mac/ScrollElasticityController.mm
r96651 r96652 42 42 , m_lastMomentumScrollTimestamp(0) 43 43 , m_startTime(0) 44 , m_snapRubberbandTimerIsActive(false) 44 45 { 45 46 }
Note: See TracChangeset
for help on using the changeset viewer.