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

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 UTC