W3C home > Mailing lists > Public > public-fx@w3.org > July to September 2010

RE: [css21][css3][svg] SVG and unit-less length values

From: Dirk Schulze <vbs85@gmx.de>
Date: Fri, 30 Jul 2010 13:59:11 +0200
To: Patrick Dengler <patd@microsoft.com>
Cc: David Singer <singer@apple.com>, Chris Lilley <chris@w3.org>, Sylvain Galineau <sylvaing@microsoft.com>, Boris Zbarsky <bzbarsky@MIT.EDU>, "www-style@w3.org list" <www-style@w3.org>, "public-fx@w3.org" <public-fx@w3.org>
Message-ID: <1280491151.2654.21.camel@dirk-laptop>
I think SVG and HTML will have the same starting point, when CSS 2D
Transforms get released. Both can end up with different coordinate
spaces if you use e.g. scale:

<!DOCTYPE html>
<html>
<style type="text/css">
.div { width:100px; height:100px; background-color:blue;}
</style>
<body>
<div class="transform: scale(0.25,0.25);">
	<div class="div"></div>
</div>
<div class="div"></div>
</body>
</html>

both DIV-boxes of the class 'div' have a width and height of 100px, but
they still have different sizes looking at device pixels.

So it isn't limited to SVG anymore. That's why I think we can and should
use the same rules for HTML and SVG. It doesn't matter for me, if we
force the user to use units or not. It just shouldn't be different
between SVG and HTML.
We can still allow the user to omit units in attributes of SVGElements.


Am Freitag, den 16.07.2010, 14:56 +0000 schrieb Patrick Dengler:
> Let's see if I can add to this:
> 
> >>>
> I'm wondering when it "doesn't make sense" to give units for a length value..  Even the zero case makes sense (I think 0cm is well-defined)!  Why isn't the suggestion "give units all the time, you know it makes sense and avoids the possibility that the author assumes X and the UA assumes Y" [1].
> <<<
> 
> SVG lives entirely in a coordinate space, and is different from HTML architecturally in that manner.  Once an unit type is resolved on some top level container, then those units are interpretted into the SVG.  Coordinate systems just don't have unit types; I think that is why it doesn't make sense.  
> 
> 
> ________________________________________
> From: public-fx-request@w3.org [public-fx-request@w3.org] on behalf of David Singer [singer@apple.com]
> Sent: Wednesday, July 07, 2010 10:59 AM
> To: Chris Lilley
> Cc: Sylvain Galineau; Boris Zbarsky; www-style@w3.org list; public-fx@w3.org
> Subject: Re: [css21][css3][svg] SVG and unit-less length values
> 
> OK, I'll bite...
> 
> On Jul 7, 2010, at 8:18 , Chris Lilley wrote:
> >
> > If they are more used to SVG (or some other vector format) and they are starting to apply that to HTML/CSS then they are surprised to find they need to add units 'even if it doesn't make sense'.
> >
> 
> I'm wondering when it "doesn't make sense" to give units for a length value..  Even the zero case makes sense (I think 0cm is well-defined)!  Why isn't the suggestion "give units all the time, you know it makes sense and avoids the possibility that the author assumes X and the UA assumes Y" [1].
> 
> [1] http://www.cnn.com/TECH/space/9909/30/mars.metric/
> 
> David Singer
> Multimedia and Software Standards, Apple Inc.
> 
Received on Friday, 30 July 2010 11:59:45 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 30 July 2010 11:59:46 GMT