Re: Publishing the flexible box model

On Tue, Jun 10, 2008 at 2:23 PM, Andrew Fedoniouk <news@terrainformatica.com>
wrote:

> Robert O'Callahan wrote:
>
>    In this terms flex lengths and dimensions of position:absolute
>>    and position:fixed elements can be computed against their layout
>>    containers too.
>>
>>    Thus:
>>    div
>>    {
>>     position:absolute;
>>     width:25%;
>>     height:25%;
>>     left:1*; top:1*; right:1*; bottom:1*;
>>    }
>>
>>    will position such an element in the middle of abs. pos.
>>    container.
>>
>>
>> OK but how is this going to interact with the rules here, for example:
>> http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width
>>
>
> I see no problems there either.
> In most cases 'shrink-to-fit' is 1* exactly.
> Practically in all cases 'auto' value can be replaced
> by 1* value.
> 1* is a mathematically correct way of saying 'auto' :)
>

That doesn't answer my question. You need to extend the rules in that
section to describe what happens when flexunits (not just "1*") appear for
margins, padding or content.


>
>>    position:relative elements do not have concept of layout
>>    container for computation of left,top,right and bottom
>>    so flex values for these attributes are treated as undefined.
>>
>>
>> What does 'undefined' mean? 'auto'?
>>
>
> Here (for position:relative) it means 'auto' or just '0' (for
> left,top,right and bottom)
>

OK. This is all stuff that needs to be added to your spec.

Consider this:
>
> <div style="overflow:hidden; width:xx; height:yy">
>  <img align=left id=first />
>  <p flex=1>...</p>
>  <img align=left id=second />
> </div>
>
> You will have *exactly* the same kind of problems.


No. The flex on the <p> is ignored because the container is not a flexbox.
If the container was a flexbox, then the <img> elements would not float.

About flex paddings, consider task of vertical alignment of content
> of some div. With flex units that is simple and naturally as:
>
> div
> {
>  box-sizing: border-box;
>  height:1*;
>  border:1px solid;
>  padding:1* 10px;
> }
>

I agree that flexunits are very powerful.


>
>> You do have to account for how flexboxes behave in non-flexbox containers,
>> and how non-flexboxes behave in flexbox containers, but this is considerably
>> easier than reevaluating everything that already exists.
>>
>
> I do not see any problems here too.
>

I was talking about flexboxes, not flexunits. The flexbox spec needs to
define, for example, what happens when you have a horizontal flexbox
containing a number of block children with flex --- how the horizontal space
allocated to each child is computed. (Your flexunits spec needs to define
that too.)

Rob
-- 
"He was pierced for our transgressions, he was crushed for our iniquities;
the punishment that brought us peace was upon him, and by his wounds we are
healed. We all, like sheep, have gone astray, each of us has turned to his
own way; and the LORD has laid on him the iniquity of us all." [Isaiah
53:5-6]

Received on Tuesday, 10 June 2008 03:00:56 UTC