Re: [CSS21] Distinguishing block boxes, block containers, and block-level elements

Anton Prowse wrote:
> fantasai wrote:
>> CSS2.1 Issue 120
>>   http://wiki.csswg.org/spec/css2.1#issue-120
>>
>> The approach taken is to define existing terms more precisely, define a
>> couple of new terms, and use all of these terms more accurately 
>> throughout
>> the specification.

>>   | Block-level elements generate a principal block-level box that
>>   | contains descendant boxes and generated content and is also
>>   | the box involved in any positioning scheme.

>>   | Except for 'table' elements, which are described in a later chapter,
>>   | and replaced elements, the principal block-level box is also a
>>   | <dfn>block container box</dfn>.

>>   | A block container box contains either
>>   | only block-level boxes or only inline-level boxes.
> 
> Hang on, what's a "block-level box"?  This is an important ambiguity.  I
> /think/ you intend it to be precisely a principal block-level box or an
> anonymous block-level box as described in 9.2.1.1 (Anonymous block boxes).
> 
> Note that you haven't really defined "block container box", although you
> have described its behaviour.  (I think perhaps these sorts of
> definition-by-behaviour-without-classification instances in the
> spec should be rewritten, since its usually unclear whether the /only/
> elements/boxes which are X are necessarily those mentioned when
> describing X's behaviour.) A block container box isn't necessarily a
> principal block-level box - nor block-level at all - for example:
> 
>>   | Inline blocks, table cells, and table captions are also block
>>   | container boxes, but are not block-level boxes.

Is there such a thing as a block-level box which is not a block
container box?  By analogy with principal block-level boxes, I presume
that the anonymous box of a table might be one example, and – assuming
that a principal block-level box is a block-level box – the principal
block-level box of a replaced element is another.  Are there any other
exceptions?

>>   | Boxes that are
>>   | block-level block containers are called <dfn>block boxes</dfn>.
> 
> OK.  The term "block box" is more specialized in your proposal than in
> the current spec.

>>   | Replaced block-level
>>   | boxes are considered block boxes, but are not block container boxes.
> 
> This directly contradicts the definition!  Hence the definition needs
> rewording:
> 
>   | A <dfn>block box</dfn> is a block-level box that is either a block
>   | container box or the principal block-level box of a replaced
>   | element or inline-block.
> 
> (Note the addition of inline-block.)

Depending on the answer to my question posted above, it's likely the
case that the only type of block box that is not a block container box
is an anonymous table box.

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

Received on Sunday, 1 August 2010 21:13:44 UTC