non-html-document.html (801B)
1 <!doctype html> 2 <meta charset=utf-8> 3 <title>Non-HTML document tests</title> 4 <script src=/resources/testharness.js></script> 5 <script src=/resources/testharnessreport.js></script> 6 <script> 7 8 test(function() { 9 let xmldoc = 10 document.implementation.createDocument("http://www.w3.org/1999/xlink", 11 "html", null); 12 for (let f of [ 13 () => xmldoc.execCommand("bold"), 14 () => xmldoc.queryCommandEnabled("bold"), 15 () => xmldoc.queryCommandIndeterm("bold"), 16 () => xmldoc.queryCommandState("bold"), 17 () => xmldoc.queryCommandSupported("bold"), 18 () => xmldoc.queryCommandValue("bold"), 19 ]) { 20 assert_throws_dom("InvalidStateError", f); 21 } 22 }, "editing APIs on an XML document should be disabled"); 23 24 </script>