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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 1291723005: Update WebViewImpl::contentsPreferredMinimumSize to be agnostic to the scrolling element (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Cleanup double zoom code Created 5 years, 4 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 | no next file » | 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 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);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698