Closed domenic closed 8 years ago
https://github.com/chad3814/CSSStyleDeclaration/pull/35 helped but it seems like the sub-properties are not properly passed to the parent.
Test case from jsdom (with latest csstyle). Mostly passing except the one failing line.
const document = jsdom.jsdom(); for (const prop of ["padding", "margin"]) { document.body.style[prop] = "1px 2px 3px 4px"; t.strictEqual(document.body.style[prop], "1px 2px 3px 4px"); t.strictEqual(document.body.style[prop + "Top"], "1px"); t.strictEqual(document.body.style[prop + "Right"], "2px"); t.strictEqual(document.body.style[prop + "Bottom"], "3px"); t.strictEqual(document.body.style[prop + "Left"], "4px"); document.body.style[prop + "Top"] = "1em"; document.body.style[prop + "Right"] = "2em"; document.body.style[prop + "Bottom"] = "3em"; document.body.style[prop + "Left"] = "4em"; t.strictEqual(document.body.style[prop], "1em 2em 3em 4em"); // fails, left as 1px 2px 3px 4px document.body.style[prop] = "1mm"; t.strictEqual(document.body.style[prop], "1mm"); t.strictEqual(document.body.style[prop + "Top"], "1mm"); t.strictEqual(document.body.style[prop + "Right"], "1mm"); t.strictEqual(document.body.style[prop + "Bottom"], "1mm"); t.strictEqual(document.body.style[prop + "Left"], "1mm"); document.body.style[prop] = "1% 2%"; t.strictEqual(document.body.style[prop], "1% 2%"); t.strictEqual(document.body.style[prop + "Top"], "1%"); t.strictEqual(document.body.style[prop + "Right"], "2%"); t.strictEqual(document.body.style[prop + "Bottom"], "1%"); t.strictEqual(document.body.style[prop + "Left"], "2%"); document.body.style[prop] = "3pc 2pc 1pc"; t.strictEqual(document.body.style[prop], "3pc 2pc 1pc"); t.strictEqual(document.body.style[prop + "Top"], "3pc"); t.strictEqual(document.body.style[prop + "Right"], "2pc"); t.strictEqual(document.body.style[prop + "Bottom"], "1pc"); t.strictEqual(document.body.style[prop + "Left"], "2pc"); } t.done();
/cc @dpvc
I've made a pull request that should resolve the issue.
pulling and running jsdom tests now, I've merged and published @dpvc's commit, so this should be good.
fixed on 0.2.33
https://github.com/chad3814/CSSStyleDeclaration/pull/35 helped but it seems like the sub-properties are not properly passed to the parent.
Test case from jsdom (with latest csstyle). Mostly passing except the one failing line.