| Index: WebCore/platform/Scrollbar.cpp
|
| ===================================================================
|
| --- WebCore/platform/Scrollbar.cpp (revision 67003)
|
| +++ WebCore/platform/Scrollbar.cpp (working copy)
|
| @@ -101,12 +101,12 @@
|
| m_theme->unregisterScrollbar(this);
|
| }
|
|
|
| -bool Scrollbar::setValue(int v)
|
| +bool Scrollbar::setValue(int v, ScrollSource source)
|
| {
|
| v = max(min(v, m_totalSize - m_visibleSize), 0);
|
| if (value() == v)
|
| return false; // Our value stayed the same.
|
| - setCurrentPos(v);
|
| + setCurrentPos(v, source);
|
| return true;
|
| }
|
|
|
| @@ -154,8 +154,10 @@
|
| }
|
| if (direction == ScrollUp || direction == ScrollLeft)
|
| multiplier = -multiplier;
|
| + if (client())
|
| + return client()->scroll(m_orientation, granularity, step, multiplier);
|
|
|
| - return setCurrentPos(max(min(m_currentPos + (step * multiplier), static_cast<float>(m_totalSize - m_visibleSize)), 0.0f));
|
| + return setCurrentPos(max(min(m_currentPos + (step * multiplier), static_cast<float>(m_totalSize - m_visibleSize)), 0.0f), NotFromScrollAnimator);
|
| }
|
|
|
| void Scrollbar::updateThumb()
|
| @@ -287,11 +289,14 @@
|
| else if (delta < 0)
|
| delta = max(-thumbPos, delta);
|
| if (delta)
|
| - setCurrentPos(static_cast<float>(thumbPos + delta) * maximum() / (trackLen - thumbLen));
|
| + setCurrentPos(static_cast<float>(thumbPos + delta) * maximum() / (trackLen - thumbLen), NotFromScrollAnimator);
|
| }
|
|
|
| -bool Scrollbar::setCurrentPos(float pos)
|
| +bool Scrollbar::setCurrentPos(float pos, ScrollSource source)
|
| {
|
| + if ((source != FromScrollAnimator) && client())
|
| + client()->setScrollPositionAndStopAnimation(m_orientation, pos);
|
| +
|
| if (pos == m_currentPos)
|
| return false;
|
|
|
| @@ -336,7 +341,7 @@
|
| {
|
| if (m_pressedPart == ThumbPart) {
|
| if (theme()->shouldSnapBackToDragOrigin(this, evt))
|
| - setCurrentPos(m_dragOrigin);
|
| + setCurrentPos(m_dragOrigin, NotFromScrollAnimator);
|
| else {
|
| moveThumb(m_orientation == HorizontalScrollbar ?
|
| convertFromContainingWindow(evt.pos()).x() :
|
|
|