Re: Box Reordering

On Mon, May 24, 2010 at 6:39 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 5/24/10 9:24 PM, Alex Mogilevsky wrote:
>>
>> I predict that somebody will fill a Flexbox with thousands of items and
>> then use box-ordinal-group for sorting, and expect reasonable
>> performance. Then Flexbox layout not only needs a secondary storage for
>> child order and quicksort. Neither is rocket science, but if it needs to
>> be there it really should have a strong reason.
>
> Fwiw.... the Gecko implementation is somewhat as you described, and it's not
> good enough for this use case if the DOM is being mutated and you have to
> resort.  Quicksort is typically O(N log N) or worse on nearlt-sorted data,
> so you get overall O(N^2 log N) behavior unless you add yet more complexity
> and sort lazily, etc.

Of course, there are relatively simple relatives to quicksort that
perform well on nearly-sorted data, which is what you'll see most of
the time here.


> The complexity is the real issue.  The non-flexbox box model is already
> complicated enough that defining how this new feature would interact with
> all the kitchen sinks already tossed in (and then implementing it) would be
> a major undertaking.  It doesn't obviously seem worth it.

That was my thought; I just wanted to run it by everyone else.
Someday, in the future, when we have stricter definitions of precisely
how everything works rather than the relatively ad hoc conglomeration
we have today (a long term goal!), we may want to do this.  But for
now, I'm happy enough limiting it to flexbox.  Flexbox is the
"application layout" spec anyway, and content reordering like this is
most useful in terms of applications, not documents.


Now, on to simpler bikeshedding matters, several people have expressed
dissatisfaction with the name 'flex-index'.  I came up with that name
by just taking the common flexbox prefix and appending -index, since
this property most closely matches the existing z-index property.  How
about 'box-index', or 'box-order'?  I'm partial to the last, even
though it loses the connection with z-index.

~TJ

Received on Tuesday, 25 May 2010 03:22:51 UTC