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

On Wed, May 7, 2014 at 9:29 AM, Rossen Atanassov
<Rossen.Atanassov@microsoft.com> wrote:
>> -----Original Message-----
>> From: fantasai [mailto:fantasai.lists@inkedblade.net]
>> Sent: Monday, February 4, 2013 10:42 PM
>>
>> You're right. We added that the container's inner cross size should be
>> clamped to the item's min/max cross size before it's used to compute the
>> flex base size.
>>
>>    # If the flex basis and cross size are both ‘auto’ , the flex
>>    # container is single-line and has a definite cross size, the flex
>>    # item has an intrinsic aspect ratio, and the flex item has
>>    # ‘align-self: stretch’, the flex base size is computed from the
>>    # flex container's inner cross size (clamped to the flex item's
>>    # min and max cross size) and the flex item's intrinsic aspect
>>    # ratio.
>>
>> Please let us know if this looks correct yet. :)
>
> In review of the current draft it looks like this thread was used to address issue #8 [1]. If this is the case then I don't believe we've solved the issue raised here. Here's the current definition:
>
> ------------
> If the flex item has ...
>  an intrinsic aspect ratio,
>  a flex basis of ‘auto’, and
>  a definite cross size <<< problem
> ------------
>
> The problem is that we allow the intrinsic size to kick in only when the cross size if defined and not in the case it is 'auto' and 'stretch'.
>
> The fix should be as simple as adding the OR statement for 'auto' and 'stretch'.
>
> If you're OK with that I'll go ahead and add the change.

In the course of solving another issue, we added text that specifies
that a stretched cross-size is definite *if* the flex-container's
cross-size is definite.  That addresses your issue, assuming the flex
container is definite.  Is this sufficient, or do you want this to
work when the flex container is indefinite too?  (We do allow
percentages on children of the flex item to resolve against a
stretched cross-size with an indefinite flex container, so this would
have precedent. On the other hand, that currently happens late in
layout, while the thing we're discussing here happens early, so it
might be problematic.)

~TJ

Received on Tuesday, 1 July 2014 17:46:12 UTC