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

CSS: %% length unit and HTML's MultiLength unit.

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Mon, 10 May 2004 20:58:36 -0700
Message-ID: <001b01c4370c$3dd94180$0301a8c0@ATHLON>
To: "Andrew Fedoniouk" <news@terrainformatica.com>, "Boris Zbarsky" <bzbarsky@MIT.EDU>
Cc: <www-style@w3.org>

Hi, guys,

I've found that HTML 4.0 specification already has concept of %% units. :)

Name of these units is *MultiLength*
[http://www.w3.org/TR/REC-html40/types.html#h-6.6]
However this concept applicable only for tables (COL and COLGROUP in
particular) and framesets.

Seems like MiltiLength units are gone from table-* styles for some reason.

Andrew Fedoniok.
http://terrainformatica.com

==================================================
Here is my second attempt to formalize algorithm of %% computing:

%% units calculation algorithm for inline elements:

First step :
   calculate actual space needed to place/position all elements
   in the line box using standard CSS rules.
   Don't count any attribute having value in %% units at this step:

   ActualContentWidth = width of all elements in the line box.

Second step:
   Substract this ActualContentWidth from ContainerContentWidth to get
FreeSpaceWidth

   FreeSpaceWidth = ContainerContentWidth - ActualContentWidth;

Third step:
  Calculate actual lengths of all attributes measured in %% units using
formula:

  Length = (AttributeValue * FreeSpaceWidth) / 100

Fourth step:
   Replace needed elements in the line according new dimensions.
   This will not force relayout of elements which do not have atrributes
given in %% units.

Done.

I am not sure is this clear or not?
Received on Monday, 10 May 2004 23:59:55 GMT

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