inline block patch

David Hyatt hyatt at apple.com
Mon Nov 10 00:54:37 CET 2003


At the CSS WG last week in San Diego, we decided that inline blocks 
should expand to encompass floats by default, and that they should also 
not collapse their margins with the margins of their children.

Here's the patch:

-------------- next part --------------
Index: khtml/rendering/render_block.cpp
===================================================================
RCS file: /local/home/cvs/Labyrinth/WebCore/khtml/rendering/render_block.cpp,v
retrieving revision 1.73
diff -u -p -r1.73 khtml/rendering/render_block.cpp
--- khtml/rendering/render_block.cpp	2003/10/31 00:11:44	1.73
+++ khtml/rendering/render_block.cpp	2003/11/06 16:40:54
@@ -438,7 +438,7 @@ void RenderBlock::layoutBlock(bool relay
         layoutBlockChildren( relayoutChildren );
 
     // Expand our intrinsic height to encompass floats.
-    if ( hasOverhangingFloats() && (isFloatingOrPositioned() || style()->hidesOverflow() ||
+    if ( hasOverhangingFloats() && (isInlineBlockOrInlineTable() || isFloatingOrPositioned() || style()->hidesOverflow() ||
                                     (parent() && parent()->isFlexibleBox())) )
         m_height = floatBottom() + borderBottom() + paddingBottom();
            
@@ -536,7 +536,7 @@ void RenderBlock::layoutBlockChildren( b
     // For now we only worry about the top border/padding.  We will update the variable's
     // value when it comes time to check against the bottom border/padding.
     bool canCollapseWithChildren = !isCanvas() && !isRoot() && !isPositioned() &&
-        !isFloating() && !isTableCell() && !style()->hidesOverflow();
+        !isFloating() && !isTableCell() && !style()->hidesOverflow() && !isInlineBlockOrInlineTable();
     bool canCollapseTopWithChildren = canCollapseWithChildren && (m_height == 0);
 
     // If any height other than auto is specified in CSS, then we don't collapse our bottom
-------------- next part --------------



More information about the Khtml-devel mailing list