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

Side by Side Diff: LayoutTests/fast/dom/script-tests/childnode-after.js

Issue 1085843002: Implement DOM: prepend, append, before, after & replaceWith (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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
OLDNEW
(Empty)
1 function testAfter(node, parent, type) {
2 test(function() {
3 assert_true("after" in node);
4 assert_equals(typeof node.after, "function");
5 assert_equals(node.after.length, 0);
6 }, type + " should support after()");
7 test(function() {
8 var x, y;
9 if (type == 'element' || type == 'document-fragment') {
10 x = document.createElement('x');
11 y = document.createElement('y');
12 }
13 if (type == 'comment') {
14 x = document.createComment('x');
15 y = document.createComment('y');
16 }
17 if (type == 'text') {
18 x = document.createTextNode('x');
19 y = document.createTextNode('y');
20 }
21 parent.appendChild(node);
22 assert_equals(node.parentNode, parent, "Appended node should have a parent");
23 node.after(x, y, 'z');
24 assert_equals(parent.childNodes.length, 4, "Parent should have 4 children");
25 assert_equals(parent.firstChild, node, "Parent's first child should be node");
26 assert_equals(parent.childNodes[1], x, "Parent's second child should be x");
27 assert_equals(parent.lastChild.data, 'z', "Parent's last child's data should be z");
28 }, "after() should work for " + type);
29 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698