I Guess In Theory That Needs Fixing

If you pay close attention, you’ll notice that the “demos” or “experiments” that people like us inflict on the world tend to be most intriguing just before you actually see them run, when they’re just a thumbnail, in a list, on some gallery page.

I have to add a corollary, of sorts: apparently my work is a lot more interesting when I’m using matrix operations in one way but the browser thinks I’m using them in another.

There’s a lesson in there somewhere.

Just about every little application I’ve written using transforms needs to be recompiled and rereleased, but these are the dangers of using still-developing standards. In the meantime, you’ll get some entertaining results (perhaps more so than before) in a nightly WebKit or nightly/dev Chrome release. They recently switched the order of WebKitCSSMatrix multiplication to the “right” way (unless you did computer graphics in the 80s), but kept matrix entry access the same (e.g. “m14″ is the entry in the fourth row, first column).

The result is that a simple transform is unaffected (I*M = M*I), a more complex transform is kind of backwards but recognizable, and a transform where I get tricky—manipulating a matrix directly and then mixing it with one of the first two—goes satisfyingly nuts.

Some back story: about two and a half weeks ago, I sent an email to a W3C mailing list asking for clarification on what the SVG- and CSSMatrix notation/order “should” be. I got no response on the list. Too long winded? Probably, but it turns out it was because some WebKit developers recognized the issue as a bug in their implementation, filed it, and—before I even thought to check Bugzilla a few days later—had landed the change.

Here we should all thank Simon Fraser and Chris Marrin over at Apple, not only for fixes like this, but for their involvement (with others, of course) in making CSS transforms exist in the first place. But not only are they quick, they have also been incredibly open (if a bit busy) to discussing how to get the standard right. I may be the only developer using this object outside of a mobile browser (it’s probable), but I’m still a nobody; it’s nice for that not to matter.

If you’re actually using my library and are worried about the unstable behavior: existing code will continue to work perfectly with all officially released browsers. As of yesterday, the latest version also takes care of pre-release browsers, on top of adding a bunch of new and faster features you’ll want to use anway. There is one last WebKit bug I’m waiting on, which will change either the spec or their implementation. CSSMatrix is a pretty small interface—there’s not much left to clarify—so I’m hopeful that things will settle down after that.

This is the price we pay for riding the bleeding edge, but don’t discount the fact that your project really might be better a little broken. Thumbnails help, too.

This entry was posted in Uncategorized and tagged , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">