blob: 86ff898bb43ce66024ab2872129fb46de4f67942 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="../../../resources/js-test.js"></script>
</head>
<body>
<script>
description("Tests that the padding shorthand is computed properly.")
var testContainer = document.createElement("div");
testContainer.contentEditable = true;
document.body.appendChild(testContainer);
testContainer.innerHTML = '<div style="width:100px;height:100px"><div id="test">hello</div></div>';
e = document.getElementById('test');
computedStyle = window.getComputedStyle(e, null);
e.style.padding = "10px 5px 4px 3px";
shouldBe("computedStyle.getPropertyValue('padding')", "'10px 5px 4px 3px'");
e.style.padding = "4em 5em 6em 7em";
shouldBe("computedStyle.getPropertyValue('padding')", "'64px 80px 96px 112px'");
e.style.padding = "5% 6% 7% 8%";
shouldBe("computedStyle.getPropertyValue('padding')", "'5px 6px 7px 8px'");
document.body.removeChild(testContainer);
</script>
</body>
</html>