Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / traversal / stay-within-root.html
blob3e6483f9fbb4ef20e1e0eed34314d87f4590977c
1 <html>
2 <head>
3 <script language="JavaScript">
4 if (window.testRunner)
5 testRunner.dumpAsText();
7 function log(message) {
8 var console = document.getElementById("console");
9 var li = document.createElement("li");
10 var text = document.createTextNode(message);
11 li.appendChild(text);
12 console.appendChild(li);
15 function iteratorTest() {
16 log("NodeIterator: testing nextNode() (5 should be null)");
17 var iterator = document.createNodeIterator(divB, NodeFilter.SHOW_ELEMENT, null, false);
18 iterator.root = divB;
19 for (i=0; i < 4; i++)
20 log(iterator.nextNode());
22 log("NodeIterator: testing previousNode() (7 should be null)");
23 iterator = document.createNodeIterator(divB, NodeFilter.SHOW_ELEMENT, null, false);
24 log(iterator.previousNode());
26 log("TreeWalker: testing nextNode() (11 should be null)");
27 iterator = document.createTreeWalker(divB, NodeFilter.SHOW_ELEMENT, null, false);
28 for (i=0; i < 3; i++)
29 log(iterator.nextNode());
31 log("TreeWalker: testing previousNode() (13 should be null)");
32 iterator = document.createTreeWalker(divB, NodeFilter.SHOW_ELEMENT, null, false);
33 log(iterator.previousNode());
35 </script>
36 </head>
38 <body>
39 <div id="divA">
40 This test checks that the NodeIterator and TreeWalker functions do not go past the root element that they are supposed to stay within.
41 <div id="divB">
42 <div id="divC">
43 </div>
44 <div id="divD">
45 </div>
47 </div>
48 </div>
50 <ol id="console" > </ol>
52 <script>
53 iteratorTest();
54 </script>
56 </body>
58 </html>