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

Unified Diff: Source/platform/scroll/ScrollAnimatorNone.cpp

Issue 1173053003: Remove ScrollableArea::notifyScrollPositionChanged and cleanup scroll animators. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase + remove updateScrollbars from FrameView::setScrollPosition Created 5 years, 6 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
« no previous file with comments | « Source/platform/scroll/ScrollAnimatorNone.h ('k') | Source/platform/scroll/ScrollableArea.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/scroll/ScrollAnimatorNone.cpp
diff --git a/Source/platform/scroll/ScrollAnimatorNone.cpp b/Source/platform/scroll/ScrollAnimatorNone.cpp
index ceb757b16a23d25b742a17a67a183bb5f43dc217..f772360775b22589de0f5e59adb544526a9233bf 100644
--- a/Source/platform/scroll/ScrollAnimatorNone.cpp
+++ b/Source/platform/scroll/ScrollAnimatorNone.cpp
@@ -433,26 +433,25 @@ ScrollResultOneDimensional ScrollAnimatorNone::userScroll(ScrollbarOrientation o
return ScrollResultOneDimensional(needToScroll);
}
-void ScrollAnimatorNone::scrollToOffsetWithoutAnimation(const FloatPoint& offset, ScrollType scrollType)
+void ScrollAnimatorNone::scrollToOffsetWithoutAnimation(const FloatPoint& offset)
{
- stopAnimationTimerIfNeeded();
-
- m_horizontalData.reset();
- *m_horizontalData.m_currentPosition = offset.x();
- m_horizontalData.m_desiredPosition = offset.x();
m_currentPosX = offset.x();
-
- m_verticalData.reset();
- *m_verticalData.m_currentPosition = offset.y();
- m_verticalData.m_desiredPosition = offset.y();
m_currentPosY = offset.y();
- notifyPositionChanged(scrollType);
+ // Must be called after setting the position since canceling the animation resets
+ // the desired position to the current.
+ cancelAnimations();
+ notifyPositionChanged();
}
void ScrollAnimatorNone::cancelAnimations()
{
m_animationActive = false;
+
+ m_horizontalData.reset();
+ m_verticalData.reset();
+ m_horizontalData.m_desiredPosition = m_currentPosX;
+ m_verticalData.m_desiredPosition = m_currentPosY;
}
void ScrollAnimatorNone::serviceScrollAnimations()
@@ -510,7 +509,7 @@ void ScrollAnimatorNone::animationTimerFired()
m_animationActive = false;
TRACE_EVENT0("blink", "ScrollAnimatorNone::notifyPositionChanged");
- notifyPositionChanged(UserScroll);
+ notifyPositionChanged();
if (!continueAnimation)
animationDidFinish();
« no previous file with comments | « Source/platform/scroll/ScrollAnimatorNone.h ('k') | Source/platform/scroll/ScrollableArea.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698