Tizen 2.1 base
[framework/web/webkit-efl.git] / LayoutTests / traversal / node-iterator-prototype.html
1 <html> 
2 <body>
3 <p>This test checks whether DOM wrappers created by NodeIterator have their
4 prototypes attached to the correct objects.  These nodes are from the child
5 frame, so that's where their prototypes should be attached.</p>
6
7 <p>Unfortunately, our implementation is buggy and we get wrappers from the
8 parent frame here.  This test documents the bug so we'll know when we fix
9 it.</p>
10 <div id="console"></div>
11 <script>
12 if (window.testRunner)
13     testRunner.dumpAsText();
14
15 Node.prototype.foo = "parent";
16
17 function logNode(node) {
18     var result = node.foo == "child" ? "PASS" : "FAIL";
19     document.getElementById("console").innerHTML += node.id + ": " + node.foo + " " + result + "<br>"
20 }
21
22 function runTest() {
23     var it = frames[0].it;
24     logNode(it.nextNode());
25     logNode(it.nextNode());
26     logNode(it.nextNode());
27     logNode(it.nextNode());
28     logNode(it.nextNode());
29     logNode(it.previousNode());
30 }
31 </script>
32 <iframe onload="runTest();" src="resources/node-iterator-prototype-frame.html"></iframe>
33 </body>
34 </html>