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

RE: [css-sizing][css-flexbox] intrinsic min/max-width/height values and percentage children

From: Greg Whitworth <gwhit@microsoft.com>
Date: Fri, 31 Jul 2015 02:20:23 +0000
To: Daniel Holbert <dholbert@mozilla.com>, Tab Atkins Jr. <jackalmage@gmail.com>
CC: www-style list <www-style@w3.org>
Message-ID: <CY1PR03MB14395B0BD2B2916053BD7CEFA48A0@CY1PR03MB1439.namprd03.prod.outlook.com>
> On 03/02/2015 12:54 PM, Tab Atkins Jr. wrote:
> > So, this doesn't work.
> [...]
> > If you have min-width:auto, then you need to calculate the min-content
> > size of the flex item.  This doesn't care about the width or
> > flex-basis, it cares about the min-size contributions of the flex
> > item's children.  We thus can't treat a percentage on a child as
> > resolving against a definite width here, because we're in the process
> > of computing that width; but if the width isn't definite, then the
> > percentage becomes auto *here*, and then a resolved definite value
> > *later*, which is confusing and weird and two-pass, and we'd like to
> > avoid two-pass layout in the default case.  (In other words, this
> > becomes just a variant of the option C two-pass layout.)
> 
> Right -- this what I was trying to get across in
>   https://lists.w3.org/Archives/Public/www-style/2015Feb/0489.html

> and elsewhere in that thread, but you explained it here better than I did.
> 
> > So I think we're screwed and need to go with option A.
> 
> This is unfortunate, but I think I agree, for perf reasons (to avoid getting
> O(n^2) behavior *by default* for some pretty simple cases, due to the two-
> pass layout that can't really be avoided).
> 
> ~Daniel

Just so that I'm not talking about something entirely different, I created a simple test case: http://jsbin.com/nomopewego/1/edit
If I'm correct than you're suggesting that the red box should be able to resolve 50% since it doesn't know (when we're calculating the width, what to resolve against).

If that is indeed what you're saying, I don't think resolving the percentages is confusing, I think not supporting them in this instance will be confusing. The fact that you need to do a two pass layout to resolve them doesn't seem to be hindrance at this point, are you receiving bug reports regarding poor perf on flex dependent sites?

Thanks,
Greg



Received on Friday, 31 July 2015 02:20:54 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:52:18 UTC