With copying the code from FX Transforms, I might have open a concern from Boris. I will check this:
"In section 7.4 of the current 2d transforms editor's draft (no public
version of this, so no link, sorry), there is a bunch of text that seems
to be defining what to do in terms of 3d transforms. Or so I assume.
It doesn't actually say what the notation it's using means.
In any case, I suspect that using the first Euler angle to rotate in all
three directions is just wrong.
Note: The section number is not correct anymore.
The pseudo code in the spec uses euler angles for getting the rotation. Implementations seem to use quaternions to work around singularities with euler. Should we follow implementations? Should animations and transitions get updated as well?
All people I spoke with agree that we should use quaternions on the pseudo code. At least the code of WebKit and Mozilla seem to follow: http://lists.w3.org/Archives/Public/www-style/2011Aug/0652.html
So I will try to add this to the spec. Simon: looks like you were right with  ;)
A link to the implementations of WebKit and Mozilla:
I am looking at this at the moment.
I suggest that we mention that the decomposing can be done by using quaternions and give a short description of why using quaternions (just one sentence). After that it just references some books or sites that describe quaternions.
I'd remove the code itself and just link to the pseudo code. We maintain this pseudo code and put it into the spec directory. The pseudo code will be using the code from Mozilla and Webkit (they don't differ a lot anyway).
*** Bug 14608 has been marked as a duplicate of this bug. ***
The interpolation code uses quaternions now.