W3C home > Mailing lists > Public > www-style@w3.org > July 2012

[CSS21] Proposal to define "Block container element"

From: Anton Prowse <prowse@moonhenge.net>
Date: Sun, 15 Jul 2012 01:12:29 +0200
Message-ID: <5001FCDD.9040900@moonhenge.net>
To: "www-style@w3.org" <www-style@w3.org>
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.

In places where the context is elements (such as the "Applies to" line 
of properties) we have tended to write "block containers", deliberately 
omitting the final word so as to make the phrase suitably ambiguous to 
work around the lack of definition.

In some places we don't even make that effort: 10.8.1 refers to "block 
container elements" after the definition of the 'vertical-align' and 
'line-height' properties and even links back to 9.2.1 where of course 
there is no definition.  When asked, we've hand-waved it away as being 
merely part of the general element vs box sloppiness.

Recently I hit upon yet another place in the spec where the context is 
elements and where the spec needs to be updated to refer to block 
containers: Appendix E. [1]  The new text will be incongruous if we 
don't define "block container element".

[Furthermore, if block container element were defined, and were defined 
to include table and inline-table elements (which seems reasonable given 
that the principal table wrapper box is a block container box) then this 
spec bug -

Bug 15381 - "Applies To" line for 'overflow' property was changed to 
"block containers" which failed to account for table box 
[https://www.w3.org/Bugs/Public/show_bug.cgi?id=15381]

- would be fixed (because table elements would then be subject to 
'overflow', which would have its effect on the table box as per the 17.4 
property distribution between wrapper and table box)... although note 
that we've already resolved to fix this bug in a different way anyhow, 
via defining "formatting context" and setting the Applies To line to be 
"block containers and boxes that establish a formatting context" whilst 
simultaneously defining that a table box establishes a table formatting 
context.]

I have checked all instances in the spec where "block container(s)" is 
used without the word "box" in a context where one expects elements to 
be referred to, and all instances where "block container element(s)" is 
already used, and I have verified that they would remain correct if we 
were to define block container element as per my proposal below.


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.

   # 9.2.1 Block-level elements and block boxes
   #
   # Block-level elements are those elements of the source document
   # that are formatted visually as blocks (e.g., paragraphs). The
   # following values of the 'display' property make an element
   # block-level: 'block', 'list-item', and 'table'.
   #
   # <del>Block-level boxes are boxes that participate in a block
   # formatting context.</del> Each block-level element<ins>, inline
   # block, inline table and table cell</ins> generates a principal
   # <del>block-level</del> box that contains descendant boxes and
   # generated content and is also the box involved in any positioning
   # scheme. Some block-level elements may generate additional boxes in
   # addition to the principal box: 'list-item' elements. These
   # additional boxes are placed with respect to the principal box.
   #
   # <ins>The principal box of a block-level element is a block-level
   # box. Block-level boxes are boxes that participate in a block
   # formatting context.</ins> Except for table boxes, which are
   # described in a later chapter, and <ins>the principal box of</ins>
   # replaced elements, a block-level box is also a block container box.
   # A block container box either contains only block-level boxes or
   # establishes an inline formatting context and thus contains only
   # inline-level boxes.  <del>Not all block container boxes are block-
   # level boxes: non-replaced inline blocks and non-replaced table
   # cells are block containers but not block-level boxes.</del> Block-
   # level boxes that are also block containers are called block boxes.
   #
   # <ins>Block container elements are elements whose principal box
   # is a block container box. The following values of the
   # 'display' property make an element a block container: 'block',
   # 'list-item', 'table', 'inline-block', 'inline-table'.  Non-replaced
   # inline blocks and non-replaced table cells are block containers but
   # are not block-level.
   #
   # The three terms "block-level box," "block container box," and
   # "block box" are sometimes abbreviated as "block" where unambiguous.


Any takers?

[1] http://lists.w3.org/Archives/Public/www-style/2012Jul/0337.html 
(first part)

Cheers,
Anton Prowse
http://dev.moonhenge.net
Received on Saturday, 14 July 2012 23:13:01 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:56 GMT