3 <title>CSS3 media query test: stylesheet media deleteMedium
</title>
4 <link rel=
"help" href=
"http://www.w3.org/TR/css3-mediaqueries/" />
5 <link rel=
"help" href=
"http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html" />
6 <style type=
"text/css" media=
"braille, not screen">
10 <script language=
"javascript">
12 var re
= document
.getElementById("result");
13 var media
= document
.styleSheets
[0].media
;
14 media
.appendMedium("screen and (color)");
15 while (media
.length
) {
16 media
.deleteMedium(media
.item(0));
18 re
.innerHTML
= "media list is empty"
20 for (var i
= 0; i
< media
.length
; ++i
) {
21 if (!first
) re
.innerHTML
+= ", " + media
.item(i
);
22 else re
.innerHTML
= media
.item(i
);
29 <body onload=
"test()">
30 <!-- FIXME: NOTE! This will fail until dynamic setting of media property causes style recalculation.
31 This is not the case currently (24.07.2005)
33 <p> This text should be green and below should read
"media list is empty".
</p>
34 <p id=
"result">Failure: test not run
</p>
35 <p> Expected to fail (
24.7.2005)
</p>