blob: 6ee3047845a3c1ccdddd7670ab9c6eb56cc35ba0 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body style="color: black">
<div id="valid1" style="color: red">This style is "color: red"</div>
<div id="valid2" style="color: FF0000">This style is "color: FF0000"</div>
<div id="valid3" style="color: #FF0000">This style is "color: #FF0000"</div>
<div id="valid4" style="color: F00">This style is "color: F00"</div>
<div id="valid5" style="color: #F00">This style is "color: #F00"</div>
<div id="invalid1" style="color: #red">This style is "color: #red"</div>
<div id="invalid2" style="color: #yellow">This style is "color: #yellow"</div>
<div id="invalid3" style="color: #green">This style is "color: #green"</div>
<div id="invalid4" style="color: #FFAALL">This style is "color: #FFAALL"</div>
<script>
description(
"This test checks hexadecimal color parsing."
);
var red = "rgb(255, 0, 0)";
var black = "rgb(0, 0, 0)";
for (var i=1;i<=5;i++)
{
var div = document.getElementById("valid"+i);
shouldBe("getComputedStyle(div, null).color", "red");
}
for (var i=1;i<=4;i++)
{
var div = document.getElementById("invalid"+i);
shouldBe("getComputedStyle(div, null).color", "black");
}
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>