| Index: Source/platform/scroll/ScrollAnimator.cpp
|
| diff --git a/Source/platform/scroll/ScrollAnimator.cpp b/Source/platform/scroll/ScrollAnimator.cpp
|
| index 0f9fafd0f2ff09292baff98683783bfc9fd0ef2b..85614338fa9769d1d81814355b68d0755d6b308c 100644
|
| --- a/Source/platform/scroll/ScrollAnimator.cpp
|
| +++ b/Source/platform/scroll/ScrollAnimator.cpp
|
| @@ -92,54 +92,48 @@ ScrollResult ScrollAnimator::handleWheelEvent(const PlatformWheelEvent& e)
|
| ScrollGranularity granularity = ScrollByPixel;
|
| #endif
|
|
|
| - IntSize maxForwardScrollDelta = m_scrollableArea->maximumScrollPosition() - m_scrollableArea->scrollPosition();
|
| - IntSize maxBackwardScrollDelta = m_scrollableArea->scrollPosition() - m_scrollableArea->minimumScrollPosition();
|
| - if ((deltaX < 0 && maxForwardScrollDelta.width() > 0)
|
| - || (deltaX > 0 && maxBackwardScrollDelta.width() > 0))
|
| - result.didScrollX = true;
|
| - if ((deltaY < 0 && maxForwardScrollDelta.height() > 0)
|
| - || (deltaY > 0 && maxBackwardScrollDelta.height() > 0))
|
| - result.didScrollY = true;
|
| - if (result.didScroll()) {
|
| - if (deltaY) {
|
| - if (e.granularity() == ScrollByPageWheelEvent) {
|
| - bool negative = deltaY < 0;
|
| - deltaY = m_scrollableArea->pageStep(VerticalScrollbar);
|
| - if (negative)
|
| - deltaY = -deltaY;
|
| - }
|
| -
|
| - ScrollResultOneDimensional resultY = userScroll(
|
| - VerticalScrollbar, granularity, m_scrollableArea->pixelStep(VerticalScrollbar), -deltaY);
|
| -
|
| - if (e.granularity() != ScrollByPageWheelEvent) {
|
| - if (resultY.didScroll)
|
| - result.unusedScrollDeltaY = -resultY.unusedScrollDelta;
|
| - else
|
| - result.unusedScrollDeltaY = deltaY;
|
| - }
|
| + IntPoint currentPos = m_scrollableArea->scrollPosition();
|
| + if (deltaY) {
|
| + if (e.granularity() == ScrollByPageWheelEvent) {
|
| + bool negative = deltaY < 0;
|
| + deltaY = m_scrollableArea->pageStep(VerticalScrollbar);
|
| + if (negative)
|
| + deltaY = -deltaY;
|
| }
|
|
|
| - if (deltaX) {
|
| - if (e.granularity() == ScrollByPageWheelEvent) {
|
| - bool negative = deltaX < 0;
|
| - deltaX = m_scrollableArea->pageStep(HorizontalScrollbar);
|
| - if (negative)
|
| - deltaX = -deltaX;
|
| - }
|
| -
|
| - ScrollResultOneDimensional resultX = userScroll(
|
| - HorizontalScrollbar, granularity, m_scrollableArea->pixelStep(HorizontalScrollbar), -deltaX);
|
| -
|
| - if (e.granularity() != ScrollByPageWheelEvent) {
|
| - if (resultX.didScroll)
|
| - result.unusedScrollDeltaX = -resultX.unusedScrollDelta;
|
| - else
|
| - result.unusedScrollDeltaX = deltaX;
|
| - }
|
| + ScrollResultOneDimensional resultY = userScroll(
|
| + VerticalScrollbar, granularity, m_scrollableArea->pixelStep(VerticalScrollbar), -deltaY);
|
| +
|
| + if (e.granularity() != ScrollByPageWheelEvent) {
|
| + if (resultY.didScroll)
|
| + result.unusedScrollDeltaY = -resultY.unusedScrollDelta;
|
| + else
|
| + result.unusedScrollDeltaY = deltaY;
|
| + }
|
| + }
|
| +
|
| + if (deltaX) {
|
| + if (e.granularity() == ScrollByPageWheelEvent) {
|
| + bool negative = deltaX < 0;
|
| + deltaX = m_scrollableArea->pageStep(HorizontalScrollbar);
|
| + if (negative)
|
| + deltaX = -deltaX;
|
| + }
|
| +
|
| + ScrollResultOneDimensional resultX = userScroll(
|
| + HorizontalScrollbar, granularity, m_scrollableArea->pixelStep(HorizontalScrollbar), -deltaX);
|
| +
|
| + if (e.granularity() != ScrollByPageWheelEvent) {
|
| + if (resultX.didScroll)
|
| + result.unusedScrollDeltaX = -resultX.unusedScrollDelta;
|
| + else
|
| + result.unusedScrollDeltaX = deltaX;
|
| }
|
| }
|
|
|
| + IntPoint newPos = m_scrollableArea->scrollPosition();
|
| + result.didScrollX = newPos.x() != currentPos.x();
|
| + result.didScrollY = newPos.y() != currentPos.y();
|
| return result;
|
| }
|
|
|
|
|