blob: 94a78dde0c7af74788d0da8f2cf849ef55b16c83 [file] [log] [blame]
<html>
<head>
<style id="style1">
@media all { .test { color: green; } }
</style>
<script>
function runTest() {
if (window.layoutTestController)
layoutTestController.dumpAsText();
var styleSheet = document.getElementById('style1').sheet;
var mediaRule = styleSheet.cssRules[0];
try {
var index = mediaRule.insertRule("p {color: red; }", 0);
if (mediaRule.cssRules.length == 2) {
mediaRule.deleteRule(0);
if (mediaRule.cssRules.length == 1)
document.getElementById('result').innerHTML = 'SUCCESS';
}
} catch (e) {
document.getElementById('result').innerHTML = 'EXCEPTION';
}
}
</script>
</head>
<body onload="runTest();">
<div id="result">FAILURE</div>
</body>
</html>