Index: Source/web/WebViewImpl.cpp |
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp |
index 6eb50580c2bf29e160f74b222c7187075b105a8d..442a6e6fafd88ac6fb79b4bd1b392e1ac3091d6b 100644 |
--- a/Source/web/WebViewImpl.cpp |
+++ b/Source/web/WebViewImpl.cpp |
@@ -3397,12 +3397,13 @@ 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 |
+ LayoutBox* box = document->documentElement()->layoutBox(); |
+ int heightScaled = static_cast<int>(adjustLayoutUnitForAbsoluteZoom(box->scrollHeight(), *box) * zoomLevelToZoomFactor(zoomLevel()) + 0.5); // +0.5 to round rather than truncating |
bokan
2015/08/13 15:49:04
Did you forget to remove the second zoom factor? I
Rick Byers
2015/08/13 16:51:54
I was attempting to leave the behavior exactly the
|
return IntSize(widthScaled, heightScaled); |
} |