<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>
<head>
<title>CSS Test: :indeterminate and input type=radio</title>
<style type="text/css">
div
{
color: green;
}
input:indeterminate + #test
{
color: red;
}
</style>
</head>
<body onload="mytest()">
<p>The test passes if the Filler Text below is green.</p>
<input type="radio" checked />
<div id="test">Filler Text</div>
<div id="testresult" style="color: blue">Running</div>
<script type="text/javascript">
if (window.testRunner)
testRunner.dumpAsText();
function mytest()
{
try
{
document.getElementsByTagName("input")[0].indeterminate = true;
function ArrayContains(array, value, ci)
{
ci = ci == true ? true : false;
for (var i = 0; i < array.length; i++)
{
if (ci && array[i].toLowerCase() == value.toLowerCase())
{
return true;
}
else if (array[i] == value)
{
return true;
}
}
return false;
}
var target = document.getElementById("test");
var val = getComputedStyle(target, null).getPropertyValue("color");
var aExpectedValues = new Array("green", "#008000", "rgb(0, 128, 0)");
if (ArrayContains(aExpectedValues, val, true))
{
document.getElementById("testresult").innerHTML = "Pass";
return;
}
}
catch(e){}
document.getElementById("testresult").innerHTML = "Fail";
}
</script>
</body>
</html>