While investigating a ecma5 strict mode error, I raw into
- getComputedStyle : function(element, pseudoElement){
- if(CSS2Properties){
- return element?
- element.style:new CSS2Properties({cssText:""});
- }
since it could return "undefined" sometimes. Turns out "new
CSS2Properties({cssText:""});" actually would explode since it's
ctor wants other input. So the if statement was actually bogus.
I replaced it with
+ /**
+ * getComputedStyle
+ *
+ * Firefox 3.6:
+ * - Requires both elements to be present else an
+ * exception is thrown.
+ * - Returns a 'ComputedCSSStyleDeclaration' object.
+ * while a raw element.style returns a 'CSSStyleDeclaration' object.
+ * - Bogus input also throws exception
+ *
+ * Safari 4:
+ * - Requires one argument (second can be MIA)
+ * - Returns a CSSStyleDeclaration object
+ * - if bad imput, returns null
+ *
+ * getComputedStyle should really be an "add on" from the css
+ * modules. Unfortunately, 'window' comes way after the 'css'
+ * so css can't add it.
+ */
+ getComputedStyle: function(element, pseudoElement) {
+ return element.style;
},
and added stubs for specs/window/specs.js and fixed
the boot.js to include css.dist.
I leave it to the next guy to hack on! (unless I bump into a
page that needs this more fleshed out).
--nickg