Re: [css-flexbox] Computation Algorithm

--------------------------------------------------
From: "Tab Atkins Jr." <jackalmage@gmail.com>
Sent: Monday, May 10, 2010 8:33 PM
To: "Andrew Fedoniouk" <news@terrainformatica.com>
Cc: <www-style@w3.org>
Subject: Re: [css-flexbox] Computation Algorithm

> On Mon, May 10, 2010 at 8:16 PM, Andrew Fedoniouk
> <news@terrainformatica.com> wrote:
>> Looking on this document in Mozilla:
>> http://terrainformatica.com/w3/mozilla-flex-2.htm
>>
>> I am getting this rendering:
>> http://terrainformatica.com/w3/mozilla-flex-2.png
>>
>> Two boxes here are defined as:
>>
>> #box2 { box-flex: 1.0; width:200px; background:gold;}
>> #box3 { box-flex: 2.0; width:200px; background:red;}
>>
>> According to the name of the property ("box-flex") I would expect that 
>> box3
>> (flex:2) and box2 (flex:1)
>> widths will be in proportion 2:1. At least box3 should be wider than 
>> box2.
>> But in fact box3 is smaller! That is completely unexpected
>> as all other properties of these two elements are the same.
>>
>> It appears that different values of the 'width' may change
>> meaning of 'box-flex'. Larger values of the flex may lead to larger 
>> widths -
>> proportion A/B. But as we can see larger flexes may lead to smaller 
>> widths
>> too - suddenly to change to B/A.
>>
>> In any case box-flex multiplier appears as completely unpredictable when
>> 'width's are expressed in percents.
>>
>> Question to authors of the FlexBox proposal:
>> what is the motivation to use such an algorithm?
>>
>> And yet: if someone would ask to define in one sentence (for dummies)
>> meaning of such "box-flex" what would be that sentence? What does it
>> mean/flex to be short?
>
> I've tried to explain this multiple times, and the spec for Flexbox
> explains it as well.  Let me try one final time, with a few examples.

[skipped]

Tab, I asked for one sentence explanation of the box-flex. For the army
of web developers who will try to use this. Just imagine that
you are writing manual explaining the flex for ordinary people.

So far we've got this: "box-flex define flexibility of the element" (C) Rob.
A bit of tautology of course but may work for some people.

Here https://developer.mozilla.org/en/XUL/Attribute/flex
is slightly better version of the definition. But it just expresses the 
hope:
"Elements with larger flex values will be made larger than elements
with lower flex values, at the ratio determined by the two elements."
- not the real situation.
If to use my example then a) it is "larger" only when Jupiter is in 
Capricorn
and b) "at the ratio" is not relevant at all.

That is why my question. I am lost in getting any idea of
author's motivation for such flex algorithm.

Probably I am poison by my own implementation that
was just taken from existing HTML spec "as is":
http://www.w3.org/TR/REC-html40/types.html#type-multi-length
I've found this explanation as simple and quite obvious - I see no
reasons to change it.

My sarcasm is probably over-expressed but flexes are very critical
as they are foundation of bunch of new possibilities and technologies.
We have to make them right.

-- 
Andrew Fedoniouk

http://terrainformatica.com


 

Received on Tuesday, 11 May 2010 05:19:15 UTC