Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Unified Diff: third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp

Issue 2387393003: Revert of Refactor ScrollableArea::setScrollPosition. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp b/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp
index 7e37425c6e8419afcc0c608d11559e40d7bdb1f9..c3a8ee7654bd0bca004dc39b7b379819346a1622 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp
+++ b/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp
@@ -190,18 +190,19 @@
void ScrollAnimator::adjustAnimationAndSetScrollPosition(
const DoublePoint& position,
ScrollType scrollType) {
- IntSize adjustment =
- roundedIntPoint(position) -
+ DoublePoint adjustedPos = m_scrollableArea->clampScrollPosition(position);
+ IntSize actualAdjustment =
+ roundedIntPoint(adjustedPos) -
roundedIntPoint(m_scrollableArea->scrollPositionDouble());
- scrollPositionChanged(position, scrollType);
+ scrollPositionChanged(adjustedPos, scrollType);
if (m_runState == RunState::Idle) {
- adjustImplOnlyScrollOffsetAnimation(adjustment);
+ adjustImplOnlyScrollOffsetAnimation(actualAdjustment);
} else if (hasRunningAnimation()) {
- m_targetOffset += toFloatSize(adjustment);
+ m_targetOffset += toFloatSize(actualAdjustment);
if (m_animationCurve) {
- m_animationCurve->applyAdjustment(adjustment);
+ m_animationCurve->applyAdjustment(actualAdjustment);
if (m_runState != RunState::RunningOnMainThread &&
registerAndScheduleAnimation())
m_runState = RunState::RunningOnCompositorButNeedsAdjustment;

Powered by Google App Engine
This is Rietveld 408576698