3 <title>CSS3 media query test: @media css rule media.mediaText property parsing, media query syntax error should be handled correctly (,,,,).</title>
4 <link rel="help" href="http://www.w3.org/TR/CSS21/media.html" />
5 <link rel="help" href="http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSMediaRule" />
6 <!-- this test shows slight disconnect between css media queries and html4 media descriptors -->
7 <style type="text/css">
8 p#result {color: green}
11 /* query will be modified from javascript */
12 /* the manipulation contains syntax error, and should fail */
17 <script language="javascript">
20 // this shouldn't throw
21 document.styleSheets[0].media.mediaText = ",,,,";
23 document.getElementById("result").innerHTML = "Failure. ,,,, should be valid media descriptor.";
24 document.getElementById("details").innerHTML = "Caught exception: " + e;
29 document.styleSheets[0].cssRules[1].media.mediaText = ",,,,";
30 document.getElementById("result").innerHTML = "Failure. No exception thrown.";
32 document.getElementById("result").innerHTML = "Success. This text should be green.";
33 document.getElementById("details").innerHTML = "Caught exception: " + e;
39 <body onload="test()">
40 <p id="result">Failure: test not run</p>
41 <p id="details">aaa</p>