test_bug564047.html (851B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=564047 5 --> 6 <head> 7 <title>Test for Bug 564047</title> 8 <script src="/tests/SimpleTest/SimpleTest.js"></script> 9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 10 </head> 11 <body> 12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=564047">Mozilla Bug 564047</a> 13 <p id="display"></p> 14 <div id="content" style="display: none"> 15 16 </div> 17 <pre id="test"> 18 <script type="application/javascript"> 19 /** Test for Bug 564047 */ 20 try { 21 document.doctype.appendChild(document.createTextNode("test")); 22 ok(false, "Should have thrown an exception"); 23 } catch (e) { 24 is(e.name, "HierarchyRequestError"); 25 ok(e instanceof DOMException, "Should be a DOMException"); 26 is(e.code, DOMException.HIERARCHY_REQUEST_ERR); 27 } 28 </script> 29 </pre> 30 </body> 31 </html>