| Index: Source/core/frame/LocalFrame.cpp
|
| diff --git a/Source/core/frame/LocalFrame.cpp b/Source/core/frame/LocalFrame.cpp
|
| index f5a0e0366599c39e4b4a3ddcb51b16f1987cdc8a..a654381bc9f47ac646da5a0888829a297b09626a 100644
|
| --- a/Source/core/frame/LocalFrame.cpp
|
| +++ b/Source/core/frame/LocalFrame.cpp
|
| @@ -714,21 +714,20 @@ void LocalFrame::removeSpellingMarkersUnderWords(const Vector<String>& words)
|
| spellChecker().removeSpellingMarkersUnderWords(words);
|
| }
|
|
|
| -static bool scrollAreaOnBothAxes(const FloatSize& delta, ScrollableArea& view)
|
| +static ScrollResult scrollAreaOnBothAxes(const FloatSize& delta, ScrollableArea& view)
|
| {
|
| - bool scrolledHorizontal = view.scroll(ScrollLeft, ScrollByPrecisePixel, delta.width());
|
| - bool scrolledVertical = view.scroll(ScrollUp, ScrollByPrecisePixel, delta.height());
|
| - return scrolledHorizontal || scrolledVertical;
|
| + ScrollResultOneDimensional horizontal = view.scroll(ScrollLeft, ScrollByPrecisePixel, delta.width());
|
| + ScrollResultOneDimensional vertical = view.scroll(ScrollUp, ScrollByPrecisePixel, delta.height());
|
| + return ScrollResult((horizontal.didScroll || vertical.didScroll), horizontal.unusedScrollDelta, vertical.unusedScrollDelta);
|
| }
|
|
|
| -// Returns true if a scroll occurred.
|
| -bool LocalFrame::applyScrollDelta(const FloatSize& delta, bool isScrollBegin)
|
| +ScrollResult LocalFrame::applyScrollDelta(const FloatSize& delta, bool isScrollBegin)
|
| {
|
| if (isScrollBegin)
|
| host()->topControls().scrollBegin();
|
|
|
| if (!view() || delta.isZero())
|
| - return false;
|
| + return ScrollResult(false, delta.width(), delta.height());
|
|
|
| FloatSize remainingDelta = delta;
|
|
|
| @@ -737,14 +736,15 @@ bool LocalFrame::applyScrollDelta(const FloatSize& delta, bool isScrollBegin)
|
| remainingDelta = host()->topControls().scrollBy(remainingDelta);
|
|
|
| if (remainingDelta.isZero())
|
| - return true;
|
| + return ScrollResult(true);
|
|
|
| - bool consumed = remainingDelta != delta;
|
| + ScrollResult result = scrollAreaOnBothAxes(remainingDelta, *view()->scrollableArea());
|
|
|
| - if (scrollAreaOnBothAxes(remainingDelta, *view()->scrollableArea()))
|
| - return true;
|
| + if (result.didScroll)
|
| + return result;
|
|
|
| - return consumed;
|
| + result.didScroll = remainingDelta != delta;
|
| + return result;
|
| }
|
|
|
| bool LocalFrame::shouldScrollTopControls(const FloatSize& delta) const
|
|
|