| Index: third_party/WebKit/Source/core/frame/VisualViewport.cpp
|
| diff --git a/third_party/WebKit/Source/core/frame/VisualViewport.cpp b/third_party/WebKit/Source/core/frame/VisualViewport.cpp
|
| index 972c3bd1f4798080d8e9668818e0a3fc4dbaf597..5321bd6e62b7cedd556fbdd785667658cec9695d 100644
|
| --- a/third_party/WebKit/Source/core/frame/VisualViewport.cpp
|
| +++ b/third_party/WebKit/Source/core/frame/VisualViewport.cpp
|
| @@ -211,44 +211,62 @@ void VisualViewport::setScale(float scale)
|
|
|
| double VisualViewport::scrollLeft()
|
| {
|
| + if (!mainFrame())
|
| + return 0;
|
| +
|
| updateLayoutIgnorePendingStylesheets();
|
|
|
| - return visibleRect().x();
|
| + return adjustScrollForAbsoluteZoom(visibleRect().x(), mainFrame()->pageZoomFactor());
|
| }
|
|
|
| double VisualViewport::scrollTop()
|
| {
|
| + if (!mainFrame())
|
| + return 0;
|
| +
|
| updateLayoutIgnorePendingStylesheets();
|
|
|
| - return visibleRect().y();
|
| + return adjustScrollForAbsoluteZoom(visibleRect().y(), mainFrame()->pageZoomFactor());
|
| }
|
|
|
| void VisualViewport::setScrollLeft(double x)
|
| {
|
| + if (!mainFrame())
|
| + return;
|
| +
|
| updateLayoutIgnorePendingStylesheets();
|
|
|
| - setLocation(FloatPoint(x, visibleRect().y()));
|
| + setLocation(FloatPoint(x * mainFrame()->pageZoomFactor(), location().y()));
|
| }
|
|
|
| void VisualViewport::setScrollTop(double y)
|
| {
|
| + if (!mainFrame())
|
| + return;
|
| +
|
| updateLayoutIgnorePendingStylesheets();
|
|
|
| - setLocation(FloatPoint(visibleRect().x(), y));
|
| + setLocation(FloatPoint(location().x(), y * mainFrame()->pageZoomFactor()));
|
| }
|
|
|
| double VisualViewport::clientWidth()
|
| {
|
| + if (!mainFrame())
|
| + return 0;
|
| +
|
| updateLayoutIgnorePendingStylesheets();
|
|
|
| - return visibleRect().width();
|
| + return adjustScrollForAbsoluteZoom(visibleSize().width(), mainFrame()->pageZoomFactor());
|
| }
|
|
|
| double VisualViewport::clientHeight()
|
| {
|
| + if (!mainFrame())
|
| + return 0;
|
| +
|
| updateLayoutIgnorePendingStylesheets();
|
|
|
| - return visibleRect().height();
|
| + return adjustScrollForAbsoluteZoom(visibleSize().height(), mainFrame()->pageZoomFactor());
|
| }
|
|
|
| double VisualViewport::pageScale()
|
|
|