summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/cssom/delete-namespace-rule-when-child-rule-exists.html
blob: 5118b67cd1c2cc141645bbd66f34538ec79551f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<!DOCTYPE html>
<title>Deleting a @namespace rule when list contains anything other than @import or @namespace rules should throw InvalidStateError.</title>
<link rel="help" href="https://drafts.csswg.org/cssom-1/#remove-a-css-rule">
<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>