[css3-flexbox] more intelligent single-column pagination

Right now the spec says that the flexbox is laid out without regard to pagination,
flexed, and then the break point is selected and content that doesn't fit pushed
to the next page. Then the remaining contents are flexed. Etc.

I think that if an item falls across a page break, and free space was positive,
the UA should be allowed to reduce the distributed free space on the page in order
to pull the item up instead of pushing it down.

Example:

Let's suppose we have a flexbox with 5 items that all flex, and there is plenty
of free space due to a limited height. Three items fit on the first page if they
aren't flexed, but after they are flexed, only 1.75 items fit.

The second item gets pushed to the next page, and we rerun the algorithm.
Flex is distributed, but this time each item gets less free space because
we had to give 75% of an item's space to the page break. So we fit 2.25
items on the second page.

The last two items get pushed to the last page, where they have even less
free space because of the extra space given to the page break. Each page,
the items that on a single page would be equal-height, are getting smaller.

And perhaps on the last space the free space is even now negative! The
content, which could have fit if free space were distributed optimally,
now overflows its box.

~fantasai

Received on Tuesday, 1 May 2012 23:48:47 UTC