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

Re: [css-flexbox] What to do with an item's height when max-height is applied to the flex container

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 21 Apr 2014 12:50:03 -0700
Message-ID: <CAAWBYDDPym293h-J1Wz3qm8=K6szUDMb-ice81V-SpRbav7+_A@mail.gmail.com>
To: Greg Whitworth <gwhit@microsoft.com>
Cc: fantasai <fantasai@inkedblade.net>, Daniel Holbert <dholbert@mozilla.com>, "www-style@w3.org" <www-style@w3.org>
On Mon, Apr 21, 2014 at 11:43 AM, Greg Whitworth <gwhit@microsoft.com> wrote:
> We ran into an interesting interop issue where if you set a flex container
> with a max-height, Firefox and IE set the flex-item height to the height of
> the max-content of the items, while Chrome sets the max-height of the
> flex-item to the suggested max-height applied to the flex-container. The
> spec is not completely clear on what to do in this case so I would like to
> reach consensus on what to do in this case:
>
> A)     Have the flex items inherit their height from the flex-container’s
> constraints if not directly set (Chrome)
>
> B)      Resolve their height against the largest flex-item (IE, Firefox)
>
> Here is a fiddle of the repro:
>
> http://jsfiddle.net/VDq6r/6/

Can you point out what part of the spec seems ambiguous on this point?
 It seems clear to me:

1. In step 8, the flex container's cross size is indefinite, so we
can't use the first clause.  We fall to the second one, which sizes
the flex line to the largest hypothetical cross size among its items
(150px).

2. In step 11, the flex item is stretched and auto-sized and meets the
other criteria, so it gets set to the size of the flex line (150px).

3. In step 15, the flex container is set to the size of its flex line
(150px), but clamped by its min/max properties, so it gets set to
100px. (This is FF's behavior, and probably IE's from your
description.)

Is there something I've missed that makes this less cut-and-dry?

~TJ
Received on Monday, 21 April 2014 19:50:50 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:21 UTC