Fix the smile in the Acid2 test. Floats should not grow to contain other floats...
authorhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Apr 2005 11:07:34 +0000 (11:07 +0000)
committerhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Apr 2005 11:07:34 +0000 (11:07 +0000)
the float should use the specified height.

Also fix row 14 of the Acid2 test.  Although ambiguous, just modify the table cell baseline alignment code to align
to the bottom of the cell's content height if no suitable baseline could be found.

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::layoutBlock):
        * khtml/rendering/render_block.h:
        (khtml::RenderBlock::firstRootBox):
        (khtml::RenderBlock::lastRootBox):
        * khtml/rendering/render_table.cpp:
        (RenderTableSection::calcRowHeight):
        (RenderTableCell::baselinePosition):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@9027 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog-2005-08-23
WebCore/khtml/rendering/render_block.cpp
WebCore/khtml/rendering/render_block.h
WebCore/khtml/rendering/render_table.cpp

index d1e3c6f7dfc3180769167ebcd3f74cc5c26bd720..04e92bca2357a1389818b0af42e154d2451ef52b 100644 (file)
@@ -1,3 +1,20 @@
+2005-04-18  David Hyatt  <hyatt@apple.com>
+
+       Fix the smile in the Acid2 test.  Floats should not grow to contain other floats unless height is auto.  Otherwise
+       the float should use the specified height.
+
+       Also fix row 14 of the Acid2 test.  Although ambiguous, just modify the table cell baseline alignment code to align
+       to the bottom of the cell's content height if no suitable baseline could be found.
+       
+        * khtml/rendering/render_block.cpp:
+        (khtml::RenderBlock::layoutBlock):
+        * khtml/rendering/render_block.h:
+        (khtml::RenderBlock::firstRootBox):
+        (khtml::RenderBlock::lastRootBox):
+        * khtml/rendering/render_table.cpp:
+        (RenderTableSection::calcRowHeight):
+        (RenderTableCell::baselinePosition):
+        
 2005-04-15  David Hyatt  <hyatt@apple.com>
 
        Make sure empty tables honor CSS-specified heights when they have no rows or sections.  This is done only
index 41ceccd0874eb646ce5bb9cdbd3684c8585c1fc5..f47f89ce80cd577edbcba963d7516fa7eadd3f06 100644 (file)
@@ -534,7 +534,7 @@ void RenderBlock::layoutBlock(bool relayoutChildren)
             m_height = m_overflowHeight + borderBottom() + paddingBottom();
     }
 
-    if (hasOverhangingFloats() && (isFloating() || isTableCell())) {
+    if (hasOverhangingFloats() && ((isFloating() && style()->height().isVariable()) || isTableCell())) {
         m_height = floatBottom();
         m_height += borderBottom() + paddingBottom();
     }
index 611cb1771fe2145c2821b0ba4f509da62c628eb1..fd865a29eedd2c3b952bef7b4030092f9129ecc3 100644 (file)
@@ -197,8 +197,8 @@ public:
 
     virtual int getBaselineOfFirstLineBox() const;
 
-    RootInlineBox* firstRootBox() { return static_cast<RootInlineBox*>(m_firstLineBox); }
-    RootInlineBox* lastRootBox() { return static_cast<RootInlineBox*>(m_lastLineBox); }
+    RootInlineBox* firstRootBox() const { return static_cast<RootInlineBox*>(m_firstLineBox); }
+    RootInlineBox* lastRootBox() const { return static_cast<RootInlineBox*>(m_lastLineBox); }
 
     // Obtains the nearest enclosing block (including this block) that contributes a first-line style to our inline
     // children.
index 7764c4ec098e01afb1874eb1cb835e7fd5392d30..7ad2e222ee35a1303951e8a5ed1c333e023c6ddc 100644 (file)
@@ -1123,13 +1123,14 @@ void RenderTableSection::calcRowHeight()
                || va == SUPER || va == SUB)
            {
                int b=cell->baselinePosition();
+                if (b > cell->borderTop() + cell->paddingTop()) {
+                    if (b>baseline)
+                        baseline=b;
 
-               if (b>baseline)
-                   baseline=b;
-
-               int td = rowPos[ indx ] + ch - b;
-               if (td>bdesc)
-                   bdesc = td;
+                    int td = rowPos[ indx ] + ch - b;
+                    if (td>bdesc)
+                        bdesc = td;
+                }
            }
        }
 
@@ -1665,14 +1666,18 @@ bool RenderTableCell::absolutePosition(int &xPos, int &yPos, bool f)
 
 short RenderTableCell::baselinePosition( bool ) const
 {
-    RenderObject *o = firstChild();
+    RenderObjecto = 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;
 }