RE: [css3-flexbox] better algorithm for hypothetical main size

± From: Alex Mogilevsky [mailto:alexmog@microsoft.com] 
± Sent: Tuesday, June 12, 2012 3:11 PM
± 
± <algorithm>
± Otherwise, lay out the item using available space with following dimensions: 
± 
± * On main axis: 
±     - if flex-basis is auto: infinite
±     - if flex-basis 'fit-available' or 'fit-content':  
±       flex-container's main size, constrained by its 
±       min and max size.
± 
± * On cross axis:  flex container's cross size, constrained
±   by its min and max size.
± 
± The flex base size is the item's resulting measure.
± </algorithm>
± 
± In Bugzilla: https://www.w3.org/Bugs/Public/show_bug.cgi?id=17475

Note that this approach assumes that when hypothetical cross size is determined later, it is also done within available space of flex container's cross size, *regardless of alignment*. The spec currently doesn't say so and I am not sure what the preferred behavior is.

What behavior do we prefer for non-stretch alignment now?

A: fit-content in flex container cross-size:

	+++++++++++++++
	|-------------|	
	|my alignment |
	|is stretch   |
	|-------------|
	|-------------|	
	|my alignment |
	|is start     |
	|-------------|
	|             |	
	+++++++++++++++

B: max-content

	+++++++++++++++
	|-------------|	
	|my alignment |
	|is stretch   |
	|-------------|
	|-------------------------
	|my alignment is start   |
	|-------------------------		
	|             |	
	+++++++++++++++


I prefer A, I think it is more consistent with block layout, and it is more useful. But after all the changes I am not sure what the spec expects here.

Alex

Received on Tuesday, 12 June 2012 23:42:38 UTC