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

On 02/23/2015 07:20 PM, Alex Mogilevsky wrote:
> 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?

Essentially, yes -- for flex base sizes that require content measurement
(section 9.2.3 D / E).  (These are the cases that are currently ambiguous.)

> 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."

Sort of -- though I think I'd suggest something more along the lines of:
"Do not apply min/max main-size constraints to the flex item, when doing
layout to establish the flex base size."

(I'd avoid using language about applying "constraints to the flex base
size" -- the spec never suggests that you should do this, and no
rendering engine does this per se. Rather, I think Chrome/Blink are
doing clamping during a sub-step -- during the "lay out the item" part
of section 9.2.3 D & E -- and that ends up *producing* a flex base size
which *looks* clamped -- but they're not actually clamping the flex base
size itself, explicitly.)

(Also: for this layout step when we're measuring the flex base size, I
think we only want to prohibit clamping in the *main* axis -- not the
cross axis. For example: if we've got a vertical flex container and
we're measuring the flex base size of an item with "max-width: 50px", I
think we *should* take the max-width into account -- since it's in the
cross-axis -- to produce a reasonable flex base size (height) for the item.)

Received on Tuesday, 24 February 2015 06:14:42 UTC