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

Side by Side Diff: LayoutTests/fast/dom/ParentNode/append.html

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, 6 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 <!DOCTYPE html>
2 <script src="../../../resources/testharness.js"></script>
3 <script src="../../../resources/testharnessreport.js"></script>
4 <script>
5
6 test(function() {
7 var node = document.createElement('node');
8 assert_true('append' in node);
9 assert_equals(typeof node.append, 'function');
10 assert_equals(node.append.length, 0);
11 }, "Element should support append()");
12
13 test(function() {
14 var parent = document.createElement('div');
15 var test = document.createElement('test');
16 parent.appendChild(test);
17 var x = document.createElement('x');
18 var z = document.createElement('z');
19
20 parent.append(x, 'y', z);
21
22 assert_equals(parent.childNodes.length, 4, 'parent should have 4 children');
23 assert_equals(parent.firstChild, test, 'parent\'s first child should be test') ;
24 assert_equals(parent.childNodes[1], x, 'parent\'s second child should be x');
25 assert_equals(parent.childNodes[2].data, 'y', 'parent\'s third child should be "y"');
26 assert_equals(parent.lastChild, z, 'parent\'s last child should be z');
27 }, "append() should work for Element");
28 </script>
29 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698