summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/dom/dom-instanceof.html
blob: 1d76df7db65b36f1ee5b056c9cdc06b2cfd4d4b7 (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
37
38
39
<html>
<head>
<title>DOM instanceof</title>
<script>
function print(message, color) 
{
    var paragraph = document.createElement("div");
    paragraph.appendChild(document.createTextNode(message));
    paragraph.style.fontFamily = "monospace";
    if (color)
        paragraph.style.color = color;
    document.getElementById("console").appendChild(paragraph);
}

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

    if(document.getElementById("console") instanceof Element)
        print("PASS", "green");
    else
        print("Failed", "red");
}

</script>
</head>
<body>
<p>This page tests to make sure instanceof operator for DOM nodes works properly.</p>
<p>If the test passes, you'll see a single 'PASS' message below.</p>
<hr>

<div id='console'></div>

<script>
test();
</script>
</body>
</html>