Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(334)

Unified Diff: third_party/WebKit/Source/core/frame/LocalFrame.cpp

Issue 1738243002: Removed main-thread one dimensional scrolling paths. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@removeStepFromUserScroll
Patch Set: Rebase Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 fa3f404f56b950bbdd9ab7ed1b4d0eb48d3d0114..f74a174c801101095fc328d7ac72080cc53dd25f 100644
--- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
@@ -770,13 +770,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)
{
@@ -795,7 +788,14 @@ 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 GestureEvent delta, which is
+ // positive if the user scrolls up or left. For scrolling, a positive delta
+ // implies downward or rightward 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());
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalFrame.h ('k') | third_party/WebKit/Source/core/frame/RootFrameViewport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698