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

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

Issue 1840113005: Move viewport actions into an ApplyScroll callback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase over my own changes Created 4 years, 8 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 80e692a96d2c29a743fcd76d8e388a8890f506ce..085943698c4a8b5d7421fb71c4f335562a6ac6c6 100644
--- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
@@ -755,50 +755,6 @@ void LocalFrame::removeSpellingMarkersUnderWords(const Vector<String>& words)
spellChecker().removeSpellingMarkersUnderWords(words);
}
-ScrollResult LocalFrame::applyScrollDelta(ScrollGranularity granularity, const FloatSize& delta, bool isScrollBegin)
-{
- if (isScrollBegin)
- host()->topControls().scrollBegin();
-
- if (!view() || delta.isZero())
- return ScrollResult(false, false, delta.width(), delta.height());
-
- FloatSize remainingDelta = delta;
-
- // If this is main frame, allow top controls to scroll first.
- if (shouldScrollTopControls(granularity, delta))
- remainingDelta = host()->topControls().scrollBy(remainingDelta);
-
- if (remainingDelta.isZero())
- return ScrollResult(delta.width(), delta.height(), 0.0f, 0.0f);
-
- ScrollResult result = view()->getScrollableArea()->userScroll(granularity, remainingDelta);
- result.didScrollX = result.didScrollX || (remainingDelta.width() != delta.width());
- result.didScrollY = result.didScrollY || (remainingDelta.height() != delta.height());
-
- return result;
-}
-
-bool LocalFrame::shouldScrollTopControls(ScrollGranularity granularity, const FloatSize& delta) const
-{
- if (!isMainFrame())
- return false;
-
- if (granularity != ScrollByPixel && granularity != ScrollByPrecisePixel)
- return false;
-
- // Always give the delta to the top controls if the scroll is in
- // the direction to show the top controls. If it's in the
- // direction to hide the top controls, only give the delta to the
- // top controls when the frame can scroll.
- DoublePoint maximumScrollPosition =
- host()->visualViewport().maximumScrollPositionDouble() +
- toDoubleSize(view()->maximumScrollPositionDouble());
- DoublePoint scrollPosition = host()->visualViewport()
- .visibleRectInDocument().location();
- return delta.height() < 0 || scrollPosition.y() < maximumScrollPosition.y();
-}
-
String LocalFrame::localLayerTreeAsText(unsigned flags) const
{
if (!contentLayoutObject())
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalFrame.h ('k') | third_party/WebKit/Source/core/input/EventHandler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698