Index: khtml/rendering/render_block.cpp
===================================================================
RCS file: /local/home/cvs/Labyrinth/WebCore/khtml/rendering/render_block.cpp,v
retrieving revision 1.179
diff -u -p -r1.179 khtml/rendering/render_block.cpp
--- khtml/rendering/render_block.cpp 2005/02/23 21:38:20 1.179
+++ khtml/rendering/render_block.cpp 2005/04/15 10:43:40
@@ -386,10 +386,18 @@ bool RenderBlock::isSelfCollapsingBlock(
style()->marginTopCollapse() == MSEPARATE || style()->marginBottomCollapse() == MSEPARATE)
return false;
+ bool hasAutoHeight = style()->height().isVariable();
+ if (style()->height().isPercent() && !style()->htmlHacks()) {
+ hasAutoHeight = true;
+ for (RenderBlock* cb = containingBlock(); !cb->isCanvas(); cb = cb->containingBlock()) {
+ if (cb->style()->height().isFixed() || cb->isTableCell())
+ hasAutoHeight = false;
+ }
+ }
+
// If the height is 0 or auto, then whether or not we are a self-collapsing block depends
// on whether we have content that is all self-collapsing or not.
- if (style()->height().isVariable() ||
- (style()->height().isFixed() && style()->height().value == 0)) {
+ if (hasAutoHeight || ((style()->height().isFixed() || style()->height().isPercent()) && style()->height().value == 0)) {
// If the block has inline children, see if we generated any line boxes. If we have any
// line boxes, then we can't be self-collapsing, since we have content.
if (childrenInline())