Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/cssom/delete-namespace-rule-when-child-rule-exists.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>Deleting a @namespace rule when list contains anything other than @import or @namespace rules should throw InvalidStateError.</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
@namespace a url();
</style>
<script>
test(function () {
let styleSheet = document.styleSheets[0];
styleSheet.cssRules[0];
styleSheet.insertRule(`b {}`, 1);
assert_throws_dom("InvalidStateError", () => styleSheet.deleteRule(0));
}, "Deleting a @namespace rule when list contains anything other than @import or @namespace rules should throw InvalidStateError.");
</script>