Chromium Code Reviews| Index: Source/web/WebViewImpl.cpp |
| diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp |
| index 30a4a43100e1847891cc95728ebfc689c1ad513f..a19ee0115a8fd9e8959551635bda867dcfd28018 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(); |
| + // We truncate then zoom the height instead of rounding to match the width behavior. |
|
pdr.
2015/03/26 20:19:36
Can you add a fixme and file a separate bug for th
|
| + int heightScaled = adjustLayoutUnitForAbsoluteZoom(documentBox->scrollHeight(), *documentBox).toInt() * zoomLevelToZoomFactor(zoomLevel()); |
| return IntSize(widthScaled, heightScaled); |
| } |