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: Dirk Schulze <dschulze@adobe.com>
Date: Wed, 8 Feb 2012 03:15:40 -0800
To: Simon Fraser <smfr@me.com>
CC: Simon Sapin <simon.sapin@kozea.fr>, "www-style@w3.org" <www-style@w3.org>
Message-ID: <7041DCF6-2B1C-48CF-9E59-CB9D42BA77C8@adobe.com>
Hello,

SVG defines the units of "unit less" values as follows:

"Note that at initialization, a user unit in the the initial coordinate system is equivalenced to the parent environment's notion of a px unit." [1]

So 'e' and 'f' are pixels in the parents coordinate space - for CSS as well.

Greetings
Dirk

[1] http://www.w3.org/TR/SVG/coords.html#TransformAttribute


On Feb 8, 2012, at 3:02 AM, Simon Fraser wrote:

> This has been raised a number of times:
> <https://www.w3.org/Bugs/Public/show_bug.cgi?id=15628>
> <http://lists.w3.org/Archives/Public/www-style/2009Oct/0360.html>
> 
> and is on the F2F agenda for today.
> 
> Simon
> 
> On Feb 8, 2012, at 11:39 AM, Simon Sapin 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.
>> 
>> 
>> 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 19:57:58 GMT

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