This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 15892 - What's the baseline of an inline table with no rows?
Summary: What's the baseline of an inline table with no rows?
Status: NEW
Alias: None
Product: CSS
Classification: Unclassified
Component: CSS Level 2 (show other bugs)
Version: unspecified
Hardware: All Windows 3.1
: P2 normal
Target Milestone: ---
Assignee: Bert Bos
QA Contact: public-css-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-04 18:32 UTC by Anton P
Modified: 2012-12-04 00:50 UTC (History)
3 users (show)

See Also:


Attachments

Description Anton P 2012-02-04 18:32:04 UTC
Reported by Anton Prowse

The baseline of an 'inline-table' is defined in 10.8.1 to be the baseline of the first row of the table.  But what if it doesn't have any rows?  We should probably define it to mean the bottom margin edge of the wrapper box in that case, to match the behaviour of 'inline-block'.

Conversation begins:
Bug description:
http://lists.w3.org/Archives/Public/www-style/2011Mar/0637.html (#4)

Acknowledgement: http://lists.w3.org/Archives/Public/www-style/2011Mar/0681.html
Comment 1 Anton P 2012-02-04 18:32:17 UTC
This bug is related to Bug 15891
Comment 2 Anton P 2012-02-04 18:32:57 UTC
This proposal would partially resolve Bug 15890
Comment 3 Anton P 2012-07-12 18:34:59 UTC
Browser compat info:

Add a rowless table as the first item in an table cell, and see how the table cell's baseline is determined.  According to 17.5.3:

  # 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.

Experiments suggest that Firefox constructs an anonymous table-row and table-cell in the empty table (even though the algorithm in the spec wouldn't create any).  It then aligns that row as specified.

WebKit, on the other hand, skips over the row-less table when trying to determine a baseline for the cell.

http://lists.w3.org/Archives/Public/www-style/2012Jul/0291.html
Comment 4 Boris Zbarsky 2012-07-13 02:14:24 UTC
Can I see the testcase you used for comment 3?
Comment 6 Boris Zbarsky 2012-07-13 17:41:29 UTC
Gecko does not have a table row there.  It just treats the "first line baseline" as being always available from a table, which is probably just wrong per spec.  File a bug, please?  ;)
Comment 7 Tab Atkins Jr. 2012-07-13 18:02:59 UTC
It's not wrong per spec, it's undefined.  We can go either way.  

I'd prefer to have a no-row table produce a baseline, just like we've defined no-item flexboxes to produce a baseline.
Comment 8 Boris Zbarsky 2012-07-13 20:40:13 UTC
Well, spec says to look for the first line box or table row, and that would be the "foo" here, when looking for the baseline of a cell.  So it looks defined per spec to me.

The baseline of an _inline_ table is indeed undefined.  But that's somewhat orthogonal.

Though obviously I would prefer it if we simply defined the baseline of tables and used it both places....  assuming the same baseline works in both cases.  Note that for blocks we have different behavior for inline-block and block (last line vs first line).
Comment 9 Anton P 2012-07-15 15:46:20 UTC
Ah, so actually the test in Comment 3 and onwards isn't actually useful for observing if/how UAs determine the baseline of a table with no rows, since the baseline of a cell is specified to depend on descendant table rows but not on the table itself.

And in any case, the baseline of a table isn't what we're interested in here anyway; it would have merely been an interesting data point.  (Flexbox is the spec which cares about that, not CSS21.)  This bug is about the baseline of an /inline/-table.