Re: [CSS21] Height of block whose child has 0 height and/or clearance

On 08/02/2011 13:47, Øyvind Stenhaug wrote:
> The 10.6.3 text seems to have multiple problems.

Indeed.  (I'm surprised I didn't spot these when I raised [1], but I was 
specifically concentrating on margin collapsing at the time rather than 
on the validity of 10.6.3 itself!)

> 2. In the "block-level children" case, defines height as the distance
> between edges of boxes that do not have margins collapsed through it -
> what if there is no such box?
>
> 3. What if the "topmost block-level child box" has clearance? This case
> doesn't seem to be considered.
>
> 4. The case of no content at all probably requires special mention too

This whole paragraph (block-level children) is a mess.

The top border edge position of the element, and hence the location of 
the top content edge, is well-defined elsewhere in the spec and needs no 
explanation in this paragraph.  To determine the height of the element, 
it's enough to determine the bottom content edge E.

Let Z be the bottommost in-flow block-level child box.  If the bottom 
margin of Z does not collapse with the element's bottom margin, then E 
is incident with Z's bottom margin edge.  Otherwise, let Y be the 
bottommost in-flow block-level child box whose top and bottom margins do 
not collapse together.  If Y exists then E is incident with the bottom 
margin edge or the bottom border edge of Y depending on whether the 
bottom margin of Y does or does not collapse with the element's bottom 
margin.  Otherwise, or if Z does not exist, the element's height is zero.

[As I've pointed out before, by "bottom margin" of an element X we 
really mean (due to margin collapsing) the margin lump of which the 
bottom margin of X is a constituent part.]

That is a non-trivial result, but it follows from other parts of the 
spec (including complex parts concerning margin collapsing, clearance, 
etc).  On the other hand, it's also an obvious result.  No justification 
for this result needs to be given in 10.6.3; it merely needs to be stated.

Note that the resolution to this issue will possibly obsolete the issue 
in [1] (labelled as DET2 in [2]), as indeed would be the case with my 
suggested resolution above.

[1] http://lists.w3.org/Archives/Public/www-style/2010Aug/0108.html
[2] http://lists.w3.org/Archives/Public/www-style/2010Dec/0312.html

Cheers,
Anton Prowse
http://dev.moonhenge.net

Received on Wednesday, 16 February 2011 22:01:04 UTC