Re: [css3-flexbox] Bad result in flex algorithm when combining stretch, and elements with an aspect ratio

On Mon, Oct 29, 2012 at 8:30 AM, Kang-Hao (Kenny) Lu
<kanghaol@oupeng.com> wrote:
> I think you just need to come up an with an algorithm that avoids
> circular dependency in a case like, say:
>
> <flexbox direction=row flex-wrap=wrap width=500px>
>   <image intrinsic-width=100px intrinsic-height=200px align-self=stretch />
>   <div width=400px height=400px flex=1 />
> </flexbox>
>
> Is it:
>
> == Result 1 ==
> Line 1 (height: 400px): 100px x 400px, 400px x 400px
>
> or
>
> == Result 2 ==
> Line 1 (height: 400px): 200px x 400px
> Line 2 (height: 400px): 400px x 400px
>
> or
>
> == Result 3 ==
> Line 1 (height: 200px): 100px x 200px
> Line 2 (height: 400px): 400px x 400px

Ah, good point.  I was assuming that the cross size of the flexbox was
known already.

I still think my suggested change is the best for such a situation,
but it's not complete.  When the cross size of the flexbox isn't
known, you can't do an early stretch.  In that case, we'll just have
to do a late stretch and ignore the aspect ratio (anything else would
either result in over/underflow, or require iterative layout).

~TJ

Received on Monday, 29 October 2012 08:19:40 UTC