Re: [css3-grid-layout] Dense auto layout

On Mon, Mar 4, 2013 at 7:04 PM, Henrik Andersson <henke@henke37.cjb.net> wrote:
> I have read the grid layout module and I think that it is very good, but
> there is one thing that bothers me.
>
> It is about the automatic grid placement. I think that it has a problem
> with spanned grid items. Namely, it leaves holes of unused space in the
> grid in some situations.

I strongly agree that dense packing is useful, but it has some
downsides as well:
* it has worse performance (n^2 rather than n, though most of the time
the n will be small)
* it can sometimes be confusing, as elements late in document order
can appear before elements much earlier than them in document order,
if they're the first thing to fit in that hole (but most of the time,
holes will be filled pretty quickly)

Because of this, I suggest a switch on the grid-auto-flow property
that controls whether the packing is dense or loose.

Note that WebKit's implementation accidentally implemented dense
packing already. ^_^  (It showed up in Chrome Canary a few days ago,
if you want to check.)

~TJ

Received on Wednesday, 6 March 2013 17:30:10 UTC