tags:

views:

588

answers:

2

I'm using the following CSS rules to do a transformation on a simple H2 element, only text inside it:

-moz-transform: matrix(0, -1, 1, 0, 130px, 118px);
-webkit-transform: matrix(0, -1, 1, 0, 130px, 118px);

It works as expected in Firefox; i doesn't work at all in Safari/Windows and Chrome/Windows: the H2 stays where it is. Am I doing something wrong or are CSS transforms not active in those two browsers under Windows?

+1  A: 

Screenshot

There is some sort of implementation, but it's definitely broken.

If I remove the px's I can get it to render at least (it doesn't seem to render with them or see it as valid CSS), but it doesnt let the screen scroll down to it like Firefox does. Point it to an location in frame though (without the px's) and it does display. Removing the px's don't seem to make any difference to the position either, which is good.

blake
I don't mean to be rude, but the screenshot is very small and I can't even understand what you're talking about. Sorry.
Kaze no Koe
http://i33.tinypic.com/2nhnl7p.png - direct link to image.Basically -webkit-transform: matrix(0, -1, 1, 0, 130, 118);works-webkit-transform: matrix(0, -1, 1, 0, 130px, 118px);doesn't.I don't know why. WebKit also assumes that the last two parameters are pixels, so you get the same rendering as Firefox.
blake
OH! OK thanks a lot!
Kaze no Koe
A: 

The MDC docs are pretty clear:

Note: Gecko (Firefox) accepts a length value for tx and ty. Safari (WebKit) and Opera currently support a unitless number for tx and ty.

After a lengthy post explaining the logic of the matrix, Brendan Kenny concludes that one must

"add units to e and f for Firefox (which doesn’t really make any sense, but for now: fine)."

Which is true - for the computer - as the linear translations are technically no different than the other entities of the matrix. But it is unfair, as - for us humans - it makes logical sense for the linear translations to be in value amounts, and there is no other good way to get the browser to do percentage calculations.

Hopefully, the FF implementation will win.

As an aside, I have read, but not yet tested that the third and fourth values are input into Webkit in order, but in FF and IE in reverse. From the docs:

-moz-transform: matrix(a, c, b, d, tx, ty)

Where a, b, c, d build the transformation matrix and tx, ty are the translate values. 
   ┌     ┐ 
   │ a b │
   │ c d │
   └     ┘
SamGoody