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

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.


Quick test: (prefix as appropriate and change the 5em value)

data:text/html,<div%20style="transform:matrix(1,0,0,1,0,5em)">Hello

Chromium 16 only accepts <number> and reads it as 'px'. Firefox 10 
accepts both <number> (as px) and <translation-value>.


I think one of these should be done:

1. Keep e and f as unit-less numbers in the syntax, but specify that 
they are interpreted as length in some specific unit. Choosing the 'px' 
unit would be most consistent with SVG.

2. The syntax for matrix() is changed to take explicit units:

     matrix(<number>, <number>, <number>, <number>,
            <translation-value>, <translation-value>)

3. Both: make the syntax something like <number> | <translation-value> 
for e and f, and specify the unit for <number>.


Regards,
-- 
Simon Sapin

Received on Wednesday, 8 February 2012 10:43:22 UTC