Re: [CSS21] Issue 142: the term "ancestor box"

On Wednesday 06 October 2010 18:44:43 Boris Zbarsky wrote:
> On 10/6/10 12:28 PM, Bert Bos wrote:

> >     2. For other elements, if the element's position is 'relative'
> >     
> >        or 'static', the containing block is one of the following:
> >           a. If the element is a 'run-in' that is rendered inline
> >           in a
> >           
> >              sibling element, then its containing block is the
> >              content edge of the principal box of that sibling.
> >           
> >           b. Otherwise, if the parent has a principal box that is a
> >           block
> >           
> >              container box (e.g., if the parent is a 'table-cell'
> >              or a 'block'), then the containing block is the
> >              content edge of the parent's principal box.
> >           
> >           c. Otherwise the containing block is the same as that of
> >           the
> >           
> >              parent.

Here is an updated proposal, removing 'run-in' and inserting anonymous 
table cells instead.

Bullet 2 of 10.1 (Definition of "containing block") currently reads:

|  2. For other elements, if the element's position is 'relative' or
|     'static', the containing block is formed by the content edge of
|     the nearest block container[ref] ancestor box.

Before the latest WD, it read:

|  2. For other elements, if the element's position is 'relative' or
|     'static', the containing block is formed by the content edge of
|     the nearest block-level[ref], table cell or inline-block ancestor
|     box.

Issues to solve:

a) (Issue 142.) The spec defines the terms "block container box" (a type 
of box) and "ancestor" (a type of element) and thus "block container 
ancestor box" is loose language and needs to be made precise. 

b (Issue 197.) Because of difficulty finding sufficiently many 
implementations in the short term, we decided[1] to leave 'run-in' out 
of level 2.

c) There is probably a consensus for letting anonymous table cells, 
unlike other anonymous block boxes, form a containing block for their 
content.

d) Until the latest WD, bullet 2 said these elements established 
containing blocks: 'block', 'list-item', 'caption', 'inline-block', 
'table-cell' and 'table'. The latest WD removed 'table'. I think that 
was unintentional. And probably 'inline-table' should be added.

All that leads to this replacement text:

#  2. For other elements, if the element's position is 'relative'
#     or 'static', the containing block is one of the following:
#
#        a. If an anonymous table-cell is generated to contain the
#           element (i.e., if the parent is a tabular container[2]
#           and the element itself is not a table-cell, see section
#           17.2.1[3]), then the containing block is the content edge
#           of that anonymous table-cell.
#
#        b. Otherwise, if the computed value of the parent's 'display'
#           property is 'block', 'list-item', ['inline-table', 'table',]
#           'caption', 'inline-block', or 'table-cell, then the
#           containing block is the content edge of the parent's
#           principal box.
#
#        c. Otherwise the containing block is the same as that of the
#           parent.

... where the bracketed text ['inline-table', 'table',] in (b) is yet to 
be decided.

[1] http://www.w3.org/blog/CSS/2011/01/27/resolutions_145
[2] http://www.w3.org/TR/CSS2/tables.html#tabular-container
    (anchor doesn't exist yet)
[3] http://www.w3.org/TR/CSS2/tables.html#anonymous-boxes




Bert

P.S. There is a small inconsistency between 17.4 (Tables in the visual 
formatting model[4]) and 9.2.1 (Block-level elements and block 
boxes[5]). The former talks about "principal block box" while the latter 
calls it a "principal block-LEVEL box." I vote for the shorter name.

[4] http://www.w3.org/TR/CSS2/tables.html#model
[5] http://www.w3.org/TR/CSS2/visuren.html#block-boxes

-- 
  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos                               W3C/ERCIM
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France

Received on Wednesday, 2 March 2011 16:31:43 UTC