Changeset 104321 in webkit
- Timestamp:
- Jan 6, 2012 12:25:40 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r104320 r104321 1 2012-01-06 Anders Carlsson <andersca@apple.com> 2 3 Make ScrollAnimatorMac::snapRubberBandTimerFired use m_scrollElasticityController in more places 4 https://bugs.webkit.org/show_bug.cgi?id=75726 5 6 Reviewed by Sam Weinig. 7 8 * platform/mac/ScrollAnimatorMac.h: 9 * platform/mac/ScrollAnimatorMac.mm: 10 (WebCore::ScrollAnimatorMac::canScrollHorizontally): 11 (WebCore::ScrollAnimatorMac::canScrollVertically): 12 (WebCore::ScrollAnimatorMac::snapRubberBandTimerFired): 13 * platform/mac/ScrollElasticityController.h: 14 1 15 2012-01-06 Pratik Solanki <psolanki@apple.com> 2 16 -
trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.h
r104312 r104321 129 129 virtual IntSize stretchAmount() OVERRIDE; 130 130 virtual bool pinnedInDirection(const FloatSize&) OVERRIDE; 131 virtual bool canScrollHorizontally() OVERRIDE; 132 virtual bool canScrollVertically() OVERRIDE; 131 133 virtual void immediateScrollByWithoutContentEdgeConstraints(const FloatSize&) OVERRIDE; 132 134 virtual void immediateScrollBy(const FloatSize&) OVERRIDE; -
trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm
r104312 r104321 1064 1064 { 1065 1065 return pinnedInDirection(direction.width(), direction.height()); 1066 } 1067 1068 bool ScrollAnimatorMac::canScrollHorizontally() 1069 { 1070 Scrollbar* scrollbar = m_scrollableArea->horizontalScrollbar(); 1071 if (!scrollbar) 1072 return false; 1073 return scrollbar->enabled(); 1074 } 1075 1076 bool ScrollAnimatorMac::canScrollVertically() 1077 { 1078 Scrollbar* scrollbar = m_scrollableArea->verticalScrollbar(); 1079 if (!scrollbar) 1080 return false; 1081 return scrollbar->enabled(); 1066 1082 } 1067 1083 … … 1321 1337 1322 1338 if (m_scrollElasticityController.m_startStretch == FloatSize()) { 1323 m_scrollElasticityController.m_startStretch = m_scroll ableArea->overhangAmount();1324 if (m_scrollElasticityController.m_startStretch == FloatSize()) { 1325 m_s napRubberBandTimer.stop();1339 m_scrollElasticityController.m_startStretch = m_scrollElasticityController.m_client->stretchAmount(); 1340 if (m_scrollElasticityController.m_startStretch == FloatSize()) { 1341 m_scrollElasticityController.m_client->stopSnapRubberbandTimer(); 1326 1342 1327 1343 m_scrollElasticityController.m_stretchScrollForce = FloatSize(); … … 1343 1359 1344 1360 // Don't rubber-band horizontally if it's not possible to scroll horizontally 1345 Scrollbar* hScroller = m_scrollableArea->horizontalScrollbar(); 1346 if (!hScroller || !hScroller->enabled()) 1361 if (!m_scrollElasticityController.m_client->canScrollHorizontally()) 1347 1362 m_scrollElasticityController.m_origVelocity.setWidth(0); 1348 1363 1349 // Don't rubber-band vertically if it's not possible to scroll horizontally 1350 Scrollbar* vScroller = m_scrollableArea->verticalScrollbar(); 1351 if (!vScroller || !vScroller->enabled()) 1364 // Don't rubber-band vertically if it's not possible to scroll vertically 1365 if (!m_scrollElasticityController.m_client->canScrollVertically()) 1352 1366 m_scrollElasticityController.m_origVelocity.setHeight(0); 1353 1367 } … … 1359 1373 FloatPoint newOrigin = m_scrollElasticityController.m_origOrigin + delta; 1360 1374 1361 immediateScrollByWithoutContentEdgeConstraints(FloatSize(delta.x(), delta.y()) - m_scroll ableArea->overhangAmount());1362 1363 FloatSize newStretch = m_scroll ableArea->overhangAmount();1375 immediateScrollByWithoutContentEdgeConstraints(FloatSize(delta.x(), delta.y()) - m_scrollElasticityController.m_client->stretchAmount()); 1376 1377 FloatSize newStretch = m_scrollElasticityController.m_client->stretchAmount(); 1364 1378 1365 1379 m_scrollElasticityController.m_stretchScrollForce.setWidth(reboundDeltaForElasticDelta(newStretch.width())); … … 1368 1382 immediateScrollTo(m_scrollElasticityController.m_origOrigin); 1369 1383 1370 m_s napRubberBandTimer.stop();1384 m_scrollElasticityController.m_client->stopSnapRubberbandTimer(); 1371 1385 1372 1386 m_scrollElasticityController.m_stretchScrollForce = FloatSize(); -
trunk/Source/WebCore/platform/mac/ScrollElasticityController.h
r104312 r104321 42 42 virtual IntSize stretchAmount() = 0; 43 43 virtual bool pinnedInDirection(const FloatSize&) = 0; 44 virtual bool canScrollHorizontally() = 0; 45 virtual bool canScrollVertically() = 0; 44 46 virtual void immediateScrollBy(const FloatSize&) = 0; 45 47 virtual void immediateScrollByWithoutContentEdgeConstraints(const FloatSize&) = 0;
Note: See TracChangeset
for help on using the changeset viewer.