Bug 88587 - Z coordinate incorrect in -webkit-transform-origin Safari
: Z coordinate incorrect in -webkit-transform-origin Safari
Status: NEW
: WebKit
New Bugs
: 528+ (Nightly build)
: Macintosh Intel Mac OS X 10.7
: P2 Normal
Assigned To:
:
: InRadar
:
:
  Show dependency treegraph
 
Reported: 2012-06-07 15:58 PST by
Modified: 2013-06-18 16:05 PST (History)


Attachments
Sample image rendered in Chrome (75.47 KB, image/png)
2012-06-07 15:58 PST, Christopher Cameron
no flags Details
Rendering in Safari (97.27 KB, image/png)
2012-06-07 15:58 PST, Christopher Cameron
no flags Details
Source HTML file (1.91 KB, text/html)
2012-06-07 15:59 PST, Christopher Cameron
no flags Details


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2012-06-07 15:58:13 PST
Created an attachment (id=146404) [details]
Sample image rendered in Chrome

It appears that the Z coordinate of -webkit-transform-origin does not behave correctly on Safari.

If the point <x,y,z> is specified by -webkit-transform-origin, and the transformation matrix T is specified by -webkit-transform, then the overall transformation should be:
  [1 0 0 x]       [1 0 0 -x]
  [0 1 0 y] * T * [0 1 0 -y]
  [0 0 1 z]       [0 0 0 -z]
  [0 0 0 1]       [0 0 0  1]
It appears that in Safari, the transformation is actually:
  [1 0 0 x]       [1 0 0 -x]
  [0 1 0 y] * T * [0 1 0 -y]
  [0 0 1 0]       [0 0 0 -z]
  [0 0 0 1]       [0 0 0  1]
Note the zero in row 3 column 4 of the leftmost matrix.  Consequently, the resulting Z position is incorrect.

I've attached a stripped-down test (from the Chromium bug) which shows this behavior, along with pictures of its rendering.  In the example, the top image shows text that should have no transformation applied to it, but it has a translation in the Z dimension as a consequence of this bug.  The middle image shows an ordinary rotateY(180deg), which renders correctly on Safari.  The bottom image does a rotateY(180deg) around non-zero Z-origin, which is also impacted by this bug on Safari.
------- Comment #1 From 2012-06-07 15:58:45 PST -------
Created an attachment (id=146405) [details]
Rendering in Safari
------- Comment #2 From 2012-06-07 15:59:05 PST -------
Created an attachment (id=146406) [details]
Source HTML file
------- Comment #3 From 2012-06-07 16:00:23 PST -------
Adding myself and Simon Fraser to CC.
------- Comment #4 From 2012-06-07 16:05:39 PST -------
Is this this same as the issue described by http://jsfiddle.net/fnJyd/ ?
------- Comment #5 From 2012-06-07 16:07:40 PST -------
(In reply to comment #4)
> Is this this same as the issue described by http://jsfiddle.net/fnJyd/ ?

> When changing the value of a transform-origin's z component 
> Safari seems to automatically translate the element to the 
> specificed position if a transform has been defined.

Yes, this is the same issue.
------- Comment #6 From 2012-07-18 12:37:04 PST -------
*** Bug 91494 has been marked as a duplicate of this bug. ***
------- Comment #7 From 2013-06-18 16:05:53 PST -------
<rdar://problem/14180947>