summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/dom/DOMImplementation/implementation-identity.html
blob: 2b3c56c13353b2ca6cc620ce2c08f272b47a7e8f (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
<body>
<script>
if (window.layoutTestController)
    layoutTestController.dumpAsText();

function print(message)
{
    var paragraph = document.createElement("li");
    paragraph.appendChild(document.createTextNode(message));
    document.getElementById("console").appendChild(paragraph);
}

function test()
{
    if (document.implementation != frames[0].document.implementation)
        print("OK: Top-level document and iframe document have different DOMImplementation objects");
    else
        print("BUG: Top-level document and iframe document share a DOMImplementation object");

    if (document.implementation === document.implementation)
        print("OK: DOMImplementation object is cached");
    else
        print("BUG: DOMImplementation object is not cached");
}
</script>
<p>This test checks that DOMImplementation object is created per document.</p>
<p>If the test passes, you should see a few OK lines below.</p>
<p><ol id=console></ol></p>
<iframe src="about:blank" onload="test()"></iframe>
</body>