Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / media-rule-dyn.html
bloba6bdc75b37b5bc47e130fd3951a18cb19cbff790
1 <html>
2 <head>
3 <style id="style1">
4 @media all { .test { color: green; } }
5 </style>
6 <script>
7 function runTest() {
8 if (window.testRunner)
9 testRunner.dumpAsText();
11 var styleSheet = document.getElementById('style1').sheet;
12 var mediaRule = styleSheet.cssRules[0];
14 try {
15 var index = mediaRule.insertRule("p {color: red; }", 0);
16 if (mediaRule.cssRules.length == 2) {
17 mediaRule.deleteRule(0);
18 if (mediaRule.cssRules.length == 1)
19 document.getElementById('result').innerHTML = 'SUCCESS';
21 } catch (e) {
22 document.getElementById('result').innerHTML = 'EXCEPTION';
25 </script>
26 </head>
27 <body onload="runTest();">
28 <div id="result">FAILURE</div>
29 </body>
30 </html>