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 734b962d8ee152ed12ed4eda6a06216ee1e2b55f..65b8ef84bada10f9014fa011d3c4eb7058ec003a 100644 |
--- a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp |
+++ b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp |
@@ -1135,10 +1135,11 @@ 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); |
} |
@@ -1206,7 +1207,9 @@ 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(); |
@@ -1218,7 +1221,7 @@ 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); |
} |