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">
7 <!-- this test shows there there is no disconnect between CSS media queries and HTML5 media descriptors -->
8 <style type=
"text/css">
10 p#result
{ color: red
}
13 /* query will be modified from javascript */
14 /* the manipulation contains syntax error, and should fail */
15 p#result
{ color: red
}
22 // This shouldn't throw.
23 document
.styleSheets
[0].media
.mediaText
= ",,,,";
24 document
.getElementById("result").innerHTML
= "Success. This text should not be red.";
26 document
.getElementById("result").innerHTML
= "Failure. ,,,, should be valid media descriptor.";
27 document
.getElementById("details").innerHTML
= "Caught exception: " + e
;
31 // This shouldn't throw.
32 document
.styleSheets
[0].cssRules
[1].media
.mediaText
= ",,,,";
33 document
.getElementById("result").innerHTML
= "Success. This text should not be red.";
35 document
.getElementById("result").innerHTML
= "Failure. Exception thrown.";
36 document
.getElementById("details").innerHTML
= "Caught exception: " + e
;
42 <body onload=
"test()">
43 <p id=
"result">Failure: test not run
</p>