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

Re: CSS: %% / 'calc' length unit

From: Anne van Kesteren (fora) <fora@annevankesteren.nl>
Date: Fri, 07 May 2004 16:51:24 +0200
Message-ID: <409BA26C.4080909@annevankesteren.nl>
To: Boris Zbarsky <bzbarsky@MIT.EDU>
Cc: Andrew Fedoniouk <news@terrainformatica.com>, www-style@w3.org

>> 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; }
> 
> <foo>
>   <bar />
> </foo>
> 
> What does bar inherit?

The computed value from FOO? (If I understand the parts about CSS 2.1 
"computed values" and "inheritance" correctly.)

>> 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.

Rounding should obviously be done at the latest moment possible, not?


-- 
  Anne van Kesteren
  <http://annevankesteren.nl/>
Received on Friday, 7 May 2004 10:55:36 GMT

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