[css3-transforms] Multiplication order

Hi,

css3-transforms recently got a change to specify more precisely the 
multiplication order of transformation matrices:

http://dvcs.w3.org/hg/csswg/rev/a88c3b8d6b27

This is good, but still somewhat ambiguous: matrix multiplication is not 
commutative, A * B is not always the same as B * A.

§6 says:

> Multiply by each of the transform functions in ‘transform’ property from left to right

Is this a left-multiply or a right multiply? In other words, which of 
these is correct?

     accumulator = accumulator * to_matrix(function)
or
     accumulator = to_matrix(function) * accumulator


I remember trying stuff blindly and comparing with other engines in 
order to get this right in WeasyPrint…

Similar questions arise with nested "transformed" stacking contexts or 
anywhere an implementation would multiply matrices. It might just be me 
who is confused, but the spec could still be more explicit than it is 
currently.

Thanks,
-- 
Simon Sapin

Received on Saturday, 10 November 2012 22:10:41 UTC