Bugzilla – Bug 15443
CSSMatrix is defined, but there's no way to get one
Last modified: 2012-02-23 05:20:24 UTC
http://dev.w3.org/csswg/css3-transforms/ defines a CSSMatrix interface with a bunch of methods. However, nothing in the spec provides any way to obtain a CSSMatrix, except by calling methods on an existing CSSMatrix. Either there should be some way to create a CSSMatrix -- maybe define a constructor? -- or the definition should be removed.
(FWIW, window.CSSMatrix is undefined in all browsers I tested in. Either browsers don't actually implement the interface, or they implement it with [NoInterfaceObject]. grep -IR CSSMatrix . in mozilla-central returns no results.)
foo = new CSSMatrix('rotate(10deg)') works in webkit.
Is this only the Safari port? In Chrome 17 dev, I get "Uncaught ReferenceError: CSSMatrix is not defined".
(In reply to comment #2)
> Is this only the Safari port? In Chrome 17 dev, I get "Uncaught
> ReferenceError: CSSMatrix is not defined".
In WebKit you have to say WebKitCSSMatrix, for instance:
in the address bar works for me.
Aha, okay. Then I think the IDL should have this line added before it:
[Constructor(optional DOMString transform)]
and some prose like
When the constructor for CSSMatrix is invoked, the parameter <var>transform</var> must be parsed according to the rules for parsing the <a href=#transform-property>transform property</a>. If parsing succeeds, return a CSSMatrix representing the matrix corresponding to <var>transform</var>. Otherwise, if <var>transform</var> is the empty string or is omitted, return a CSSMatrix representing the identity matrix. Otherwise, <a href=http://dvcs.w3.org/hg/domcore/raw-file/tip/dom-core.html#concept-throw>throw</a> a SyntaxError exception.
(This doesn't define how whitespace stripping works, but that's not a big deal for now.)
This gets delayed to CSS4 Transforms.