blob: 3b61a5a5641e367283641df8857bcc51434f2d10 [file] [log] [blame]
<title>CSS3 media query test: stylesheet media.appendMedium</title>
<link rel="help" href="" />
<link rel="help" href="" />
<style type="text/css" media="braille, not screen">
p { color: green }
<script language="javascript">
function test() {
var re = document.getElementById("result");
var media = document.styleSheets[0].media;
media.appendMedium("screen and (color)");
media.appendMedium("not screen");
var first = true;
for (var i = 0; i < media.length; ++i) {
if (!first) re.innerHTML += ", " + media.item(i);
else re.innerHTML = media.item(i);
first = false;
<body onload="test()">
<!-- FIXME: NOTE! This will fail until dynamic setting of media property causes style recalculation.
This is not the case currently (24.07.2005)
<p> This text should be green and below should read "braille, not screen, screen and (color)". </p>
<p id="result">Failure: test not run</p>