diff options
author | android-build SharedAccount <android-build@sekiwake.mtv.corp.google.com> | 2009-10-01 08:43:40 -0700 |
---|---|---|
committer | android-build SharedAccount <android-build@sekiwake.mtv.corp.google.com> | 2009-10-01 08:43:40 -0700 |
commit | a0d5dbfcbb7c62ec014dd3033ef3efac4ecd3b79 (patch) | |
tree | dc76673f3ef10079419f664badff73b5b3118e9d /WebCore/rendering/RenderPartObject.cpp | |
parent | 0fade321435f38382c614ade7b64e6b68440d747 (diff) | |
parent | 8b101d480f638c14f332d4be73a74925bfed1d82 (diff) | |
download | external_webkit-a0d5dbfcbb7c62ec014dd3033ef3efac4ecd3b79.zip external_webkit-a0d5dbfcbb7c62ec014dd3033ef3efac4ecd3b79.tar.gz external_webkit-a0d5dbfcbb7c62ec014dd3033ef3efac4ecd3b79.tar.bz2 |
Merge commit 'goog/eclair' into eclair-release
Diffstat (limited to 'WebCore/rendering/RenderPartObject.cpp')
-rw-r--r-- | WebCore/rendering/RenderPartObject.cpp | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/WebCore/rendering/RenderPartObject.cpp b/WebCore/rendering/RenderPartObject.cpp index 5f6d903..72298c6 100644 --- a/WebCore/rendering/RenderPartObject.cpp +++ b/WebCore/rendering/RenderPartObject.cpp @@ -386,11 +386,13 @@ void RenderPartObject::layout() h = 0; if (w != view->width() || h != view->height()) { view->resize(w, h); - root->setNeedsLayout(true, false); } + // Layout the view. - if (view->needsLayout()) + do { view->layout(); + } while (view->layoutPending() || root->needsLayout()); + int contentHeight = view->contentsHeight(); int contentWidth = view->contentsWidth(); // Only change the width or height if scrollbars are visible or @@ -403,6 +405,20 @@ void RenderPartObject::layout() // Update one last time updateWidgetPosition(); + +#if !ASSERT_DISABLED + ASSERT(!view->layoutPending()); + ASSERT(!root->needsLayout()); + // Sanity check when assertions are enabled. + RenderObject* c = root->nextInPreOrder(); + while (c) { + ASSERT(!c->needsLayout()); + c = c->nextInPreOrder(); + } + Node* body = document()->body(); + if (body) + ASSERT(!body->renderer()->needsLayout()); +#endif } } } @@ -446,8 +462,9 @@ void RenderPartObject::calcWidth() { updateWidgetPosition(); // Layout to get the content width - while (view->needsLayout()) + do { view->layout(); + } while (view->layoutPending() || root->needsLayout()); setWidth(max(width(), view->contentsWidth() + extraWidth)); @@ -471,8 +488,9 @@ void RenderPartObject::calcHeight() { updateWidgetPosition(); // Layout to get the content height - while (view->needsLayout()) + do { view->layout(); + } while (view->layoutPending() || root->needsLayout()); int extraHeight = paddingTop() + paddingBottom() + borderTop() + borderBottom(); setHeight(max(width(), view->contentsHeight() + extraHeight)); |