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

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

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Mon, 31 May 2010 00:26:14 -0400
Message-ID: <4C033A66.2070902@mit.edu>
To: www-style list <www-style@w3.org>
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.


[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 style="display:table-cell;background:green">a<br/>b</div>
Received on Monday, 31 May 2010 04:26:49 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:35 UTC