W3C home > Mailing lists > Public > www-style@w3.org > February 2012

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

From: Alex Mogilevsky <alexmog@microsoft.com>
Date: Thu, 16 Feb 2012 04:52:02 +0000
To: Daniel Holbert <dholbert@mozilla.com>, "www-style@w3.org list" <www-style@w3.org>
Message-ID: <D51C9E849DDD0D4EA38C2E539856928412E5BDBE@TK5EX14MBXC214.redmond.corp.microsoft.com>
 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.)

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 

	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

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:12 UTC