summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/dom/createElementNS.html
blob: 69989b81ce9a863a246055a48291cf2bf6bbfde1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<html>
<head>
<script>

function debug(str)
{
    document.getElementById('console').appendChild(document.createTextNode(str))
}

function runTest()
{
    if (window.testRunner)
        testRunner.dumpAsText();

    try {
        document.appendChild(document.createElementNS("http://www.w3.org/1999/xhtml", "html"));
        debug("FAILURE: Did not throw exception and should throw node hierarchy error.");
        return;
    } catch (e) {
        if (e.code != 3) {
            debug("FAILURE: Threw an exception with a code other than 3; should throw node hierarchy error.");
            return;
        }
    }

    debug('SUCCESS!')
}

</script>
</head>
<body onload="runTest();">
This tests that a document only supports one document element.
If the test is successful, 'SUCCESS' will be displayed below, otherwise 'FAILURE' and a reason will be displayed.
<pre id="console"></pre>
</body>
</html>