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: Chris Marrin <cmarrin@apple.com>
Date: Fri, 10 Feb 2012 14:53:09 -0800
Cc: Simon Sapin <simon.sapin@kozea.fr>, www-style@w3.org
Message-id: <F3AB6DFB-AD28-4F0D-9E21-3C2863C030D4@apple.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>

On Feb 9, 2012, at 2:44 AM, Tab Atkins Jr. wrote:

> 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.

Well, I wouldn't say that you shouldn't ever use matrix (or matrix3d) but using them is very specialized, probably has a bunch of math backing up the final matrix values and therefore units wouldn't necessarily be relevant in these arguments. I just say this because I don't want these functions to have hurt feelings, thinking no one loves them :-)

-----
~Chris
cmarrin@apple.com
Received on Friday, 10 February 2012 22:53:37 GMT

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