RE: [CSS21] When line boxes are or are not present is not really defined

On Sunday, May 30, 2010 9:26 PM Boris Zbarsky wrote:
> Section 17.5.3 has this to say:
> 
>      The baseline of a cell is the baseline of the first in-flow line
>      box in the cell, or the first in-flow table-row in the cell,
>      whichever comes first. If there is no such line box or table-row,
>      the baseline is the bottom of content edge of the cell box.
> 
> However nothing defines when line boxes are or are not present.  If a block
> contains only non-preserved whitespace, does it have any line boxes?  The
> end of section 9.4.2 suggests yes[1], but Gecko and Webkit seem to think the
> answer is "no"[2].  Opera seems to think that even an empty block which has
> no child boxes at all has a line box.
> 
> It would be good to get this clarified, since this affects vertical alignment of
> both table cells and inline-block elements and currently we seem to not have
> very good interop here.
> 
> -Boris
> 
> [1] "Line boxes that contain no text, no preserved white space, no
>       inline elements with non-zero margins, padding, or borders, and
>       no other in-flow content (such as images, inline blocks or
>       inline tables), and do not end with a line feed must be treated
>       as zero-height line boxes." though this really does beg the
>       question of whether said line boxes exist at all; they just
>       have to be treated as 0-height if they do exist?
> 
> [2]  Testcase:
> 
>    <div style="display:table">
>      <div style="display:table-row">
>        <div style="display:table-cell;background:red">
>         <div style="width:150px;height:150px;background:blue"> </div>
>        </div>
>        <div style="display:table-cell;background:green">a<br/>b</div>
>      </div>
>    </div>
> 
> 

Thank you for your feedback. The CSSWG has addressed your concerns in the upcoming publication of the CSS 2.1 specification[1]. 

The CSSWG resolved to  make the following changes:

| If an element contains no text, no preserved white
| space, no inline elements with non-zero margins,
| padding, or borders, and no other in-flow content
| (such as images, inline block, or inline tables),
| then no line boxes are generated inside the
| element.  The static position of any child elements
| is the top of the box in the vertical direction,
| and the same position horizontally that a zero
| width, zero height inline replaced element would
| have if placed in the element.  (This, for example,
| respects the text-align property.)

We hope this closes your issue.

Please respond before 18 March, 2011 if you do not accept the current resolution.

[1] http://w3.org/TR/CSS

Received on Wednesday, 16 March 2011 20:11:48 UTC