Re: [CSS21] Proposal to define "Block container element"

On 02/08/2012 15:47, Alan Stearns wrote:
> On 8/1/12 11:24 PM, "Anton Prowse" <prowse@moonhenge.net> wrote:
>
>>> On 15/07/2012 01:12, Anton Prowse wrote:
>>> The term "Block container element" is not defined in CSS21 (although
>>>> block container /box/ is, in 9.2.1.).  Several participants on this
>>>> list
>>>> have expressed concern about this in the past.
>>>
>>>> I propose the following insertions/deletions to 9.2.1.  The changes are
>>>> limited to shuffling a couple of existing sentences around (untouched)
>>>> and introducing just two new concepts:
>>>>
>>>> (1) The definition of "principal block-level box" is extended to
>>>> "principal box" for a wider range of elements (inline block, inline
>>>> table and table cell in addition to block-level elements).  This has no
>>>> effect on the rest of the spec, since the only cases where the
>>>> principal
>>>> box is referred to is in the context of block-level elements/boxes.
>>>>
>>>> (2) The term "block container element" is introduced to mean an element
>>>> whose principal box is a block container box, ie a block, list-item,
>>>> inline-block, table, inline-table or table-cell in CSS21.
>>
>> In [1], in response to the proposal in [2], Alan Stearns asks:
>>
>>> Should table-caption also be on the list [of elements which are
>>> block  container elements]?
>>
>> Table captions are necessarily block-level, so are already included.
>
> Thanks. I should have been more specific about which list. The list I was
> referring to is this one:
>
> # The following
>    # values of the 'display' property make a non-replaced element a
>    # block container: 'block', 'list-item', 'table', 'inline-block',
>    # 'inline-table', 'table-cell'.
>

Ah, well spotted!  It should.

[Aside:

I had created my list of display types by augmenting the list of 
block-level display types that's already given in 9.2.1 with the new 
stuff that would give rise to a principal box (namely inline block, 
inline table and table cell).  My mistake lay in forgetting that said 
list is itself incomplete!  From [1]:

fantasai writes:
> On 07/29/2010 02:35 PM, Boris Zbarsky wrote:
>> Anton Prowse wrote:
>>> [...] table-caption elements need to be included in the
>>> classification of block-level elements in 9.2.1.
>>
>> Agreed.
>
> Table-caption elements are explicitly defined to be block-level elements
> in 17.4, so this is already unambiguous. We could also add them to 9.2.1;
> however, I don't think this is a good idea because in the future we'll
> have caption-side: left | right again, and the behavior there is not really
> the behavior of a block-level element.

Is the incompleteness of the list of block-level elements too confusing? 
  I tend to think it is, although of course I see the point that 
fantasai was making.

Perhaps we could get rid of that list as follows.  We could define a 
block-level element as being an element whose principal box is 
block-level, and rely on (and expand out the "block-level elements" bit 
of) my newly-introduced and complete list of display types which cause 
an element to generate a principal box.  That's easy to do, and it 
allays fantasai's concern (since a table caption will generate a 
principal box irrespective of the fact that it might not be block-level 
in some future spec), and it also addresses Peter Moulder's observation 
in [2] that 17.4 actually fails to say that table-caption *elements* are 
block-level in CSS21.

This will be the subject of a separate errata item, though.]


On 02/08/2012 15:47, Alan Stearns wrote:
> On 8/1/12 11:24 PM, "Anton Prowse" <prowse@moonhenge.net> wrote:
>> Alan Stearns asks:
>>>
>>> Is a ::before {display:block} a "block container element"?
>>
>> CSS21 uses the word "element" in a way which includes pseudo-elements.
>> So the question is really asking, can pseudo-elements generate a
>> principal box?  I feel that they can/should, depending on their display
>> type of course.  Do you see any potential issues with that?
>
> No issue - I was unclear whether "element" included pseudo-elements.
> Thanks for the clarification.

OK, cool.


[1] http://lists.w3.org/Archives/Public/www-style/2010Aug/0026.html
[2] http://lists.w3.org/Archives/Public/www-style/2010Aug/0029.html

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

Received on Thursday, 2 August 2012 19:47:18 UTC