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

Side by Side Diff: LayoutTests/fast/dom/script-tests/childnode-replace-with.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 testReplaceWith(node, parent, type) {
2 test(function() {
3 assert_true("replaceWith" in node);
4 assert_equals(typeof node.replaceWith, "function");
5 assert_equals(node.replaceWith.length, 0);
6 }, type + " should support replaceWith()");
7 test(function() {
8 var x;
9 if (type == 'element' || type == 'document-fragment') {
10 x = document.createElement('x');
11 }
12 if (type == 'comment') {
13 x = document.createComment('x');
14 }
15 if (type == 'text') {
16 x = document.createTextNode('x');
17 }
18 parent.appendChild(node);
19 assert_equals(node.parentNode, parent, "Appended node should have a parent");
20 assert_array_equals(parentNode.childNodes, [node], "ParentNode should have 1 chi ld node");
21 node.replaceWith(x);
22 assert_array_equals(parentNode.childNodes, [x], "ParentNode should have 1 child x");
23 }, "replaceWith() should work for " + type);
24 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698