Refactoring: Pull all fullscreen code out of Document and into its own helper class
[WebKit-https.git] / LayoutTests / traversal / exception-forwarding.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../resources/js-test-pre.js"></script>
5 </head>
6 <body>
7 <script>
8 description("Test of exception forwarding for NodeIterator and TreeWalker, derived from an early version of Acid3");
9
10 var iteration = 0;
11 function test(node)
12 {
13     iteration += 1;
14     switch (iteration) {
15         case 1: case 3: case 4: case 6: case 7: case 8: case 9: case 12: throw "Roses";
16         case 2: case 5: case 10: case 11: return true;
17         default: throw 0;
18     }
19 }
20
21 var i = document.createNodeIterator(document.documentElement, 0xFFFFFFFF, test, true);
22 shouldThrow("i.nextNode()"); // 1
23 shouldBe("i.nextNode()", "document.documentElement"); // 2
24 shouldThrow("i.previousNode()"); // 3
25 var w = document.createTreeWalker(document.documentElement, 0xFFFFFFFF, test, true);
26 shouldThrow("w.nextNode()"); // 4
27 shouldBe("w.nextNode()", "document.documentElement.firstChild"); // 5
28 shouldThrow("w.previousNode()"); // 6
29 shouldThrow("w.firstChild()"); // 7
30 shouldThrow("w.lastChild()"); // 8
31 shouldThrow("w.nextSibling()"); // 9
32 shouldBe("w.previousSibling()", "null");
33 shouldBe("w.nextSibling()", "document.body.previousSibling"); // 10
34 shouldBe("w.previousSibling()", "document.head"); // 11
35 shouldBe("iteration", "11");
36
37 var successfullyParsed = true;
38 </script>
39 <script src="../resources/js-test-post.js"></script>
40 </body>
41 </html>