Re: [css3-flexbox] resolving flexible lengths

On Wed, Oct 19, 2011 at 10:55 PM, Alex Mogilevsky <alexmog@microsoft.com> wrote:
> I like this much better. This way positive and negative flex will never mix in one result, and you achieve the goal of min-width to limit the final outcome, not distribution.

Glad you're happy about it!


> You only need to reset the algorithm when one or more items fail to satisfy minwidth, right? I don't think max-width has a similar problem, does it?

I *think* that's right when there's free space.  When you're
overflowing, you reset when max-width isn't satisfied instead.  Rather
than complicate the algorithm with those details I'm currently being
agnostic about it, and impls can freely optimize that.


> In worst case this can require as many restarts as there are items (making the distribution N**2), but that kind of case would be really artificial...

Yes, that degenerate case would be *really* hard to trigger with real
content.  Most of the time you won't reset at all, and when you do
you'll generally only reset once.

It may even be possible to apply some linear programming to the
problem instead of following the spec's algorithm, so you can avoid
restarts entirely.

~TJ

Received on Thursday, 20 October 2011 07:28:06 UTC