2008-11-04 Anders Carlsson <andersca@apple.com>
[webkit/qt.git] / LayoutTests / fast / dom / createElementNS.html
blobda5261c5edec45a728224c092d6e22d0ce12d363
1 <html>
2 <head>
3 <script>
5 function debug(str)
7 document.getElementById('console').appendChild(document.createTextNode(str))
10 function runTest()
12 if (window.layoutTestController)
13 layoutTestController.dumpAsText();
15 try {
16 document.appendChild(document.createElementNS("http://www.w3.org/1999/xhtml", "html"));
17 debug("FAILURE: Did not throw exception and should throw node hierarchy error.");
18 return;
19 } catch (e) {
20 if (e.code != 3) {
21 debug("FAILURE: Threw an exception with a code other than 3; should throw node hierarchy error.");
22 return;
26 debug('SUCCESS!')
29 </script>
30 </head>
31 <body onload="runTest();">
32 This tests that a document only supports one document element.
33 If the test is successful, 'SUCCESS' will be displayed below, otherwise 'FAILURE' and a reason will be displayed.
34 <pre id="console"></pre>
35 </body>
36 </html>