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

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

From: Chris Marrin <cmarrin@apple.com>
Date: Mon, 29 Nov 2010 07:18:29 -0800
Cc: www-style list <www-style@w3.org>
Message-id: <A531D18C-9AEF-429D-9776-BE16FF554821@apple.com>
To: Boris Zbarsky <bzbarsky@MIT.EDU>

On Nov 19, 2010, at 12:01 PM, Boris Zbarsky wrote:

> ...
>> But yes, I believe units should not be allowed in the matrix() function syntax. Certainly values being produced in the matrix operations have _some_ units, I think we just have to agree what those units are.
> 
> OK, what are they?  And again, I think allowing units in translate() but not in matrix() is really weird.  For one thing, I'm failing to come up with a self-consistent model of how transforms work in that world...

If an element is present (in style, for instance), then we convert using that element. If we don't (as in the current CSSMatrix constructor) then we convert using some unit distance which is not well defined.

> 
>> This brings up a glaring problem with CSSMatrix. When you construct one, it is not associated with any element, so you can't use an element's style to convert units. Today, when we encounter the above CSSMatrix constructor I believe we just convert 50% to a value of 50 or something equally arbitrary. We should probably amend CSSMatrix to allow an element to be passed to the constructor. This brings up the next sticky issue of what happens when, for instance, the client size of the element changes. Do values in the CSSMatrix change? Madness!
> 
> Agreed.  Why are we allowing percentages here again?  ;)

In CSSMatrix? Why do we allow percentages anywhere? Since this is JavaScript, we can get the clientWidth or clientHeight and multiply them by our desired percentage. But why not make CSSMatrix like any other CSS evaluation?

-----
~Chris
cmarrin@apple.com
Received on Monday, 29 November 2010 15:19:03 GMT

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