W3C home > Mailing lists > Public > www-style@w3.org > November 2007

Re: Unit omission with zero length

From: Henri Sivonen <hsivonen@iki.fi>
Date: Sat, 17 Nov 2007 19:18:31 +0200
Cc: W3C Style List <www-style@w3.org>
Message-Id: <CA7BE4C0-5C12-4EEA-B186-7639C0E614F9@iki.fi>
To: Bert Bos <bert@w3.org>

On Nov 17, 2007, at 19:07, Bert Bos wrote:

> Henri Sivonen wrote:
>> From http://www.w3.org/TR/css3-values/#lengths :
>> "After the '0' length, the unit identifier is optional."
>> Please be more explicit about the distinction between the literal  
>> string "0" and the number evaluating to zero ("0.0", "00", ".0",  
>> etc.).
>> I now suppose that the unit identifier is optional only with the  
>> literal string "0", but initially, I read less carefully and  
>> thought that the unit identifier was optional with anything  
>> evaluating to zero.
>
> Please stop reading "carefully," you're not a computer :-)

I'm a validator developer. :-)

> What would you rather pay, 0 cents or 0.00 Euro? Which is longer, 0  
> cm, 0.0 cm or 0.0000 cm?
>
> [Answers: if you're a computer scientist, "0.0000 cm" is the longest  
> by several bytes; if you're a physicist, 0 is the least precise, so  
> it is potentially the longest; if you're a normal user of CSS: "Huh,  
> are you pulling my leg?"]

I don't have a stake in deciding what the valid syntax is, but I think  
the spec should define carefully what the valid syntax is as it  
relevant to ignoring an entire query.

I take it that you are saying that the spec text is wrong and any  
<number> evaluating to zero should be allowed with a unit.  
Fortunately, that's what I implemented already accidentally.

-- 
Henri Sivonen
hsivonen@iki.fi
http://hsivonen.iki.fi/
Received on Saturday, 17 November 2007 17:18:50 GMT

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