Index: Source/web/WebViewImpl.cpp |
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp |
index 6eb50580c2bf29e160f74b222c7187075b105a8d..8d147685fef696d9853bd60e5eb589dd6fdee550 100644 |
--- a/Source/web/WebViewImpl.cpp |
+++ b/Source/web/WebViewImpl.cpp |
@@ -3397,12 +3397,12 @@ 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().round(); // Already accounts for zoom. |
- int heightScaled = static_cast<int>((document->documentElement()->scrollHeight() * zoomLevelToZoomFactor(zoomLevel())) + 0.5); // +0.5 to round rather than truncating |
+ int heightScaled = document->documentElement()->layoutBox()->scrollHeight().round(); |
return IntSize(widthScaled, heightScaled); |
} |