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

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

From: Dr. Olaf Hoffmann <Dr.O.Hoffmann@gmx.de>
Date: Fri, 13 Aug 2010 16:01:57 +0200
To: public-fx@w3.org, www-style@w3.org
Message-Id: <201008131601.57557.Dr.O.Hoffmann@gmx.de>
Boris Zbarsky:
> On 8/13/10 5:51 AM, Dr. Olaf Hoffmann wrote:
> > ??? If we just restrict the discussion currently on device pixels,
>
> CSS px and device px are not the same thing.
>
> You're right that the CSS definition is not "1/96 in", of course; it's
> much more complicated.
>
> > At least Mozilla/Gecko determine the proper size using the
> > correct resolution for device pixels
>
> This is no longer the case as of last night.  We now define 'in' to be
> 96 css px (whatever number of device pixels that is), as other UAs do;
> too many web sites depend on that.
>

Sounds like a bug as for the others, at least for SVG documents.
It it surely possible to define some arbitrary unit 'px' with an equation
96px == 1inch == 0.0254m, but not the other way round ...
However, I think, many authors are interested as well to have a
unit for one ordinary pixel of a raster image - at least for this
application device pixels can be pretty useful - and sometimes
not a trivial thing in SVG to embed a raster image without 
interpolation or without knowing the intrinsic pixel size of the
raster image. 

If you get wrong sizes for maps and technical drawings, this is certainly
a bug and every user can see this using a simple measuring stick.
Well maybe not very important for inches, but if the same bug appears
for cm or mm, this is close to ridiculous to pessimise Mozilla/Geckos,
just because a few authors obviously do not understand, what an
inch is (I think, it is defined to be 25.4mm, respectively 0.0254m and
nothing else - but I'm not sure, who defined, what an inch is, but
I'm pretty sure what the definition of m (cm, mm is) ;o) 
Up to now, one can at least say - if you need a proper size of your
image in cm, use Mozilla/Geckos. After such a pessimisation one 
can always write: 
Note, due to bugs of viewers, the size of the map/drawing will
typically displayed wrong. Do not rely on  defective viewers and 
convert into another (CSS independent) format to get a proper size - 
I cannot see, that this is useful for authors or the audience to switch to
another format to get something predictable, if they need a drawing
with a true scale. Why should it not be possible for W3C formats simply
to get 1cm or 1in if this is noted?
If someone wants to buy an apple and get a banana, just because some 
people like bananas much more than apples - what is the advantage of
this cheating for the cheated?

> Note that the CSS spec will almost certainly be changing to require this.
>

Sounds like an  absurd specification, if it is in an obvious contradiction
with international standards. 
Does CSS define that 1+1=3 as well? ;o)
Is it intented to become a religion or a technical recommendation? ;o)
And it seems to indicate much more, that unit identifier are problematic -
at least for CSS - why to introduce such problems in SVG with a requirement
to use CSS unit identifiers, if neither the viewers implement them correct nor
the CSS working group seems to have the capabilities to specify something 
meaningful with some relation to common reality?

I think, for SVG it would be really the best solution to recommend authors not
to use unit identifiers at all for length values in general in the next
version, to avoid any confusion with CSS units and to define independently 
what the unit identifiers mean, if noted for width and height of the root svg 
element.

Olaf
Received on Friday, 13 August 2010 14:02:32 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 13 August 2010 14:02:32 GMT