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

Re: [css3-2d-transforms] Interop: matrix() values e,f <number> or <length>

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Thu, 18 Nov 2010 10:12:10 -0500
Message-ID: <4CE5424A.7030904@mit.edu>
To: Chris Marrin <cmarrin@apple.com>
CC: www-style list <www-style@w3.org>
On 11/18/10 9:58 AM, Boris Zbarsky wrote:
> How does that follow? If _I_'m using matrix() in a web page, I'm
> probably doing math in support of some physics, personally, and I better
> be using correct units everywhere to stay sane instead of having units
> magically implied somewhere!

To clarify, what you're saying is "The syntax should have no units, but 
the semantics should be that the number is treated as if it had units of 
px".  Or something.  The current 2d transform spec actually doesn't 
define what the heck the matrix() syntax means for nonzero e and f, 
except by linking to SVG.  In SVG there is in fact a privileged unit: 
user units; so in SVG assuming that e and f are given in user units 
makes sense. In fact, in SVG you always have to use user units in all 
the transform stuff (including in translate()).  You can't use other 
units even if you wanted to.

CSS has no concept of user units (or even of a current coordinate 
system, which is necessary to define user units in the first place), so 
the only way to handle the e and f values of the transform matrix is to 
do one of the following:

1) Have the spec assume an arbitrary unit for them and specify what it
    is (which it doesn't).  I assume webkit makes just such an arbitrary
    unit choice; which one?  This makes the entries _look_ like numbers
    to web developers, even though they're no such thing.
2) Have these be specified with length units in the matrix (what Gecko
    does).  This makes the fact that they're lengths explicit.
3) Go ahead and try to actually define something akin to user units and
    try to graft it onto CSS somehow.  Apart from conceptual purity and
    a feeling of well-being and contentment, this is fundamentally the
    same as option 1, as far as I can see.

-Boris
Received on Thursday, 18 November 2010 15:12:45 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:34 GMT