Chromium Code Reviews| Index: Source/web/WebViewImpl.cpp |
| diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp |
| index 30a4a43100e1847891cc95728ebfc689c1ad513f..478987022c90ffbd87a6e99065ac53fa8e7a5024 100644 |
| --- a/Source/web/WebViewImpl.cpp |
| +++ b/Source/web/WebViewImpl.cpp |
| @@ -3364,12 +3364,14 @@ IntSize WebViewImpl::contentsSize() const |
| WebSize WebViewImpl::contentsPreferredMinimumSize() |
| { |
| Document* document = m_page->mainFrame()->isLocalFrame() ? m_page->deprecatedLocalMainFrame()->document() : 0; |
| - if (!document || !document->layoutView() || !document->documentElement()) |
| + if (!document || !document->layoutView() || !document->documentElement() || !document->documentElement()->layoutBox()) |
| return WebSize(); |
| layout(); |
| int widthScaled = document->layoutView()->minPreferredLogicalWidth(); // Already accounts for zoom. |
| - int heightScaled = static_cast<int>(document->documentElement()->scrollHeight() * zoomLevelToZoomFactor(zoomLevel())); |
| + LayoutBox* documentBox = document->documentElement()->layoutBox(); |
| + int heightScaled = adjustLayoutUnitForAbsoluteZoom(documentBox->scrollHeight(), *documentBox).toInt() * zoomLevelToZoomFactor(zoomLevel()); |
| + // int heightScaled = static_cast<int>(document->documentElement()->scrollHeight() * zoomLevelToZoomFactor(zoomLevel())); |
|
eae
2015/03/25 21:41:04
Remove commented add code and please add a comment
|
| return IntSize(widthScaled, heightScaled); |
| } |