Re: [css-tables][css2.1] What should the measurement of the table be?

On 3/22/15 10:32 AM, Robert Hogan wrote:
> While fixing the rendering of table 2 on Blink I encountered a
> regression in the following test case:
>
> http://jsbin.com/cifoqapuho/1/edit
>
> Blink's old behaviour and Firefox's current behaviour fills the viewport
> with green in this testcase, but my understanding from the discussion in
> this thread was that the content of the cell should not exceed 1px in
> height.
>
> Which is the correct rendering?

I think the relevant bit of CSS2.1 here (insofar as table layout is 
defined there at all) is 
http://www.w3.org/TR/CSS21/tables.html#height-layout which says:

   The height of a 'table-row' element's box is calculated once the user
   agent has all the cells in the row available: it is the maximum of
   the row's computed 'height', the computed 'height' of each cell in
   the row, and the minimum height (MIN) required by the cells

In this testcase, the row has a computed height of whatever the viewport 
height is, right?  That's greater than 1px, so that's the height of the row.

That said, CSS2.1 then goes on to say:

   CSS 2.1 does not define how the height of table cells and table rows
   is calculated when their height is specified using percentage values.

hence the "insofar" bit above.

Anyway, if we accept that the height of the row is viewport height, the 
next relevant bit is:

   In CSS 2.1, the height of a cell box is the minimum height required
   by the content. The table cell's 'height' property can influence the
   height of the row (see above), but it does not increase the height of
   the cell box.

In other words, the "1px" feeds into the row height, where it is then 
overridden by the explicit styling of the row itself.

I guess it should also feed into the percentage base for the div inside 
the cell, as the spec is currently written, but doing that leads to 
web-incompatible results, as you discovered.

There's another fun bit of non-interop here: if you give the row a fixed 
height of "100px" then it looks to me like everyone other than Gecko 
keeps having the .content be the height of the viewport, while Gecko 
will actually make the .content be 1px tall.  The Gecko behavior is the 
one the CSS2.1 spec calls for at the moment, and once that fixed height 
is used there is no longer an issue with the undefined behavior invoked 
by percentage heights on rows/cells, so the spec might even mean 
something.  Maybe.

I'm not sure any of that really answers your question....

-Boris

Received on Monday, 23 March 2015 01:44:42 UTC