Re: [css-flexbox] max-content contribution not defined for flex items

On 08/06/2015 06:11 PM, Greg Whitworth wrote:
> Here is an example of what we're trying to resolve: http://jsfiddle.net/gpzo4hvL/2/
> 
> What should the width of each item be, and ultimately the width of the container?
> 
> I don't have a passionate opinion one way or the other, but wanted feedback on what everyone felt, based on the current language

After discussing this spec-chunk with fantasai just now, we arrived at
the following (I think) expected behavior for your jsfiddle:

 - The [min|max]-content contribution of a flex item (used for
determining the container's size) should not depend on its flex-basis or
width properties -- only the item's contents.[1]  (This requires a spec
edit -- I think fantasai will follow up with more.)

 - So: if we run through the "Intrinsic Sizes" algorithm in the flexbox
spec, using a purely content-based max-content size for each flex item,
we end up with a flex container that's 604px wide.

 - Then the first flex item ends up 302px wide (as wide as its
contents), and the second flex item also ends up 302px wide.

(Note that Firefox's current behavior is based on older spec text, and
shouldn't really be trusted here. We're taking the 'width' into
consideration, but we shouldn't be.)

~Daniel

[1] RE width & flex-basis being ignored -- note that the flex-container
intrinsic-size calculation algorithm _does separately_ use the
flex-basis, and perhaps the 'width' if it influences the implied minimum
size. But those things don't influence the min-content contribution size.

Received on Thursday, 20 August 2015 20:39:07 UTC