Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Side by Side Diff: LayoutTests/fast/dom/node-iterator-with-doctype-root.html

Issue 22880019: [DOM4] Doctypes now always have a node document and can be moved across document boundaries (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Improve tests Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../js/resources/js-test-pre.js"></script> 3 <script src="../js/resources/js-test-pre.js"></script>
4 </head> 4 </head>
5 <body> 5 <body>
6 <script> 6 <script>
7 var dt = document.implementation.createDocumentType("foo", "", ""); 7 var dt = document.implementation.createDocumentType("foo", "", "");
8 var iter = document.createNodeIterator(dt, NodeFilter.SHOW_ALL, null, true); 8 var iter = document.createNodeIterator(dt, NodeFilter.SHOW_ALL, null, true);
9 debug("NodeIterator rooted at a DocumentType node not yet associated with a docu ment:"); 9 debug("NodeIterator rooted at a DocumentType node not yet associated with a docu ment:");
10 shouldBe('iter.referenceNode.ownerDocument', 'null'); 10 shouldBe('iter.referenceNode.ownerDocument', 'document');
11 shouldBe('iter.nextNode()', 'dt'); 11 shouldBe('iter.nextNode()', 'dt');
12 shouldBe('iter.nextNode()', 'null'); 12 shouldBe('iter.nextNode()', 'null');
13 shouldBe('iter.previousNode()', 'dt'); 13 shouldBe('iter.previousNode()', 'dt');
14 shouldBe('iter.previousNode()', 'null'); 14 shouldBe('iter.previousNode()', 'null');
15 iter.detach(); 15 iter.detach();
16 16
17 iter = document.createNodeIterator(dt, NodeFilter.SHOW_ALL, null, true); 17 iter = document.createNodeIterator(dt, NodeFilter.SHOW_ALL, null, true);
18 var d = document.implementation.createDocument(null, "doc", dt); 18 var d = document.implementation.createDocument(null, "doc", dt);
19 debug("\nNodeIterator rooted at a DocumentType node that becomes used by a docum ent after the iterator has been created:"); 19 debug("\nNodeIterator rooted at a DocumentType node that becomes used by a docum ent after the iterator has been created:");
20 shouldBe('iter.nextNode()', 'dt'); 20 shouldBe('iter.nextNode()', 'dt');
21 shouldBe('iter.previousNode()', 'dt'); 21 shouldBe('iter.previousNode()', 'dt');
22 debug("..and after removing it from the document:"); 22 debug("..and after removing it from the document:");
23 d.removeChild(dt); 23 d.removeChild(dt);
24 shouldBe('iter.nextNode()', 'dt'); 24 shouldBe('iter.nextNode()', 'dt');
25 shouldBe('iter.previousNode()', 'dt'); 25 shouldBe('iter.previousNode()', 'dt');
26 iter.detach(); 26 iter.detach();
27 </script> 27 </script>
28 <script src="../js/resources/js-test-post.js"></script> 28 <script src="../js/resources/js-test-post.js"></script>
29 </body> 29 </body>
30 </html> 30 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698