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: Greg Whitworth <gwhit@microsoft.com>
Date: Fri, 20 Feb 2015 22:54:54 +0000
To: Daniel Holbert <dholbert@mozilla.com>
CC: www-style list <www-style@w3.org>
Message-ID: <BN3PR0301MB0868BF176207730EF1B46DA9A42A0@BN3PR0301MB0868.namprd03.prod.outlook.com>
> > We implemented it with max/min width being taken into account when
> > flexing the items, but not when determining the flex base size; which
> > in this case would be max content.

Yes, and I don't think it's clear about it either as our previous implementation did have the constraint occurring during the calculations for the flex base size. So even though it does say to focus on the content (which may seem clear to the spec editors) but I do think this will be helped out by a note.
	# Note: width, min-width, max-width, height, min-height, max-height should not be used when determining the item's base size when content is set to flex-basis. 

> Cool -- that's my understanding of how things should work, too. (though I
> don't think the spec is clear about this right now)
> > That said, we should clarify if min-width, max-width, min-height,
> > max-height are to be considered a main size property[3] stated in
> > 9.7.4D
> I think (?) you're saying we should explicitly define what "min and max main
> size properties" means -- is that what you're getting at here?
> (Those terms are used in many places beyond 9.7.4D, but I don't think
> they're defined. It would probably be wise to define them.)
> Or, if that's not what you're getting at here, could you reword/explain
> perhaps?

I'm saying that currently where they define what a main size property is they just state the following:

	# A flex item’s width or height, whichever is in the main dimension, is the item’s main size. 
	# The flex item’s main size property is either the ‘width’ or ‘height’ property, whichever is in the main dimension.

So since this is referenced everywhere in the spec, we should add min-width, min-height, max-width, max-height since these are indeed used to calculate the flex constraints when flexing the items.

> > and possibly an additional line that says not to take min & max
> > width’s into account for 9.2.3D.
> Yes, this is essentially the clarification that I'd like us to make here -- though
> it's needed more in 9.2.3E than in 9.2.3D.

That's fine. I think adding the line above that states not to take the width properties into account when determining how to clamp content, plus the properties defining that the min/max props should be included in any calculation here may take care of this, but I would like for the spec to be as clear as possible since Blink is implementing this right now as well, possibly:

	# Do not take into account min-width, max-width, min-height, or max-height when calculating the item's base size. These properties will be used to clamp the flex item in the step for _Resolving Flexible Lengths_.

Received on Friday, 20 February 2015 22:55:23 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:48 UTC