blob: 9f68d38d3db67a5183e33ee2bb3e12b45772e77c [file] [log] [blame]
<html>
<head>
<script>
function print(message, color)
{
var paragraph = document.createElement("div");
paragraph.appendChild(document.createTextNode(message));
paragraph.style.fontFamily = "monospace";
if (color)
paragraph.style.color = color;
document.getElementById("console").appendChild(paragraph);
}
function shouldBe(a, b)
{
var evalA;
try {
evalA = eval(a);
} catch(e) {
evalA = e;
}
if (evalA == b)
print("PASS: " + a + " should be " + b + " and is.", "green");
else
print("FAIL: " + a + " should be " + b + " but instead is " + evalA + ".", "red");
}
function test()
{
if (window.layoutTestController)
layoutTestController.dumpAsText();
shouldBe("document.body.style.background == 'green'", true);
shouldBe("document.getElementById('div1').style.background == 'repeat-x, repeat-y white'", true);
shouldBe("document.getElementById('div2').style.background == '50% 50% blue'", true);
}
</script>
</head>
<body onload="test();" style="background: green; color:white">
<div id="div1" style="background-repeat: repeat-x, repeat-y; background-color:white"></div>
<div id="div2" style="background: 50% 50% blue"></div>
<p>This page tests whether or not the background shorthand properly omits
initial values.
<hr>
<div id='console' style="background-color:white; border:2px solid black"></div>
</body>
</html>