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

Unified Diff: Source/core/page/FrameView.cpp

Issue 14139021: Fix ASSERT(needsLayout()) failing when autosize mode is enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: sync Created 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/FrameView.cpp
diff --git a/Source/core/page/FrameView.cpp b/Source/core/page/FrameView.cpp
index 009fc2c9c9d0ebea34eb1cb3b19d741538ccaa9c..5a58a2afed35037d91379f3b6280ed582e027d23 100644
--- a/Source/core/page/FrameView.cpp
+++ b/Source/core/page/FrameView.cpp
@@ -2451,8 +2451,14 @@ void FrameView::autoSizeIfEnabled()
if (!documentView || !documentElement)
return;
- // Start from the minimum height and allow it to grow.
- resize(frameRect().width(), m_minAutoSize.height());
+ RenderBox* documentRenderBox = documentElement->renderBox();
+ if (!documentRenderBox)
+ return;
+
+ // If this is the first time we run autosize, start from small height and
+ // allow it to grow.
+ if (!m_didRunAutosize)
+ resize(frameRect().width(), m_minAutoSize.height());
IntSize size = frameRect().size();
@@ -2462,7 +2468,7 @@ void FrameView::autoSizeIfEnabled()
// Update various sizes including contentsSize, scrollHeight, etc.
document->updateLayoutIgnorePendingStylesheets();
int width = documentView->minPreferredLogicalWidth();
- int height = documentView->documentRect().height();
+ int height = documentRenderBox->scrollHeight();
IntSize newSize(width, height);
// Check to see if a scrollbar is needed for a given dimension and
« 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