Re: [css-grid] Flexible Track Sizing & Indefinite Avail Size

On 09/04/2015 02:03 PM, Tab Atkins Jr. wrote:
> On Wed, Sep 2, 2015 at 4:58 PM, Javier Fernandez <jfernandez@igalia.com> wrote:
>> On 09/16/2014 10:11 PM, Tab Atkins Jr. wrote:
>>>
>>> Basically, you're asking each track "what size should we give an fr to
>>> make you maximally happy?".  For elements with >=1fr, they want to
>>> fill the available space, so their answer is just the available space
>>> divided by their fr value, so that when things multiply back out,
>>> they're exactly filling the space, as desired.  For elements with <1
>>> fr, they want to fill a *fraction* of the space, not the whole thing;
>>> thus, they want 1fr to equal the available space, so that when things
>>> multiply back out, they're filling the desired fraction of the space,
>>> as desired.
>>
>> Actually, there is another sentence in the spec that makes me wonder
>> if this applies to indefinite sized containers:
>>
>> "When the available space is infinite (which happens when the grid
>> container’s width or height is indefinite), flex-sized grid tracks are
>> sized to their contents while retaining their respective proportions.
>> The used size of each flex-sized grid track is computed by determining
>> the max-content size of each flex-sized grid track and dividing that
>> size by the respective flex factor to determine a “hypothetical 1fr
>> size”. The maximum of those is used as the resolved 1fr length (the flex
>> fraction), which is then multiplied by each grid track’s flex factor to
>> determine its final size."
>>
>> The sentence **flex-sized grid tracks are sized to their contents while
>> retaining their respective proportions** make me think that we don't
>> want to fraction the content-sized space, just to make it bigger
>> proportionally, based on the flex factors. Hence, "0.1fr 0.2fr" should
>> produce the same results than "1fr 2fr".
>
> Nah, we don't want that.
>
> So: I'll edit the spec to make the "indefinite" clause also clamp to 1.

I'm not sure what exactly is the edit you're proposing, but I suspect
it's wrong to clamp anything to 1. What should be happening here is
the same that's happening in Flexbox:
   https://drafts.csswg.org/css-flexbox-1/#intrinsic-sizes

~fantasai

Received on Friday, 4 September 2015 21:20:50 UTC