Chromium Code Reviews| Index: Source/core/rendering/RenderBlock.cpp |
| diff --git a/Source/core/rendering/RenderBlock.cpp b/Source/core/rendering/RenderBlock.cpp |
| index bffaf6158c322e099bcaf57f4dab15055e777396..55756705e51df0fba7e67f74226ad66b75eb0ed5 100644 |
| --- a/Source/core/rendering/RenderBlock.cpp |
| +++ b/Source/core/rendering/RenderBlock.cpp |
| @@ -1178,11 +1178,6 @@ void RenderBlock::removeChild(RenderObject* oldChild) |
| bool RenderBlock::isSelfCollapsingBlock() const |
| { |
| - // Placeholder elements are not laid out until the dimensions of their parent text control are known, so they |
| - // don't get layout until their parent has had layout - this is unique in the layout tree and means |
| - // when we call isSelfCollapsingBlock on them we find that they still need layout. |
| - ASSERT(!needsLayout() || (node() && node()->isElementNode() && toElement(node())->shadowPseudoId() == "-webkit-input-placeholder")); |
| - |
| // We are not self-collapsing if we |
| // (a) have a non-zero height according to layout (an optimization to avoid wasting time) |
| // (b) are a table, |
| @@ -1191,9 +1186,18 @@ bool RenderBlock::isSelfCollapsingBlock() const |
| // (e) have specified that one of our margins can't collapse using a CSS extension |
| // (f) establish a new block formatting context. |
| + // The early exit must be done before we check for clean layout. |
| + // We should be able to give a quick answer if the box is a relayout boundary. |
| + // Being a relayout boundary implies a block formatting context, and also |
|
ojan
2014/04/24 17:22:09
This comment is a little confusing. It talks about
|
| + // our internal layout shouldn't affect our container in any way. |
| if (createsBlockFormattingContext()) |
| return false; |
| + // Placeholder elements are not laid out until the dimensions of their parent text control are known, so they |
| + // don't get layout until their parent has had layout - this is unique in the layout tree and means |
| + // when we call isSelfCollapsingBlock on them we find that they still need layout. |
| + ASSERT(!needsLayout() || (node() && node()->isElementNode() && toElement(node())->shadowPseudoId() == "-webkit-input-placeholder")); |
| + |
| if (logicalHeight() > 0 |
| || isTable() || borderAndPaddingLogicalHeight() |
| || style()->logicalMinHeight().isPositive() |