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

Unified Diff: third_party/WebKit/Source/core/page/scrolling/ViewportScrollCallback.cpp

Issue 2387883002: Use float for scroll offset. (Closed)
Patch Set: Fix README.md Created 4 years, 2 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/page/scrolling/ViewportScrollCallback.cpp
diff --git a/third_party/WebKit/Source/core/page/scrolling/ViewportScrollCallback.cpp b/third_party/WebKit/Source/core/page/scrolling/ViewportScrollCallback.cpp
index ee59104af4b22bb61fccdb9e1cf4a2fb97d75a90..0441a6b33ba1d6e6e05257ee10e48f770911d05f 100644
--- a/third_party/WebKit/Source/core/page/scrolling/ViewportScrollCallback.cpp
+++ b/third_party/WebKit/Source/core/page/scrolling/ViewportScrollCallback.cpp
@@ -34,7 +34,7 @@ DEFINE_TRACE(ViewportScrollCallback) {
}
bool ViewportScrollCallback::shouldScrollTopControls(
- const FloatSize& delta,
+ const ScrollOffset& delta,
ScrollGranularity granularity) const {
if (granularity != ScrollByPixel && granularity != ScrollByPrecisePixel)
return false;
@@ -42,14 +42,14 @@ bool ViewportScrollCallback::shouldScrollTopControls(
if (!m_rootFrameViewport)
return false;
- DoublePoint maxScroll = m_rootFrameViewport->maximumScrollPositionDouble();
- DoublePoint scrollPosition = m_rootFrameViewport->scrollPositionDouble();
+ ScrollOffset maxScroll = m_rootFrameViewport->maximumScrollOffset();
+ ScrollOffset scrollOffset = m_rootFrameViewport->scrollOffset();
// 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.
- return delta.height() < 0 || scrollPosition.y() < maxScroll.y();
+ return delta.height() < 0 || scrollOffset.height() < maxScroll.height();
}
bool ViewportScrollCallback::scrollTopControls(ScrollState& state) {

Powered by Google App Engine
This is Rietveld 408576698