Re: CSS: %% length unit. Proposal. Some clarifications.

OK.

Could somebody help me to express this properly?

%% units calculation rule:

Two steps calculation:
1) mincontentwidth = minimum width of all elements in the line box. (dont
count attributes with %% at this step)
freespacewidth = containercontentwidth - mincontentwidth. (
containercontentwidth is known at this step)
2) change all attributes in all elements having %% units value according
this value and freespacewidth  (percent calculation) .

width/height, margin, padding, border can use %% units. top,bottom, left,
right - cannot - makes no sence.

PS: these units are similar to XUL:<spacer flex=x> facilities, but have
bigger potential and are in CSS spirit.
These units solve problems of "fluid" horizontal and vertical layouts.

Andrew Fedoniouk.
http://terrainformatica.com




----- Original Message -----
From: "Boris Zbarsky" <bzbarsky@MIT.EDU>
To: "Andrew Fedoniouk" <news@terrainformatica.com>
Cc: <www-style@w3.org>
Sent: Monday, May 10, 2004 12:10 AM
Subject: Re: CSS: %% length unit. Proposal. Some clarifications.


> Andrew Fedoniouk wrote:
> > What I am saying here:
> > <P>from:<INPUT ... style="width:100%%" /></P>
> >
> > set width of INPUT equal to 100% of  <container width minus space
occupied
> > by all 'solid' elements in current line>
>  > 'solid' elements here means all elements having horizontal dimensions
in
>  > units other than %%.
>  > 'space occupied' means all width+padding+margin+border having values
other
>  > than %%.
>
> The problem David pointed out is that what elements are in the current
line
> would depend on the width of the <input>.  Thus you have a circular
dependency.
>   Consider the following markup:
>
> <P style="width: 200px">from:<input style="width:100%%"> more text</p>
>
> All of the following renderings satisfy the conditions you expressed
above:
>
> 1)
>
>    from: [                 ]
>    more text
>
> (input is 200px minus width of "from: " wide).
>
> 2)
>
>    from: [            ] more
>    text
>
> (input is 200px minus width of "from: " and width of " more" wide).
>
> 3)
>
>    from: [       ] more text
>
> (input is 200px minus width of "from: " and width of " more text" wide).
>
>
> > Is this formal enough?
>
> Apparently not, since there are three renderings which are all valid per
the
> description.  Hence the information provided is not enough to create
> interoperable implementations.
>
> > These units will not change any existing breaking rules and any others
rules
> > of CSS.
>
> Sure.  None of the breaking rules need changing in the above examples.
>
> > This is already implemented in my experimental renderer. It works. I can
> > demonstrate it alive. I can port this part into Mozilla, Opera, Safari,
IE.
>
> I would be more impressed if you could write a description of the
algorithm that
> would be implementable by someone _else_ in those browsers.  That's what
Ian
> asked you to do and what you have failed to do.
>
> -Boris
>

Received on Monday, 10 May 2004 03:32:47 UTC