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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 1291343008: Fix crash in WebViewImpl::contentsPreferredMinimumSize (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | 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 3685c4b4286efac4d1d7c3b34aae18da0824e2b0..35acca7449c0db5444e80150272ce6fe129520a3 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -3397,11 +3397,12 @@ IntSize WebViewImpl::contentsSize() const
WebSize WebViewImpl::contentsPreferredMinimumSize()
{
+ layout();
+
Document* document = m_page->mainFrame()->isLocalFrame() ? m_page->deprecatedLocalMainFrame()->document() : 0;
if (!document || !document->layoutView() || !document->documentElement() || !document->documentElement()->layoutBox())
return WebSize();
- layout();
int widthScaled = document->layoutView()->minPreferredLogicalWidth().round(); // Already accounts for zoom.
int heightScaled = document->documentElement()->layoutBox()->scrollHeight().round();
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