OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010, 2011 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
698 FloatPoint adjustedPosition = adjustScrollPositionIfNecessary(newPosition); | 698 FloatPoint adjustedPosition = adjustScrollPositionIfNecessary(newPosition); |
699 | 699 |
700 bool positionChanged = adjustedPosition.x() != m_currentPosX || adjustedPosi
tion.y() != m_currentPosY; | 700 bool positionChanged = adjustedPosition.x() != m_currentPosX || adjustedPosi
tion.y() != m_currentPosY; |
701 if (!positionChanged && !scrollableArea()->scrollOriginChanged()) | 701 if (!positionChanged && !scrollableArea()->scrollOriginChanged()) |
702 return; | 702 return; |
703 | 703 |
704 FloatSize delta = FloatSize(adjustedPosition.x() - m_currentPosX, adjustedPo
sition.y() - m_currentPosY); | 704 FloatSize delta = FloatSize(adjustedPosition.x() - m_currentPosX, adjustedPo
sition.y() - m_currentPosY); |
705 | 705 |
706 m_currentPosX = adjustedPosition.x(); | 706 m_currentPosX = adjustedPosition.x(); |
707 m_currentPosY = adjustedPosition.y(); | 707 m_currentPosY = adjustedPosition.y(); |
708 notifyPositionChanged(delta); | 708 notifyContentAreaScrolled(delta); |
| 709 notifyPositionChanged(); |
709 } | 710 } |
710 | 711 |
711 bool ScrollAnimatorMac::isRubberBandInProgress() const | 712 bool ScrollAnimatorMac::isRubberBandInProgress() const |
712 { | 713 { |
713 #if !USE(RUBBER_BANDING) | 714 #if !USE(RUBBER_BANDING) |
714 return false; | 715 return false; |
715 #else | 716 #else |
716 return m_scrollElasticityController.isRubberBandInProgress(); | 717 return m_scrollElasticityController.isRubberBandInProgress(); |
717 #endif | 718 #endif |
718 } | 719 } |
719 | 720 |
720 void ScrollAnimatorMac::immediateScrollToPointForScrollAnimation(const FloatPoin
t& newPosition) | 721 void ScrollAnimatorMac::immediateScrollToPointForScrollAnimation(const FloatPoin
t& newPosition) |
721 { | 722 { |
722 ASSERT(m_scrollAnimationHelper); | 723 ASSERT(m_scrollAnimationHelper); |
723 immediateScrollTo(newPosition); | 724 immediateScrollTo(newPosition); |
724 } | 725 } |
725 | 726 |
726 void ScrollAnimatorMac::notifyPositionChanged(const FloatSize& delta) | |
727 { | |
728 notifyContentAreaScrolled(delta); | |
729 ScrollAnimator::notifyPositionChanged(delta); | |
730 } | |
731 | |
732 void ScrollAnimatorMac::contentAreaWillPaint() const | 727 void ScrollAnimatorMac::contentAreaWillPaint() const |
733 { | 728 { |
734 if (!scrollableArea()->scrollbarsCanBeActive()) | 729 if (!scrollableArea()->scrollbarsCanBeActive()) |
735 return; | 730 return; |
736 if (ScrollbarThemeMacCommon::isOverlayAPIAvailable()) | 731 if (ScrollbarThemeMacCommon::isOverlayAPIAvailable()) |
737 [m_scrollbarPainterController.get() contentAreaWillDraw]; | 732 [m_scrollbarPainterController.get() contentAreaWillDraw]; |
738 } | 733 } |
739 | 734 |
740 void ScrollAnimatorMac::mouseEnteredContentArea() const | 735 void ScrollAnimatorMac::mouseEnteredContentArea() const |
741 { | 736 { |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1134 void ScrollAnimatorMac::immediateScrollBy(const FloatSize& delta) | 1129 void ScrollAnimatorMac::immediateScrollBy(const FloatSize& delta) |
1135 { | 1130 { |
1136 FloatPoint newPos = adjustScrollPositionIfNecessary(FloatPoint(m_currentPosX
, m_currentPosY) + delta); | 1131 FloatPoint newPos = adjustScrollPositionIfNecessary(FloatPoint(m_currentPosX
, m_currentPosY) + delta); |
1137 if (newPos.x() == m_currentPosX && newPos.y() == m_currentPosY) | 1132 if (newPos.x() == m_currentPosX && newPos.y() == m_currentPosY) |
1138 return; | 1133 return; |
1139 | 1134 |
1140 FloatSize adjustedDelta = FloatSize(newPos.x() - m_currentPosX, newPos.y() -
m_currentPosY); | 1135 FloatSize adjustedDelta = FloatSize(newPos.x() - m_currentPosX, newPos.y() -
m_currentPosY); |
1141 | 1136 |
1142 m_currentPosX = newPos.x(); | 1137 m_currentPosX = newPos.x(); |
1143 m_currentPosY = newPos.y(); | 1138 m_currentPosY = newPos.y(); |
1144 notifyPositionChanged(adjustedDelta); | 1139 notifyContentAreaScrolled(adjustedDelta); |
| 1140 notifyPositionChanged(); |
1145 } | 1141 } |
1146 | 1142 |
1147 void ScrollAnimatorMac::startSnapRubberbandTimer() | 1143 void ScrollAnimatorMac::startSnapRubberbandTimer() |
1148 { | 1144 { |
1149 m_snapRubberBandTimer.startRepeating(1.0 / 60.0, FROM_HERE); | 1145 m_snapRubberBandTimer.startRepeating(1.0 / 60.0, FROM_HERE); |
1150 } | 1146 } |
1151 | 1147 |
1152 void ScrollAnimatorMac::stopSnapRubberbandTimer() | 1148 void ScrollAnimatorMac::stopSnapRubberbandTimer() |
1153 { | 1149 { |
1154 m_snapRubberBandTimer.stop(); | 1150 m_snapRubberBandTimer.stop(); |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1284 return; | 1280 return; |
1285 | 1281 |
1286 m_visibleScrollerThumbRect = rectInViewCoordinates; | 1282 m_visibleScrollerThumbRect = rectInViewCoordinates; |
1287 } | 1283 } |
1288 | 1284 |
1289 bool ScrollAnimatorMac::canUseCoordinatedScrollbar() { | 1285 bool ScrollAnimatorMac::canUseCoordinatedScrollbar() { |
1290 return ScrollbarThemeMacCommon::isOverlayAPIAvailable(); | 1286 return ScrollbarThemeMacCommon::isOverlayAPIAvailable(); |
1291 } | 1287 } |
1292 | 1288 |
1293 } // namespace WebCore | 1289 } // namespace WebCore |
OLD | NEW |