diff --git a/lib/CSSStyleDeclaration.js b/lib/CSSStyleDeclaration.js index f7cdd42..840f90b 100644 --- a/lib/CSSStyleDeclaration.js +++ b/lib/CSSStyleDeclaration.js @@ -13,7 +13,7 @@ function CSSStyleDeclaration(elt) { // {"margin-left":"5px", "border-style":"solid"} function parseStyles(s) { var parser = new parserlib.css.Parser(); - var result = {}; + var result = { important: {} }; parser.addListener("property", function(e) { if (e.invalid) return; // Skip errors result[e.property.text] = e.value.text; diff --git a/test/domino.js b/test/domino.js index 8e7445e..9f5c177 100644 --- a/test/domino.js +++ b/test/domino.js @@ -540,3 +540,11 @@ exports.contains = function() { nodeList[0].contains(nodeList[1]).should.equal(false); nodeList[1].contains(nodeList[0]).should.equal(false); }; + +exports.parseImportant = function() { + var html = '

foo

'; + var doc = domino.createDocument(html); + var p = doc.querySelector('p'); + p.style.fontFamily.should.equal('sans-serif'); + p.style.textDecoration.should.equal('none'); +};