Chromium Code Reviews| 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..e77b571758d9e313af6e0597453590169c5d483a 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()); |
|
bokan
2016/04/21 13:03:32
ComputedStyle.h is a strange place for this functi
ymalik
2016/04/24 02:25:30
I'll make those changes in a follow up CL if you d
|
| } |
| 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(), visibleRect().y())); |
|
bokan
2016/04/21 13:03:32
use location().y() rather than visibleRect.
ymalik
2016/04/24 02:25:30
Done.
|
| } |
| void VisualViewport::setScrollTop(double y) |
| { |
| + if (!mainFrame()) |
| + return; |
| + |
| updateLayoutIgnorePendingStylesheets(); |
| - setLocation(FloatPoint(visibleRect().x(), y)); |
| + setLocation(FloatPoint(visibleRect().x(), y * mainFrame()->pageZoomFactor())); |
| } |
| double VisualViewport::clientWidth() |
| { |
| + if (!mainFrame()) |
| + return 0; |
| + |
| updateLayoutIgnorePendingStylesheets(); |
| - return visibleRect().width(); |
| + return adjustScrollForAbsoluteZoom(visibleRect().width(), mainFrame()->pageZoomFactor()); |
|
bokan
2016/04/21 13:03:32
visibleSize().width() rather than visibleRect
ymalik
2016/04/24 02:25:30
Done.
|
| } |
| double VisualViewport::clientHeight() |
| { |
| + if (!mainFrame()) |
| + return 0; |
| + |
| updateLayoutIgnorePendingStylesheets(); |
| - return visibleRect().height(); |
| + return adjustScrollForAbsoluteZoom(visibleRect().height(), mainFrame()->pageZoomFactor()); |
| } |
| double VisualViewport::pageScale() |