+2005-04-15 David Hyatt <hyatt@apple.com>
+
+ Fix the six pixel gap between rows nine and ten of the Acid2 test. Make sure that percentage heights that
+ resolve to auto are properly treated as though they have auto height by the self-collapsing block check (as per
+ section 8.3.1, paragraph 7 of the CSS2.1 spec).
+
+ * khtml/rendering/render_block.cpp:
+ (khtml::RenderBlock::isSelfCollapsingBlock):
+
2005-04-15 David Hyatt <hyatt@apple.com>
The Acid2 test and the reference rendering both make use of overflow:hidden on the <html> element. Turns out
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())