delete-namespace-rule-when-child-rule-exists.html (742B)
1 <!DOCTYPE html> 2 <title>Deleting a @namespace rule when list contains anything other than @import or @namespace rules should throw InvalidStateError.</title> 3 <link rel="help" href="https://drafts.csswg.org/cssom-1/#remove-a-css-rule"> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <style> 7 @namespace a url(); 8 </style> 9 <script> 10 test(function () { 11 let styleSheet = document.styleSheets[0]; 12 styleSheet.cssRules[0]; 13 styleSheet.insertRule(`b {}`, 1); 14 assert_throws_dom("InvalidStateError", () => styleSheet.deleteRule(0)); 15 }, "Deleting a @namespace rule when list contains anything other than @import or @namespace rules should throw InvalidStateError."); 16 </script>