Re: [csswg-drafts] [css-flexbox] flexbox spec isn't interoperable w/ existing implementations, RE `flex-basis` resolution for table wrapper box flex-items

> No, it's not bypassed by that. max-content sizing of a box (the table-wrapper box in this case) does not get to benefit from any information about the ancestors -- that's part of the principle of what max-content sizing represents.

It is, though. The table wrapper box is there mainly to hold the table and its caption together. Its sizing is determined by the size of those items rather than by any sizing properties set on it.

The Flexbox spec says

> In the case of flex items with display: table, the table wrapper box becomes the flex item, and the order and align-self properties apply to it. The contents of any caption boxes contribute to the calculation of the table wrapper box’s min-content and max-content sizes. However, like width and height, the flex longhands apply to the table box as follows: the flex item’s final size is calculated by 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.

“_the flex longhands apply to the table box as follows_ ... _and the table box were the flex item_”.

What the spec is trying to say is that the table box is what gets flexed by the flex properties, just like the table box is what gets sized by the sizing properties. We have to account for the captions somehow, though, so we're ignoring them and the table wrapper box, except insofar as the captions take up space. And as @Loirooriol says, per CSS2.1 the percentage resolves on the table exactly as if the wrapper box wasn't there.

> The width of the table wrapper box is the border-edge width of the table box inside it, as described by section 17.5.2. Percentages on 'width' and 'height' on the table are relative to the table wrapper box's containing block, not the table wrapper box itself.

Overall I think this issue is invalid--as in the spec says it should behave the way you want it to behave--but I'm not sure where you're getting confused or how to fix it.

- CSS2.1 says that the table wrapper box is ignored for calculating percentages--they are resolved against the table wrapper box’s parent.
- Flexbox says that the table wrapper box does not participate in flex sizing: it is bypassed so that flex sizing calculations are applied to the table grid box, with some accounting for the space taken up by the captions. (This is consistent with CSS2.1's point about percentage calculations.)
- CSS2.1 says that the table wrapper box’s width is affixed to the final width of the table grid box.

-- 
GitHub Notification of comment by fantasai
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2604#issuecomment-385824058 using your GitHub account

Received on Tuesday, 1 May 2018 23:53:43 UTC