Chromium Code Reviews| Index: third_party/WebKit/Source/core/frame/LocalFrame.cpp |
| diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.cpp b/third_party/WebKit/Source/core/frame/LocalFrame.cpp |
| index c66840f752db748376870248f9b453e0c43522d0..132bbf0c0acb488eb6c548fbc75d610801d2205a 100644 |
| --- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp |
| +++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp |
| @@ -775,13 +775,6 @@ void LocalFrame::removeSpellingMarkersUnderWords(const Vector<String>& words) |
| spellChecker().removeSpellingMarkersUnderWords(words); |
| } |
| -static ScrollResult scrollAreaOnBothAxes(ScrollGranularity granularity, const FloatSize& delta, ScrollableArea& view) |
| -{ |
| - ScrollResultOneDimensional scrolledHorizontal = view.userScroll(ScrollLeft, granularity, delta.width()); |
| - ScrollResultOneDimensional scrolledVertical = view.userScroll(ScrollUp, granularity, delta.height()); |
| - return ScrollResult(scrolledHorizontal.didScroll, scrolledVertical.didScroll, scrolledHorizontal.unusedScrollDelta, scrolledVertical.unusedScrollDelta); |
| -} |
| - |
| // Returns true if a scroll occurred. |
| ScrollResult LocalFrame::applyScrollDelta(ScrollGranularity granularity, const FloatSize& delta, bool isScrollBegin) |
| { |
| @@ -800,7 +793,13 @@ ScrollResult LocalFrame::applyScrollDelta(ScrollGranularity granularity, const F |
| if (remainingDelta.isZero()) |
| return ScrollResult(delta.width(), delta.height(), 0.0f, 0.0f); |
| - ScrollResult result = scrollAreaOnBothAxes(granularity, remainingDelta, *view()->scrollableArea()); |
| + // TODO(bokan): The delta coming in here is the GSU event delta, which is |
|
skobes
2016/02/29 18:52:47
what is GSU?
bokan
2016/03/01 05:56:24
Sorry, forgot not everyone works on input :) (Gest
|
| + // positive if the user scrolls up. For scrolling, a positive delta implies |
|
tdresser
2016/02/29 14:53:43
positive if the user scrolls up or left
bokan
2016/03/01 05:56:24
Done.
|
| + // downward scrolling. This negation should happen up in the call chain. |
| + FloatSize normalizedDelta = remainingDelta.scaledBy(-1); |
| + |
| + ScrollResult result = view()->scrollableArea()->userScroll(granularity, normalizedDelta); |
| + |
| result.didScrollX = result.didScrollX || (remainingDelta.width() != delta.width()); |
| result.didScrollY = result.didScrollY || (remainingDelta.height() != delta.height()); |