| 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 19537c930850f9368ded4c8a178258888a1bba83..ec67a2f64fca0fbd9de117abb351140248a22068 100644
|
| --- a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
|
| +++ b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
|
| @@ -979,41 +979,37 @@ int LocalDOMWindow::screenY() const
|
|
|
| double LocalDOMWindow::scrollX() const
|
| {
|
| - if (!frame())
|
| + if (!frame() || !frame()->host())
|
| return 0;
|
|
|
| + if (!frame()->host()->settings().inertVisualViewport())
|
| + return m_visualViewport->pageX();
|
| +
|
| FrameView* view = frame()->view();
|
| if (!view)
|
| return 0;
|
|
|
| - FrameHost* host = frame()->host();
|
| - if (!host)
|
| - return 0;
|
| -
|
| frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets();
|
|
|
| - ScrollableArea* viewport = host->settings().inertVisualViewport() ? view->layoutViewportScrollableArea() : view->getScrollableArea();
|
| - double viewportX = viewport->scrollPositionDouble().x();
|
| + double viewportX = view->layoutViewportScrollableArea()->scrollPositionDouble().x();
|
| return adjustScrollForAbsoluteZoom(viewportX, frame()->pageZoomFactor());
|
| }
|
|
|
| double LocalDOMWindow::scrollY() const
|
| {
|
| - if (!frame())
|
| + if (!frame() || !frame()->host())
|
| return 0;
|
|
|
| + if (!frame()->host()->settings().inertVisualViewport())
|
| + return m_visualViewport->pageY();
|
| +
|
| FrameView* view = frame()->view();
|
| if (!view)
|
| return 0;
|
|
|
| - FrameHost* host = frame()->host();
|
| - if (!host)
|
| - return 0;
|
| -
|
| frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets();
|
|
|
| - ScrollableArea* viewport = host->settings().inertVisualViewport() ? view->layoutViewportScrollableArea() : view->getScrollableArea();
|
| - double viewportY = viewport->scrollPositionDouble().y();
|
| + double viewportY = view->layoutViewportScrollableArea()->scrollPositionDouble().y();
|
| return adjustScrollForAbsoluteZoom(viewportY, frame()->pageZoomFactor());
|
| }
|
|
|
|
|