Skip to content

Commit 51be219

Browse files
committed
[css2] Fixed height calculation for block boxes to take collapsing margins into account
--HG-- extra : convert_revision : svn%3A73dc7c4b-06e6-40f3-b4f7-9ed1dbc14bfc/trunk%401739
1 parent 5cb14c9 commit 51be219

1 file changed

Lines changed: 28 additions & 12 deletions

File tree

css2/visudet.src

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
22
<html lang="en">
3-
<!-- $Id: visudet.src,v 2.43 1998-05-08 16:28:35 ijacobs Exp $ -->
3+
<!-- $Id: visudet.src,v 2.44 1998-09-28 23:24:16 ijacobs Exp $ -->
44
<HEAD>
55
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
66
<TITLE>Visual formatting model details</TITLE>
7+
<!-- Changed by: Ian B. Jacobs, 28-Sep-1998 -->
78
</HEAD>
89
<BODY>
910
<H1 align="center">Visual formatting model details</H1>
@@ -588,17 +589,32 @@ is the <a href="conform.html#intrinsic">intrinsic</a> height.
588589
<H3>Block-level, non-replaced elements in normal flow, and
589590
floating, non-replaced elements</H3>
590591

591-
<p>If <span class="propinst-top">'top'</span>, <span class="propinst-bottom">'bottom'</span>, <span class="propinst-margin-top">'margin-top'</span>, or <span class="propinst-margin-bottom">'margin-bottom'</span> are 'auto',
592-
their computed value is 0. If <span class="propinst-height">'height'</span> is 'auto', the height depends
593-
on whether the element has any block-level children. If it only has
594-
inline-level children, the height is from the top of the topmost line
595-
box to the bottom of the bottommost line box. If it has block-level
596-
children, it is the distance from the top border-edge of the topmost
597-
block-level child box, to the bottom border-edge of the bottommost
598-
block-level child box. Only children in the normal flow are taken into
599-
account (i.e., floating boxes and absolutely
600-
positioned boxes are ignored, and relatively positioned boxes are considered
601-
without their offset). Note that the child box may be an <a
592+
<p>If <span class="propinst-top">'top'</span>, <span
593+
class="propinst-bottom">'bottom'</span>, <span
594+
class="propinst-margin-top">'margin-top'</span>, or <span
595+
class="propinst-margin-bottom">'margin-bottom'</span> are 'auto',
596+
their computed value is 0. If <span
597+
class="propinst-height">'height'</span> is 'auto', the height depends
598+
on whether the element has any block-level children and whether it has
599+
padding or borders.
600+
601+
<P>If it only has inline-level children, the height is the distance
602+
between the top of the topmost line box and the bottom of the
603+
bottommost line box.
604+
605+
<P>If it has block-level children, the height is the distance between
606+
the top border-edge of the topmost block-level child box and the
607+
bottom border-edge of the bottommost block-level child box. However,
608+
if the element has a non-zero top padding and/or top border, then the
609+
content starts at the top <em>margin</em> edge of the topmost child.
610+
Similarly, if the element has a non-zero bottom padding and/or bottom
611+
border, then the content ends at the bottom <em>margin</em> edge of
612+
the bottommost child.
613+
614+
<P>Only children in the normal flow are taken into account (i.e.,
615+
floating boxes and absolutely positioned boxes are ignored, and
616+
relatively positioned boxes are considered without their offset). Note
617+
that the child box may be an <a
602618
href="visuren.html#anonymous-block-level">anonymous box.</a>
603619

604620
<H3><a name="abs-non-replaced-height">Absolutely positioned, non-replaced elements</a></H3>

0 commit comments

Comments
 (0)