Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1969)

Unified Diff: Source/web/WebViewImpl.cpp

Issue 1061153002: Remove WebViewImpl preferred size hack (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use Flexbox to avoid whitespace issue Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index 24c6618d60dcf9d6305107730de5e7ca771ec25f..f93bb2df4bc70da71d10bbdfd2806fc381f83770 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -3374,15 +3374,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() || !document->documentElement()->layoutBox())
+ if (!document || !document->layoutView() || !document->documentElement())
return WebSize();
layout();
- int widthScaled = document->layoutView()->minPreferredLogicalWidth(); // Already accounts for zoom.
- LayoutBox* documentBox = document->documentElement()->layoutBox();
- // TODO(leviw): We truncate then zoom the height instead of rounding to match the width behavior. We
- // should be able to call documentElement's scrollHeight() method. crbug.com/471336
- int heightScaled = adjustLayoutUnitForAbsoluteZoom(documentBox->scrollHeight(), *documentBox).toInt() * zoomLevelToZoomFactor(zoomLevel());
+ int widthScaled = document->layoutView()->minPreferredLogicalWidth().round(); // Already accounts for zoom.
+ int heightScaled = static_cast<int>(document->documentElement()->scrollHeight() * zoomLevelToZoomFactor(zoomLevel()));
return IntSize(widthScaled, heightScaled);
}
« no previous file with comments | « no previous file | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698