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

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

Issue 1755773002: Pass the physical scroll delta through the scroll customization path. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@removeOneDimensionalScrolls
Patch Set: Updated LayoutTest 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 fb0aa87adef798f03c8b2f9c85d052fb43fc8a00..ac828570aa8f107104881ca849dd288015bab93f 100644
--- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
@@ -764,7 +764,6 @@ void LocalFrame::removeSpellingMarkersUnderWords(const Vector<String>& words)
spellChecker().removeSpellingMarkersUnderWords(words);
}
-// Returns true if a scroll occurred.
ScrollResult LocalFrame::applyScrollDelta(ScrollGranularity granularity, const FloatSize& delta, bool isScrollBegin)
{
if (isScrollBegin)
@@ -782,14 +781,7 @@ ScrollResult LocalFrame::applyScrollDelta(ScrollGranularity granularity, const F
if (remainingDelta.isZero())
return ScrollResult(delta.width(), delta.height(), 0.0f, 0.0f);
- // 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);
-
+ ScrollResult result = view()->scrollableArea()->userScroll(granularity, remainingDelta);
result.didScrollX = result.didScrollX || (remainingDelta.width() != delta.width());
result.didScrollY = result.didScrollY || (remainingDelta.height() != delta.height());
@@ -810,7 +802,7 @@ bool LocalFrame::shouldScrollTopControls(const FloatSize& delta) const
toDoubleSize(view()->maximumScrollPositionDouble());
DoublePoint scrollPosition = host()->visualViewport()
.visibleRectInDocument().location();
- return delta.height() > 0 || scrollPosition.y() < maximumScrollPosition.y();
+ return delta.height() < 0 || scrollPosition.y() < maximumScrollPosition.y();
}
String LocalFrame::localLayerTreeAsText(unsigned flags) const
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.cpp ('k') | third_party/WebKit/Source/core/frame/TopControls.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698