diff --git a/lib/CSSStyleDeclaration.js b/lib/CSSStyleDeclaration.js index f7cdd42..9c7be05 100644 --- a/lib/CSSStyleDeclaration.js +++ b/lib/CSSStyleDeclaration.js @@ -17,7 +17,10 @@ function parseStyles(s) { parser.addListener("property", function(e) { if (e.invalid) return; // Skip errors result[e.property.text] = e.value.text; - if (e.important) result.important[e.property.text] = e.important; + if (e.important) { + result.important = {}; + result.important[e.property.text] = e.important; + } }); s = (''+s).replace(/^;/, ''); parser.parseStyleAttribute(s);