blob: 0831bb784c5b41224e47b6eb2e93a140c8e26ea5 [file] [log] [blame]
<!DOCTYPE HTML>
</html>
<head>
<title>-webkit-margin-collapse shorthand getPropertyValue test</title>
<style>
.test {
display: inline-block;
width: 5em;
height: 10em;
}
</style>
<script src="../../resources/js-test.js"></script>
<script>
if (window.testRunner)
testRunner.dumpAsText();
</script>
</head>
<body>
<div id="margin-collapse1" class="test" style="-webkit-margin-collapse: collapse separate;"></div>
<div id="margin-collapse2" class="test" style="-webkit-margin-collapse: discard;"></div>
<div id="margin-collapse3" class="test" style="-webkit-margin-before-collapse: discard; -webkit-margin-after-collapse: separate;"></div>
<div id="margin-collapse4" class="test" style="-webkit-margin-collapse: foo;"></div>
<div id="margin-collapse5" class="test" style="-webkit-margin-before-collapse: collapse;"></div>
<script>
description("<a href=\"https://bugs.webkit.org/show_bug.cgi?id=110903\">Bug 110903: getPropertyValue for -webkit-margin-collapse returns null, should compute the shorthand value</a>");
function webkitMarginCollapseValue(id) {
var element = document.getElementById(id);
return element.style.getPropertyValue("-webkit-margin-collapse");
}
shouldBe('webkitMarginCollapseValue("margin-collapse1")', "'collapse separate'");
shouldBe('webkitMarginCollapseValue("margin-collapse2")', "'discard discard'");
shouldBe('webkitMarginCollapseValue("margin-collapse3")', "'discard separate'");
debug("NOTE: 'foo' is an illegal CSS value for '-webkit-margin-collapse'.");
shouldBeEqualToString('webkitMarginCollapseValue("margin-collapse4")', "");
debug("NOTE: If only few longhand properties are specified, getPropertyValue for shorthand property returns empty string.")
shouldBeEqualToString('webkitMarginCollapseValue("margin-collapse5")', "");
</script>
</body>
</html>