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

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

Issue 1415513002: Remove plumbing for inert-visual-viewport flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Keeping "inertVisualViewport" setting + fixed broken test Created 5 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/frame/LocalDOMWindow.cpp
diff --git a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
index a692bc6fb48f1e260eb01111d344e7fcbd9bf004..adcf55a2208a4c0d10a7a80c421a8077d102fe52 100644
--- a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
@@ -1136,10 +1136,10 @@ void LocalDOMWindow::scrollBy(double x, double y, ScrollBehavior scrollBehavior)
x = ScrollableArea::normalizeNonFiniteScroll(x);
y = ScrollableArea::normalizeNonFiniteScroll(y);
- DoublePoint currentOffset = view->scrollableArea()->scrollPositionDouble();
+ ScrollableArea* viewport = host->settings().inertVisualViewport() ? view->layoutViewportScrollableArea() : view->scrollableArea();
+ DoublePoint currentOffset = viewport->scrollPositionDouble();
DoubleSize scaledDelta(x * frame()->pageZoomFactor(), y * frame()->pageZoomFactor());
- ScrollableArea* viewport = host->settings().inertVisualViewport() ? view->layoutViewportScrollableArea() : view->scrollableArea();
viewport->setScrollPosition(currentOffset + scaledDelta, ProgrammaticScroll, scrollBehavior);
}
@@ -1207,7 +1207,8 @@ void LocalDOMWindow::scrollTo(const ScrollToOptions& scrollToOptions) const
double scaledX = 0.0;
double scaledY = 0.0;
- DoublePoint currentOffset = view->scrollableArea()->scrollPositionDouble();
+ ScrollableArea* viewport = host->settings().inertVisualViewport() ? view->layoutViewportScrollableArea() : view->scrollableArea();
+ DoublePoint currentOffset = viewport->scrollPositionDouble();
scaledX = currentOffset.x();
scaledY = currentOffset.y();
@@ -1219,7 +1220,6 @@ void LocalDOMWindow::scrollTo(const ScrollToOptions& scrollToOptions) const
ScrollBehavior scrollBehavior = ScrollBehaviorAuto;
ScrollableArea::scrollBehaviorFromString(scrollToOptions.behavior(), scrollBehavior);
- ScrollableArea* viewport = host->settings().inertVisualViewport() ? view->layoutViewportScrollableArea() : view->scrollableArea();
viewport->setScrollPosition(DoublePoint(scaledX, scaledY), ProgrammaticScroll, scrollBehavior);
}

Powered by Google App Engine
This is Rietveld 408576698