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

Unified Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2387883002: Use float for scroll offset. (Closed)
Patch Set: 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/web/WebViewImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp
index 3ce96f9ad006087364986b5c9a1798856ca3bb94..9372c08095d699c302c696f9fabe32045a584f14 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -1020,9 +1020,10 @@ bool WebViewImpl::startPageScaleAnimation(const IntPoint& targetPosition,
setPageScaleFactor(newScale);
FrameView* view = mainFrameImpl()->frameView();
- if (view && view->getScrollableArea())
- view->getScrollableArea()->setScrollPosition(
- DoublePoint(clampedPoint.x, clampedPoint.y), ProgrammaticScroll);
+ if (view && view->getScrollableArea()) {
+ view->getScrollableArea()->setScrollOffset(
+ ScrollOffset(clampedPoint.x, clampedPoint.y), ProgrammaticScroll);
+ }
return false;
}
@@ -3368,7 +3369,7 @@ void WebViewImpl::scrollAndRescaleViewports(
// Order is important: visual viewport location is clamped based on
// main frame scroll position and visual viewport scale.
- view->setScrollPosition(mainFrameOrigin, ProgrammaticScroll);
+ view->setScrollOffset(toScrollOffset(mainFrameOrigin), ProgrammaticScroll);
setPageScaleFactor(scaleFactor);
@@ -3679,9 +3680,8 @@ void WebViewImpl::resetScrollAndScaleState() {
if (FrameView* frameView = toLocalFrame(page()->mainFrame())->view()) {
ScrollableArea* scrollableArea = frameView->layoutViewportScrollableArea();
- if (scrollableArea->scrollPositionDouble() != DoublePoint::zero())
- scrollableArea->setScrollPosition(DoublePoint::zero(),
- ProgrammaticScroll);
+ if (!scrollableArea->scrollOffset().isZero())
+ scrollableArea->setScrollOffset(ScrollOffset(), ProgrammaticScroll);
}
pageScaleConstraintsSet().setNeedsReset(true);

Powered by Google App Engine
This is Rietveld 408576698