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

RE: [css-flexbox] Should "max-width" influence the resolved flex base size? (from default "flex-basis:auto;width:auto")

From: Alex Mogilevsky <alexmog@microsoft.com>
Date: Tue, 24 Feb 2015 03:20:57 +0000
To: Daniel Holbert <dholbert@mozilla.com>, fantasai <fantasai.lists@inkedblade.net>, "www-style@w3.org" <www-style@w3.org>, Rossen Atanassov <Rossen.Atanassov@microsoft.com>
Message-ID: <BY2PR03MB1281C481ED70A671B5BC70CB4160@BY2PR03MB128.namprd03.prod.outlook.com>
Hmm, you are right, it is 'hypothetical main size' that is constrained by max size, but flex is applied to 'flex base size'. It's been a while since I've looked at that.

The last line in 9.2.3 that says...

	The hypothetical main size is the item’s flex base size 
	clamped according to its min and max main size properties.

... seems to imply that 'flex base size' is not clamped to min/max. Otherwise it would be identical to 'hypothetical main size', wouldn't it? Perhaps it should have a note similar to what it had earlier, something like "Do not apply min/max-width/height constraints to flex base size. Doing so before resolving flex lengths can make content size unavailable to the algorithm and produce inferior results."

-----Original Message-----
From: Daniel Holbert [mailto:dholbert@mozilla.com] 
Sent: Monday, February 23, 2015 4:57 PM
To: Alex Mogilevsky; fantasai; www-style@w3.org; Rossen Atanassov
Subject: Re: [css-flexbox] Should "max-width" influence the resolved flex base size? (from default "flex-basis:auto;width:auto")

Hi Alex -- thanks for your input! I think you might be addressing something that's different from what this thread is actually about, though, and the spec's current requirements are not quite as clear as your message implied.  I'd be curious for your thoughts, after taking the following into consideration:
	
On 02/23/2015 03:38 PM, Alex Mogilevsky wrote:
> We went back and forth on whether max-width is applied once to the 
> final result or if it is also honored when calculating hypothetical 
> main size.

Sorry for being a language pedant (& hooray for term-renamings) -- I have to clarify -- "hypothetical main size" is different from what I'm asking about here.

I'm talking about the *flex base size*  (i.e. the length that we start our flexing from, when we have an auto-sized flex item with flex-basis:auto). I'm wondering whether we should ignore min/max-width *when doing layout to compute this value*.

In contrast, the "hypothetical main size" (the term you used) is an
*explicitly-clamped* version of the flex base size, and it's only used for a few things like determining where we should wrap.  Importantly, it's *not* where we start our flexing from -- that's the "flex base size".

> March 2012 draft had max-size explicitly excluded from hypothetical 
> size calculation (that's what I implemented in IE10). June 2012 draft 
> and current spec have it affect hypothetical size.

Right, but the change isn't as significant as you're suggesting  See my second message on this thread:
  https://lists.w3.org/Archives/Public/www-style/2015Feb/0379.html


Basically, the relevant change between those two drafts was:
  https://hg.csswg.org/drafts/rev/d2282075d2f2

And that change simply renamed the old "hypothetical size" to "flex base size", and it redefined "hypothetical size" to be an explicitly-clamped value. (and to *no longer* be where we start our flexing)

The question is, should any min/max clamping happen when doing layout to establish the "flex base size"? The spec doesn't say. (It used to, before that hg revision, but the prohibition was removed there.) I think that removal was accidental.

~Daniel
Received on Tuesday, 24 February 2015 03:21:27 UTC

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