W3C home > Mailing lists > Public > www-style@w3.org > May 2004

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

From: Mikko Rantalainen <mira@cc.jyu.fi>
Date: Tue, 11 May 2004 22:17:54 +0300
Message-ID: <40A126E2.9050707@cc.jyu.fi>
To: www-style@w3.org

Andrew Fedoniouk / 2004-05-10 10:30:
> %% 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) .

OK. With markup like this

<p>1 2 3 4 5 <span /> 6 7 8 9<p>

and style

span { width: 80%%; }

what belongs in the *first* "line box"? If the minimum combined 
width of the words from "1" to "9" is just equal to the container 
width I assume that the 'freespacewidth' is zero. So the span should 
have computed width of zero? Or is it something else?

If we add rule

span { min-width: 2em; }

that just makes the span 2em width because it would otherwise have 
narrower computed value (see above).

You see, the problem is, when to drop the rest of the inline items 
to *next* "line box" and use remaining space for the "%%" unit? I 
think the default behavior is to put everything in the first line 
box that fits in (greedy algorithm).

IMO, the "%%" unit is clearly defined only if all of the containers 
content fit in one line. And for a such a special case, I think we 
can come up with something better than "%%".

-- 
Mikko
Received on Tuesday, 11 May 2004 15:16:48 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:29 GMT