diff options
Diffstat (limited to 'third_party/WebKit/LayoutTests/fast/media/mq-js-media-except-02.html')
-rw-r--r-- | third_party/WebKit/LayoutTests/fast/media/mq-js-media-except-02.html | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/third_party/WebKit/LayoutTests/fast/media/mq-js-media-except-02.html b/third_party/WebKit/LayoutTests/fast/media/mq-js-media-except-02.html new file mode 100644 index 0000000..657c98e --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/media/mq-js-media-except-02.html @@ -0,0 +1,38 @@ +<html> +<head> +<title>CSS3 media query test: @media css rule media.mediaText property parsing, media query syntax error should be handled correctly.</title> +<link rel="help" href="http://www.w3.org/TR/CSS21/media.html" /> + +<style type="text/css"> +p#result {color: green} + +@media not screen { +/* query will be modified from javascript */ +/* the manipulation contains syntax error, and should fail */ +p#result {color: red} +} + +@media screen and resolution > 40dpi { +/* media query with syntax error should fail */ +/* corresponding DOM manipulation will fail */ +p#result {color: red} +} +</style> +<script language="javascript"> +function test() { + try { + // this should throw + document.styleSheets[0].cssRules[1].media.mediaText = "screen and resolution > 40dpi"; + } catch (e) { + document.getElementById("result").innerHTML = "This text should be green."; + document.getElementById("details").innerHTML = "Caught exception: " + e; + } +} +</script> + +</head> +<body onload="test()"> +<p id="result">Failure: test not run</p> +<p id="details"></p> +</body> +</html> |