W3C home > Mailing lists > Public > www-style@w3.org > August 2012

[css3-flexbox] rules for tables as flex items

From: L. David Baron <dbaron@dbaron.org>
Date: Mon, 6 Aug 2012 13:22:45 -0700
To: www-style@w3.org
Message-ID: <20120806202245.GA6079@crum.dbaron.org>
I find the rules for handling tables as flex items contained in the
last paragraph of http://dev.w3.org/csswg/css3-flexbox/#flex-items
(before section 4.1):
  # On a flex item with ‘display: table’, the table wrapper box
  # becomes the flex item, and the ‘order’ and ‘align-self’
  # properties apply to it. However, like ‘width’ and ‘height’, the
  # ‘flex’ longhands apply to the table box as follows: The contents
  # of any caption boxes contribute to the calculation of the table
  # wrapper box's min-content and max-content sizes.  However, the
  # flex item's final size is calculated by first laying out the
  # captions, and then performing layout as if the distance between
  # the table wrapper box's edges and the table box's content edges
  # were all part of the table box's border+padding area, and the
  # table box were the flex item. 
to be somewhat unclear.

In particular, I find the following things confusing:

  # However, like ‘width’ and ‘height’, the ‘flex’ longhands apply
  # to the table box as follows: The contents of any caption boxes
  # contribute to the calculation of the table wrapper box's
  # min-content and max-content sizes.

This sentence (or two) is confusing in two ways.  First, the capital
"T" following the colon makes it unclear if the colon is intended to
introduce multiple sentences (in which case it should probably
introduce something in list markup, or use a period rather than a
colon) or just the single sentence (in which case the T should be
lowercase).

Second, it's talking about how the properties apply to the table
box, but then continues by saying that caption boxes contribute to
the table wrapper box.

Then:
  # However, the flex item's final size is calculated by first
  # laying out the captions, and then performing layout as if the
  # distance between the table wrapper box's edges and the table
  # box's content edges were all part of the table box's
  # border+padding area, and the table box were the flex item.

This seems to presume that caption layout can happen first.
However, if my memory is correct, there are cases in CSS 2.1 where
the size of the caption depends on the size of the table (in
particular, because the caption can't be wider than the table).
This means that the caption's width can't be determined before
determining the table's width.  If "first laying out" includes
layout out the caption before determining the width of the table,
then this seems to be a contradiction; if it doesn't then I don't
see why there's an ordering constraint at all or what it means.

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                           http://www.mozilla.org/   𝄂
Received on Monday, 6 August 2012 20:23:09 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:58 GMT