blob: 684f852ee675a279f05a5181f6895d7168f528ed [file] [log] [blame]
<!doctype html>
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<div id="target" style="display:none; color:rgba(1, 2, 3, 0.4)"></div>
<script>
description("Verify that CSSStyleDeclaration.getPropertyValue() returns an empty string when the property argument does not match.");
shouldThrow("document.getElementById('target').style.getPropertyValue()");
shouldBeEqualToString("document.getElementById('target').style.getPropertyValue('foobar')", "");
shouldBeEqualToString("document.getElementById('target').style.getPropertyValue('display')", "none");
shouldBeEqualToString("document.getElementById('target').style.getPropertyValue('color')", "rgba(1, 2, 3, 0.4)");
shouldBeEqualToString("document.getElementById('target').style.getPropertyValue('-webkit-display')", "");
shouldBeEqualToString("document.getElementById('target').style.getPropertyValue('-webkit-color')", "");
shouldBeEqualToString("document.getElementById('target').style.getPropertyValue('foobar', 1)", "");
shouldBeEqualToString("document.getElementById('target').style.getPropertyValue('display', null)", "none");
shouldBeEqualToString("document.getElementById('target').style.getPropertyValue('color', undefined)", "rgba(1, 2, 3, 0.4)");
shouldBeEqualToString("document.getElementById('target').style.getPropertyValue('-webkit-display', 'unused')", "");
shouldBeEqualToString("document.getElementById('target').style.getPropertyValue('-webkit-color', { foo:'bar'})", "");
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>