Index: third_party/WebKit/Source/platform/scroll/ScrollAnimatorBase.cpp |
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollAnimatorBase.cpp b/third_party/WebKit/Source/platform/scroll/ScrollAnimatorBase.cpp |
index 78d359c2dea59e08db13134140b32ded8441d8f4..bb3fdf41af4dc0c80c5bec332a2bf80682ab8f1f 100644 |
--- a/third_party/WebKit/Source/platform/scroll/ScrollAnimatorBase.cpp |
+++ b/third_party/WebKit/Source/platform/scroll/ScrollAnimatorBase.cpp |
@@ -50,6 +50,13 @@ ScrollAnimatorBase::~ScrollAnimatorBase() |
{ |
} |
+float ScrollAnimatorBase::usedScrollDelta(ScrollbarOrientation orientation, float pixelDelta) const |
+{ |
+ float currentPos = (orientation == HorizontalScrollbar) ? m_currentPosX : m_currentPosY; |
+ float newPos = clampScrollPosition(orientation, currentPos + pixelDelta); |
+ return (currentPos == newPos) ? 0.0f : (newPos - currentPos); |
+} |
+ |
ScrollResultOneDimensional ScrollAnimatorBase::userScroll(ScrollbarOrientation orientation, ScrollGranularity, float step, float delta) |
{ |
float& currentPos = (orientation == HorizontalScrollbar) ? m_currentPosX : m_currentPosY; |
@@ -88,7 +95,7 @@ void ScrollAnimatorBase::notifyPositionChanged() |
m_scrollableArea->scrollPositionChanged(DoublePoint(m_currentPosX, m_currentPosY), UserScroll); |
} |
-float ScrollAnimatorBase::clampScrollPosition(ScrollbarOrientation orientation, float pos) |
+float ScrollAnimatorBase::clampScrollPosition(ScrollbarOrientation orientation, float pos) const |
{ |
float maxScrollPos = m_scrollableArea->maximumScrollPosition(orientation); |
float minScrollPos = m_scrollableArea->minimumScrollPosition(orientation); |