W3C home > Mailing lists > Public > www-style@w3.org > February 2012

Re: [css3-2d-transforms] Unit for e and f in matrix(a,b,c,d,e,f)

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 9 Feb 2012 02:44:25 -0800
Message-ID: <CAAWBYDAUyjsRe15Lgr3=JkA1ok8L5cuvwM-2kvxVfZUtPooHzQ@mail.gmail.com>
To: Simon Sapin <simon.sapin@kozea.fr>
Cc: www-style@w3.org
On Wed, Feb 8, 2012 at 2:39 AM, Simon Sapin <simon.sapin@kozea.fr> wrote:
> Hi,
>
> The syntax for a matrix transformation in the current ED is:
>
>    matrix(<number>, <number>, <number>, <number>, <number>, <number>)
>
> The meaning is defined in the SVG spec:
> http://www.w3.org/TR/SVG/images/coords/MatrixMultiply.png
>
> From this definition, it is apparent that a, b, c and d in
> matrix(a,b,c,d,e,f) are multiplied by a length and give a new length, so
> they are unit-less numbers. However, e and f are multiplied by a unit-less
> one and give a length, so they are lengths too.
>
> What is the unit for e and f? I can’t find this defined in the spec. SVG
> gets away with it since unit-less numbers are valid lengths there, but this
> is not the case in CSS.

Based on the FtF discussion, the arguments for matrix() and matrix3d()
will stay plain numbers, with an assumed unit of px or 1/px as
appropriate.

The reasoning was:

1) The e and f arguments of matrix() are equivalent to the arguments
to the translate() function.  Authors shouldn't ever be writing a
matrix() function in the first place, so they should just use
translate() instead.  For authoring tools, using px is fine and
common, since most information you get out of the CSSOM is in px.

2) In matrix3d(), several argument technically have units of inverse
length, which would be very confusing.  (I suggested using dpi there,
but it wasn't well received. ^_^)  It would be inconsistent to have
some of the unitted values represented with units and others
represented as numbers, so we should just represent them all as
numbers.

~TJ
Received on Thursday, 9 February 2012 10:45:19 GMT

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