blob: caa21b6e7dad781d6333a121150469e971882891 [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 -webkit-columns shorthand is computed properly.")
var testContainer = document.createElement("div");
testContainer.contentEditable = true;
document.body.appendChild(testContainer);
testContainer.innerHTML = '<div id="test" style="-webkit-columns: 10px 2;">hello</div>';
e = document.getElementById('test');
computedStyle = window.getComputedStyle(e, null);
shouldBeEqualToString("computedStyle.getPropertyValue('-webkit-columns')", '10px 2');
e.style.webkitColumns="10px";
shouldBeEqualToString("computedStyle.getPropertyValue('-webkit-columns')", '10px auto');
e.style.webkitColumns=""
e.style.webkitColumnCount="2"
shouldBeEqualToString("computedStyle.getPropertyValue('-webkit-columns')", 'auto 2');
e.style.webkitColumns="auto 2"
shouldBeEqualToString("computedStyle.getPropertyValue('-webkit-columns')", 'auto 2');
e.style.webkitColumnCount="auto";
shouldBeEqualToString("computedStyle.getPropertyValue('-webkit-columns')", 'auto auto');
e.style.webkitColumnWidth="10px";
shouldBeEqualToString("computedStyle.getPropertyValue('-webkit-columns')", '10px auto');
document.body.removeChild(testContainer);
</script>
</body>
</html>