Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / media / mq-js-stylesheet-media-03.html
blob3b61a5a5641e367283641df8857bcc51434f2d10
1 <html>
2 <head>
3 <title>CSS3 media query test: stylesheet media.appendMedium</title>
4 <link rel="help" href="http://www.w3.org/TR/css3-mediaqueries/#syntax" />
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">
7 p { color: green }
8 </style>
10 <script language="javascript">
11 function test() {
12 var re = document.getElementById("result");
13 var media = document.styleSheets[0].media;
14 media.appendMedium("screen and (color)");
15 media.appendMedium("not screen");
16 var first = true;
17 for (var i = 0; i < media.length; ++i) {
18 if (!first) re.innerHTML += ", " + media.item(i);
19 else re.innerHTML = media.item(i);
20 first = false;
24 </script>
26 </head>
27 <body onload="test()">
28 <!-- FIXME: NOTE! This will fail until dynamic setting of media property causes style recalculation.
29 This is not the case currently (24.07.2005)
30 -->
31 <p> This text should be green and below should read "braille, not screen, screen and (color)". </p>
32 <p id="result">Failure: test not run</p>
33 </body>
34 </html>