blob: c4d6f8639e887f2cb728b92fbac33a3a712ef93b [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<script src="../../resources/js-test-pre.js"></script>
<script>
description("Tests that the parameters to CSSStyleSheet.insertRule() / deleteRule() are mandatory.");
var styleElement = document.createElement("style");
document.head.appendChild(styleElement);
var stylesheet = styleElement.sheet;
shouldBe("stylesheet.__proto__", "CSSStyleSheet.prototype");
shouldThrow("stylesheet.deleteRule()", "'TypeError: Not enough arguments'");
shouldThrow("stylesheet.insertRule()", "'TypeError: Not enough arguments'");
shouldBe("stylesheet.rules.length", "0");
shouldNotThrow("stylesheet.insertRule('body { margin: 0; }')");
shouldBe("stylesheet.rules.length", "1");
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>