5 <script src="../../../resources/js-test.js"></script>
10 description("Tests that the padding shorthand is computed properly.")
12 var testContainer = document.createElement("div");
13 testContainer.contentEditable = true;
14 document.body.appendChild(testContainer);
16 testContainer.innerHTML = '<div style="width:100px;height:100px"><div id="test">hello</div></div>';
18 e = document.getElementById('test');
19 computedStyle = window.getComputedStyle(e, null);
21 e.style.padding = "10px 5px 4px 3px";
22 shouldBe("computedStyle.getPropertyValue('padding')", "'10px 5px 4px 3px'");
24 e.style.padding = "4em 5em 6em 7em";
25 shouldBe("computedStyle.getPropertyValue('padding')", "'64px 80px 96px 112px'");
27 e.style.padding = "5% 6% 7% 8%";
28 shouldBe("computedStyle.getPropertyValue('padding')", "'5px 6px 7px 8px'");
30 document.body.removeChild(testContainer);