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

Re: CSS: %% length unit. Proposal.

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Fri, 07 May 2004 01:40:05 -0500
Message-ID: <409B2F45.8040600@mit.edu>
To: "Anne van Kesteren (fora)" <fora@annevankesteren.nl>
Cc: Andrew Fedoniouk <news@terrainformatica.com>, www-style@w3.org

Anne van Kesteren (fora) wrote:
>> 1) Nonlinearity. Extremely bad for layout calculations. E.g. what will
>> happen if 50% - 100px become negative? Alghoritms will become unstable.
> The same as will happen with 'width:-100px', obviously. I believe that 
> becomes 'width:auto', not entirely sure though.

It becomes 0.  More interestingly:

foo, bar { display: block; }
foo { width: calc(50% - 100px;) }
bar { width: inherit; }

   <bar />

What does bar inherit?

> Why is the complex? A browser already have to calculate every unit into 
> 'px', since that is the where screens are based upon.

Yes, but _when_ the calculation happens is key.  Also, conversion to px is lossy 
in many cases, leading to rounding issues.

I'm not sure what I think of the %% proposal yet, but calc() has some issues 
that would need to be ironed out....

Received on Friday, 7 May 2004 02:40:43 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:13 UTC