CVS commit by carewolf: The rest of the mergable acid2 patches. The rest either; doesn't apply (acid2.txt, acid11.txt), was already fixed but never copied by Apple (acid.txt), ridiculous SGML legacy (acid6.txt), or something I will have to work more on (acid10.txt) M +11 -1 ChangeLog 1.426 M +16 -8 rendering/render_block.cpp 1.66 M +16 -11 rendering/render_table.cpp 1.280 --- kdelibs/khtml/ChangeLog #1.425:1.426 @@ -1,5 +1,15 @@ 2005-05-01 Allan Sandfeld Jensen - * renderer/render_box.{h,cpp}: Respect min/max width/height and box-sizing + The mergeable of Daves Acid2 patches. + + * renderer/render_block.cpp: + - Make sure that percentages that go to auto don't mess up the self-collapsing block check. + - Fix floats to not grow if child floats overhang but the height of the outer float is auto. + * renderer/render_box.{h,cpp}: + - Add support for min/max-width/height for positioned elements. + - Make sure percentage min-height goes to 0 and not auto when the percentage does not apply. + * renderer/render_table.cpp: + - Make sure empty tables honor CSS-specified height in strict mode. + - Fix baseline alignment within table cells to use the bottom of empty blocks. 2005-04-30 Harri Porten --- kdelibs/khtml/rendering/render_block.cpp #1.65:1.66 @@ -407,8 +407,16 @@ bool RenderBlock::isSelfCollapsingBlock( 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. @@ -565,5 +573,5 @@ void RenderBlock::layoutBlock(bool relay } - if( hasOverhangingFloats() && (isFloating() || isTableCell())) { + if( hasOverhangingFloats() && ((isFloating() && style()->height().isVariable()) || isTableCell())) { m_height = floatBottom(); m_height += borderBottom() + paddingBottom(); --- kdelibs/khtml/rendering/render_table.cpp #1.279:1.280 @@ -1205,5 +1205,5 @@ void RenderTableSection::calcRowHeight() { int b=cell->baselinePosition(); - + if (b > cell->borderTop() + cell->paddingTop()) { if (b>baseline) baseline=b; @@ -1214,4 +1214,5 @@ void RenderTableSection::calcRowHeight() } } + } //do we have baseline aligned elements? @@ -1970,12 +1971,16 @@ bool RenderTableCell::absolutePosition(i short RenderTableCell::baselinePosition( bool ) const { - RenderObject *o = firstChild(); + RenderObject* o = firstChild(); int offset = paddingTop() + borderTop(); - if ( !o ) return offset; - while ( o->firstChild() ) { - if ( !o->isInline() ) + if (!o) return offset + contentHeight(); + while (o->firstChild()) { + if (!o->isInline()) offset += o->paddingTop() + o->borderTop(); o = o->firstChild(); } + + if (!o->isInline()) + return paddingTop() + borderTop() + contentHeight(); + offset += o->baselinePosition( true ); return offset;