<html>
<head>

<script>
    function runTest() {
		if (window.testRunner)
	    	    testRunner.dumpAsText();

		var element = document.getElementById("styled");
		var computedColor = window.getComputedStyle(element).backgroundColor;

		if (computedColor === "rgb(0, 128, 0)")
		    document.getElementById("result").textContent = "SUCCESS";
		else
		    document.getElementById("result").textContent = "FAILURE " + computedColor;
    }
</script>

<style>
	@media {
		body { background-color: green; }
		.foo background-color: red; }
	}
</style>		
</head>
<body onload="runTest();" id="styled">
	<div>Background should be green.</div>
	<div id="result"></div>
</body>
