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

[css3-transforms] Multiplication order

From: Simon Sapin <simon.sapin@kozea.fr>
Date: Sat, 10 Nov 2012 23:10:12 +0100
Message-ID: <509ED0C4.5000504@kozea.fr>
To: www-style list <www-style@w3.org>
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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:02 GMT