1.68 KB, text/html
2.38 KB, text/html
1.94 KB, text/html
1.52 KB, patch
|Details | Diff | Splinter Review|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.51.22 (KHTML, like Gecko) Version/5.1.1 Safari/534.51.22 Steps to reproduce: Apply CSS3 3d rotation (rotate3d(0,0,1,50deg) to element. Actual results: Element rotated counterclockwise around axis Expected results: According to the spec it should have rotated *clockwise*. (See http://www.eleqtriq.com/wp-content/static/demos/2011/mozbugs/)
Attachment #576138 - Attachment mime type: text/plain → text/html
I am fairly sure that this is invalid. As I see it, vector (0,0,1) is coming out of the screen so any rotation will be as 'seen' from behind the screen; The rotation that you want would be (0,0,-1,50deg). [cf (1,0,0) being left to right, and (0,1,0) being top to bottom]
Component: General → Style System (CSS)
Product: Firefox → Core
QA Contact: general → style-system
As I understand the spec the rotation vector is relative to the rotation origin of the elements local coordinate system. In the example the rotation occurs around a positive vector pointing towards the viewer, so a clockwise rotation should be a rotation from left to right IMHO. Another way to describe this rotation would be rotateZ(50deg), which works consistently in Fox and Webkit. The third way to describe this rotation would be to transfer vector and angle into a matrix. And again, applying a CSS3D transform with the resulting matrix, matrix3d(0.643,0.7663,0,0,-0.766,0.643,0,0,0,0,1,0,0,0,0,1) suddenly gives us the transformation we expected -clockwise around the Z-axis- consistently in Fox and Webkit. However, even If your assumption would be true, this would mean that Webkit implementation has a bug. Unfortunately Webkit supports CSS3d for almost two years, which means every existing content will break in Fox10 causing new headaches for developers. If this is the case, I as a developer would prefer the pragmatic solution that the spec is changed and Fox adopts the webkit way of handling rotations.
According to the spec the axis angle combination is equivalent to this matrix3d transformation: matrix3d(1 + (1-cos(angle))*(x*x-1), -z*sin(angle)+(1-cos(angle))*x*y, y*sin(angle)+(1-cos(angle))*x*z, 0, z*sin(angle)+(1-cos(angle))*x*y, 1 + (1-cos(angle))*(y*y-1), -x*sin(angle)+(1-cos(angle))*y*z, 0, -y*sin(angle)+(1-cos(angle))*x*z, x*sin(angle)+(1-cos(angle))*y*z, 1 + (1-cos(angle))*(z*z-1), 0, 0, 0, 0, 1). However, both transformations behave differently in aurora, one more indication that rotate3d is not implemented as expected.
Attachment #576443 - Attachment mime type: text/plain → text/html
Matt, can you take a look please?
Added -webkit-transform styles
Attachment #576434 - Attachment is obsolete: true
(In reply to Dirk from comment #2) > ... And again, applying a CSS3D transform with > the resulting matrix, > matrix3d(0.643,0.7663,0,0,-0.766,0.643,0,0,0,0,1,0,0,0,0,1) suddenly gives > us the transformation we expected -clockwise around the Z-axis- consistently > in Fox and Webkit. This is not the matrix you get when applying the algorithm from the spec -z*sin(angle) gives -0.76626 so AFAICT we are following the standard but don't give the same result as webkit. [in attachment 576443 [details] computed styles are rotate3d: -moz-transform: matrix(0.642531, -0.76626, 0.76626, 0.642531, 0px, 0px); matrix3d: -moz-transform: matrix(0.643, 0.7663, -0.766, 0.643, 0px, 0px);]
Your right! Well then - hello again, inconsistencies and vendorprefix, my old friends :-/
We do need to figure out whether the bug is in the spec or in WebKit...
(And to be clear why there's a tracking nomination: we should figure this out before we ship 3d transforms.)
Looks like there is a consensus about this on www-style. This patch reverse the rotation direction of rotate3d() with a note that it's still wrong in the spec.
Attachment #578940 - Flags: review?(dbaron)
Comment on attachment 578940 [details] [diff] [review] Reverse the rotation direction r=dbaron
Attachment #578940 - Flags: review?(dbaron) → review+
Comment on attachment 578940 [details] [diff] [review] Reverse the rotation direction We shouldn't ship 3d transforms without this trivial fix, so requesting aurora approval.
Attachment #578940 - Flags: approval-mozilla-aurora?
Attachment #578940 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Verified s fixed using the attached test cases on: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0a2) Gecko/20111214 Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:11.0a1) Gecko/20111212
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.