RE: [css3-flexbox] added algorithms for pagination and flex distribution

± From: Daniel Holbert [mailto:dholbert@mozilla.com] 
± Sent: Tuesday, February 14, 2012 5:46 PM
± 
± Hi Alex,
± 
± On 02/14/2012 02:43 AM, Alex Mogilevsky wrote:
± > I made two changes to the spec:
± >
± > 1)Added algorithm for pagination. It has a couple of issues for 
± > dealing with overflow and dealing with forced breaks. There were good 
± > ideas at discussion with Fantasai, to be included next.
± 
± I've got a few clarification questions on pagination.
± 
± Suppose we split a single-line vertical flexbox across a page boundary.
± 
± (1) Do we run the flexbox space-distribution algorithm on each page's 
± partial-flexbox separately? (to distribute space among the items that 
± land on that page)

Actually if flexbox height is set, flexbox algorithm must run before pagination. This is important because "preferred size" can be wildly different from content size (often zero). 

Then, step (a) is currently incorrect where it suggests to always use preferred size.

Then, to your question - should flexbox algorithm run again on each page? It could go either way - no more flexing, or flex again on each page. 
I think it shouldn't: although it would be reasonable to expect that flexible items fill space on each page, distribution will be different (because we start with different preferred size) ... and I have no idea what to do with max-height.


± (I'm guessing "yes" given that your new spec text describes how to get 
± the remaining available space on each new page, and available space is 
± primarily important as an input to space-distribution algorithm.)
± 
± ASSUMING THE ANSWER TO (1) IS "yes":

Actually I think the answer should be "no". Available space is for flex-pack only.

How about this modified algorithm?

	1. Column-direction flexbox, single-line 

	a. If flexbox height is set, flexbox algorithm 
	must run before pagination. Otherwise items use the 
	preferred size, adjusted for min/max.

	b. Set of items that will fit on current page is 
	determined by adding item sizes of items while there 
	is positive remaining space

	c. Forced breaks between items are honored and if 
	applied, terminate the set of items that fit on the 
	page.

	d. If border box of an item doesn't fit in current 
	page, a break inside the item is considered

	e.Items that fit on a page completely or partially are 
	aligned according to 'flex-pack' property, 
	independently from the rest of flexbox content. Note 
	that flexible length resolution algorithm is not 
	reapplied per-page.
 
	NOTE: It is the intent of this spec that column-direction 
	single-line flexbox paginates very simlarly to block 
	flow. As a test of the intent, a flexbox with "flex-
	pack:start" and no flexible items should paginate 
	identically to a block with non-floating children that 
	have same content and same used size and margins. This 
	rule is simplified and not normative, but if there is any 
	difference it should be noted here.

Received on Thursday, 16 February 2012 04:52:37 UTC