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

Unified Diff: third_party/WebKit/Source/web/WebViewImpl.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/web/WebViewImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp
index 966246fcdad04935da3cc88f8772888c5ab80244..cd19c896725f746ec54213e16114989f3cda679f 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -882,7 +882,7 @@ WebInputEventResult WebViewImpl::handleGestureEvent(
// TODO(bokan): We shouldn't pass details of the VisualViewport offset
// to render_view_impl. crbug.com/459591
WebSize visualViewportOffset =
- flooredIntSize(visualViewport.location());
+ flooredIntSize(visualViewport.scrollOffset());
if (m_webSettings->multiTargetTapNotificationEnabled()) {
Vector<IntRect> goodTargets;
@@ -1029,9 +1029,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;
}
@@ -3391,7 +3392,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);
@@ -3703,9 +3704,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);
« no previous file with comments | « third_party/WebKit/Source/web/WebLocalFrameImpl.cpp ('k') | third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698