W3C home > Mailing lists > Public > www-style@w3.org > August 2010

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

From: Anton Prowse <prowse@moonhenge.net>
Date: Tue, 03 Aug 2010 00:13:04 +0200
Message-ID: <4C5742F0.8050608@moonhenge.net>
To: "www-style@w3.org" <www-style@w3.org>
CC: fantasai <fantasai.lists@inkedblade.net>
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.

>>   | 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>.
> Note that under your proposal, a table now generates a principal
> block-level box, but this is not a block container box.  In the existing
> spec, a table explicitly doesn't generate a principal block-level box,
> but I think you've exactly captured the required distinction.

Note that we have no term to describe the "inside" behaviour of a
principal block-level box of a table.  Maybe it's enough to describe it
as a "table box" when we need to highlight that aspect of it.

>>   | 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 (Anonymous block boxes).

...or an anonymous table-wrapper box of a table box arising from a
display:table element (or equivalently from an anonymous table box with
a non–inline grandparent box)?  Such a box would seem to be a
block container box participating in a block formatting context.

Note that an inline-table would also generate a block-level table box
(that sits inside an inline-level block container box; note that Chapter
17 currently makes a mess of this subtlety, particularly in the case
that the table box is anonymous).  Does we think it deserves to be
called the *principal* block level box of the inline-table element?
Note that this would make inline-table elements the only inline-level
elements that generate a principal block-level box.

> 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.)

I have no idea what moment of madness led me to add inline-block (which
is clearly not block-level under any reasonable interpretation of what
block-level means).  I should have said:

   | 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
   | block-level element.

Sorry about that.

>> Section 9.2.2 Inline-level elements and inline boxes
>>   # Several values of the 'display' property make an element inline:
>>   s/inline/inline-level/
>>   # 'inline', 'inline-table', 'inline-block' and 'run-in' (part of
>>   # the time; see run-in boxes). Inline-level elements generate
>>   # inline boxes.
>>   Replace "inline boxes" with "inline-level boxes, which participate
>>   in an inline formatting context".

>>   Append a new paragraph:
>>   | An <dfn>inline box</dfn> is one that is both inline-level and whose
>>   | children (if any) would participate in its containing inline 
>> formatting
>>   | context. For non-replaced elements, a 'display' value of 'inline' and
>>   | sometimes 'run-in' (when it is not creating a block box) generates an
>>   | inline box. Inline-level boxes that are not inline boxes (such as
>>   | replaced inline elements, inline-block elements, and inline-table
>>   | elements) are called <dfn>atomic inline boxes</dfn> because they
>>   | participate in their inline formatting context as a single opaque 
>> box.

The atomic inline boxes generated for an inline-block and inline-table
are also block container boxes, right?  This would need stating.

Specifically, to re-iterate what I said above, an inline-table generates
a block-level table box which, together with the block-level
table-caption box, is contained by the anonymous inline-level
table-wrapper box that is the atomic inline box you describe.

Anton Prowse
Received on Monday, 2 August 2010 22:14:47 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 16:28:14 UTC