Re: [css 2.2] [tables] Baseline on empty table cells

On 08/04/2015 10:53 PM, Gérard Talbot wrote:
> Le 2015-07-31 14:19, Robert Hogan a écrit :
>> Hi there,
>>
>> We've hit a bug in Blink while trying to confirm to
>> http://test.csswg.org/harness/test/css21_dev/single/inline-table-valign-002/.
>
> http://test.csswg.org/suites/css2.1/nightly-unstable/html4/inline-table-valign-002.htm
>
> "
> 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.
> "
> CSS 2.1, section 17.5.3 Table height algorithms
> http://www.w3.org/TR/CSS21/tables.html#height-layout
>
> Robert,
>
> In that inline-table-valign-002 test, there is no line box in each cell of the inline-table and there is no in-flow table-row
> in each cell of the inline-table; so the baseline of the cells must be determined by the bottom of content edge, no?

Yes, but what you're missing is the sentence he's quoting:
   "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."

The height of the cell's content box is not set by its
'height' property, it is only set by the size of its
contents. Thus in the case of an empty cell, the height
of the cell's content box is always zero.

When the cell grows to accommodate its 'height' or the
height of other cells in the row, it is its padding-box
that grows, not its content-box.

>> It
>> comes down to what height we should give the second cell box in:
>>
>> <!DOCTYPE html> <style> .cell{ height:453px; vertical-align: baseline; }
>> </style> <table> <td class="cell"> crbug.com/513319: An empty cell even if
>> it has height should set the baseline for the row. This text should be at
>> the top of the page. </td> <td class="cell"> </td> </table>
>
> In your test, the first cell has an in-flow line box: the first cell of your test is not empty.
>
> And so, the baseline of the row is given by the maximum distance between the top of the cell box and the baseline over all
> cells that have 'vertical-align: baseline'.
>
> My inline-table-valign-002 test is different from yours.

Yes, they are significantly different tests, but they are
both testing that same sentence in the spec. Robert is
correct that inline-table-valign-002 is wrong: it relies
on the an cell's bottom content edge (and hence its baseline)
being influenced by its height property, which it is not.

Similarly, his test relies on the empty cell's content-box
height being zero, even though it has a specified height.
If the height set the size of the content box, then the
baseline-aligned text in the first cell would be forced
down to match the next cell's "baseline".

Tables have a very weird model imo, but that's how it is...

~fantasai

Received on Saturday, 5 September 2015 03:40:23 UTC