| Index: Source/core/platform/ScrollAnimator.cpp
|
| diff --git a/Source/core/platform/ScrollAnimator.cpp b/Source/core/platform/ScrollAnimator.cpp
|
| index 2924a2b6252131a508dd6457804c3c14a152f8f4..2b36c18f50074776a2b1cee265bdb65a1fdc2ba8 100644
|
| --- a/Source/core/platform/ScrollAnimator.cpp
|
| +++ b/Source/core/platform/ScrollAnimator.cpp
|
| @@ -76,13 +76,13 @@ void ScrollAnimator::scrollToOffsetWithoutAnimation(const FloatPoint& offset)
|
|
|
| bool ScrollAnimator::handleWheelEvent(const PlatformWheelEvent& e)
|
| {
|
| - Scrollbar* horizontalScrollbar = m_scrollableArea->horizontalScrollbar();
|
| - Scrollbar* verticalScrollbar = m_scrollableArea->verticalScrollbar();
|
| + bool canScrollX = m_scrollableArea->isHorizontallyScrollable();
|
| + bool canScrollY = m_scrollableArea->isVerticallyScrollable();
|
|
|
| - // Accept the event if we have a scrollbar in that direction and can still
|
| + // Accept the event if we are scrollable in that direction and can still
|
| // scroll any further.
|
| - float deltaX = horizontalScrollbar ? e.deltaX() : 0;
|
| - float deltaY = verticalScrollbar ? e.deltaY() : 0;
|
| + float deltaX = canScrollX ? e.deltaX() : 0;
|
| + float deltaY = canScrollY ? e.deltaY() : 0;
|
|
|
| bool handled = false;
|
|
|
| @@ -107,7 +107,13 @@ bool ScrollAnimator::handleWheelEvent(const PlatformWheelEvent& e)
|
| if (negative)
|
| deltaY = -deltaY;
|
| }
|
| - scroll(VerticalScrollbar, granularity, verticalScrollbar->pixelStep(), -deltaY);
|
| +
|
| + float step = 1;
|
| + Scrollbar* verticalScrollbar = m_scrollableArea->verticalScrollbar();
|
| + if (verticalScrollbar)
|
| + step = verticalScrollbar->pixelStep();
|
| +
|
| + scroll(VerticalScrollbar, granularity, step, -deltaY);
|
| }
|
|
|
| if (deltaX) {
|
| @@ -117,7 +123,13 @@ bool ScrollAnimator::handleWheelEvent(const PlatformWheelEvent& e)
|
| if (negative)
|
| deltaX = -deltaX;
|
| }
|
| - scroll(HorizontalScrollbar, granularity, horizontalScrollbar->pixelStep(), -deltaX);
|
| +
|
| + float step = 1;
|
| + Scrollbar* horizontalScrollbar = m_scrollableArea->horizontalScrollbar();
|
| + if (horizontalScrollbar)
|
| + step = horizontalScrollbar->pixelStep();
|
| +
|
| + scroll(HorizontalScrollbar, granularity, step, -deltaX);
|
| }
|
| }
|
| return handled;
|
|
|