W3C home > Mailing lists > Public > www-style@w3.org > October 2011

Re: [css3-flexbox] resolving flexible lengths

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 20 Oct 2011 00:27:11 -0700
Message-ID: <CAAWBYDDneOd3DH=YZteP47Z9dqiiSqALj-Vmr3fbNhvaPry-jw@mail.gmail.com>
To: Alex Mogilevsky <alexmog@microsoft.com>
Cc: Ojan Vafai <ojan@chromium.org>, "www-style@w3.org" <www-style@w3.org>
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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:45 GMT