innerhtml-01.xhtml (1139B)
1 <html xmlns="http://www.w3.org/1999/xhtml"> 2 <head> 3 <title>innerHTML in XHTML: getting while the document is in an invalid state</title> 4 <link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/> 5 <link rel="help" href="https://w3c.github.io/DOM-Parsing/#widl-Element-innerHTML"/> 6 <link rel="help" href="http://www.whatwg.org/html5/#xml-fragment-serialization-algorithm"/> 7 <link rel="help" href="http://www.whatwg.org/html5/#document.title"/> 8 <script src="/resources/testharness.js"></script> 9 <script src="/resources/testharnessreport.js"></script> 10 </head> 11 <body> 12 <div id="log"></div> 13 <script> 14 test(function() { 15 document.documentElement.appendChild(document.createElement("test:test")); 16 assert_throws_dom("INVALID_STATE_ERR", function() { 17 document.documentElement.innerHTML; 18 }, "getting element with \":\" in its local name"); 19 }); 20 test(function() { 21 document.title = "\f"; 22 assert_throws_dom("INVALID_STATE_ERR", function() { 23 document.getElementsByTagName("title")[0].innerHTML; 24 }, "Getting a Text node whose data contains characters that are not matched by the XML Char production"); 25 }); 26 </script> 27 </body> 28 </html>