W3C home > Mailing lists > Public > www-svg@w3.org > January 2006

Re: Is the px unit equivalent to user units?

From: Maciej Stachowiak <mjs@apple.com>
Date: Tue, 3 Jan 2006 19:38:58 -0800
Message-Id: <62BA12F6-B48C-43B5-B7CD-938159CEEA36@apple.com>
Cc: Bjoern Hoehrmann <derhoermi@gmx.net>, www-svg@w3.org
To: Dean Jackson <dino@w3.org>


On Jan 3, 2006, at 7:09 PM, Dean Jackson wrote:

>>>> Then:
>>>>
>>>>  * Remove the requirement that SVG places on CSS parsers to accept
>>>>    <length>s that are just <number>s.
>>
>> Do you agree with this aswell?
>
> Yeah. Sorry I responded at the wrong place.
>
> If we can have a solution where authors get to use stroke-width="4"  
> in XML content and are required to use "{stroke-width: 4px}" in  
> stylesheets, then I'm happy.

This seems like a decent solution. I don't think anyone would  
seriously object to unitless values in presentational attributes,  
they appear in HTML as well (for example elements that have a width  
attribute). So you write <img width="200"> but "{width: 200px}".

> I would be happier if CSS hadn't required units on <length>s, but I  
> have a sneaking suspicion that that won't change.

Ian pointed out that this would create parsing ambiguities for some  
properties so it seems like it would be impossible to change this  
without breaking backwards compatibility for CSS. line-height in  
particular is a very commonly used property, and "line-height: 2"  
means double the current font size, not 2px. I suppose it would be  
possible to treat dimensionless numbers as if they had px units only  
when a bare number has no other meaning, but I suspect this would be  
more confusing than helpful.

I agree, however, that this is annoying sometimes. For instance, it  
can be awkward to do math in script with dimensions that come from a  
computed style. I'm hoping a future improved CSSOM can address this.

Regards,
Maciej
Received on Wednesday, 4 January 2006 03:39:17 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:33 GMT