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

Re: [css-flexbox] max-content sizing of flex containers is wrong

From: fantasai <fantasai.lists@inkedblade.net>
Date: Tue, 19 Aug 2014 16:36:02 -0700
Message-ID: <53F3DF62.2080809@inkedblade.net>
To: www-style@w3.org
On 08/18/2014 05:20 PM, fantasai wrote:
> Hi!
> Just noticed that the max-content sizing rules for flexboxes is wrong.
> It takes the sum of the max-content contributions of its items. But
> actually, it needs to account for flex factors, the same way the grid
> layout algorithm does.
>
> Example:
>    <flexbox>
>      <item>foo foo foo</item>
>      <item>foo</item>
>    </flexbox>
>
>    item { flex: 1; }
>
> Suppose "foo" is approximately 3em wide.
> The max-content contribution of the first item is ~9em.
> The max-content contribution of the second item is ~3em.
> The max-content size of the flexbox is therefore defined to be 12em.
>
> Since the flex basis is zero and flex is one, after flex layout
> each item is 6em wide. The contents of the first item wrap into
> the 6em, and max-content's definition fails, 'cuz wrapping.

Okay, we've fixed this in the spec. Note this will affect auto-sizing
of floats and other shrinkwrapped things.
   http://dev.w3.org/csswg/css-flexbox-1/#intrinsic-sizes

~fantasai
Received on Tuesday, 19 August 2014 23:36:31 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 19 August 2014 23:36:33 UTC