W3C home > Mailing lists > Public > www-style@w3.org > December 2015

Re: [css-flexbox] Intrinsic Cross Size Definition Totally Wrong

From: fantasai <fantasai.lists@inkedblade.net>
Date: Thu, 3 Dec 2015 16:43:17 -0500
To: "www-style@w3.org" <www-style@w3.org>, Daniel Holbert <dholbert@mozilla.com>, Rossen Atanassov <Rossen.Atanassov@microsoft.com>, Greg Whitworth <gwhit@microsoft.com>, Christian Biesinger <cbiesinger@gmail.com>
Message-ID: <5660B775.4050100@inkedblade.net>
On 08/24/2015 06:48 PM, fantasai wrote:
>   # The min-content cross size and max-content cross size
>   # of a flex container are the cross size of the flex
>   # container after performing layout into the given
>   # available main-axis space and infinite available
>   # cross-axis space.
>
> This might be correct if the cross-axis is the block axis
> (I'm not entirely sure), but it's completely wrong if the
> cross-axis is the inline axis.

Okay, so Tab and I worked on this issue today.

For a single-line flex container, the answer is very straightforward,
and we updated the spec with the following:

  # The min-content cross size and max-content cross size of
  # a single-line flex container is the largest min-content
  # contribution or max-content contribution (respectively)
  # of its flex items.

For a multi-line flex container, however, we don't have a very
good answer. The spec currently contains an explanation of the
issue...

In an ideal world, the multi-line cross size would be calculated
by, one by one, laying out elements with the constraint applied
into the flex lines, and whenever a new largest cross-size in a
line is found, redoing layout for all previous items in the line
to match that width (so you get accurate line-breaking).

Current browsers perform an approximation of this, finding the
largest intrinsic cross-size among *all* items and then
shrink-to-fit sizing everything into that much available space.

Our question to the list is: Is this approximation sufficiently
useful to specify? Can we do better?

Side note: current browsers also set the *flex container’s* inner
size to that largest value, which is clearly wrong, as it is
guaranteed to cause overflow if there are multiple lines. We would
need to require the cross-size to be the sum of the line’s cross
sizes after doing item layout and linebreaking as outlined above.

~fantasai and TJ
Received on Thursday, 3 December 2015 21:43:48 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:58 UTC