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

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

Issue 1234813003: Revert of Implement DOM: prepend, append, before, after & replaceWith (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 5 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 function test_append_on_Document() {
7
8 var node = document.implementation.createDocument(null, null);
9 test(function() {
10 var parent = node.cloneNode();
11 parent.append();
12 assert_array_equals(parent.childNodes, []);
13 }, 'Document.append() without any argument, on a Document having no child.') ;
14
15 test(function() {
16 var parent = node.cloneNode();
17 var x = document.createElement('x');
18 parent.append(x);
19 assert_array_equals(parent.childNodes, [x]);
20 }, 'Document.append() with only one element as an argument, on a Document ha ving no child.');
21
22 test(function() {
23 var parent = node.cloneNode();
24 var x = document.createElement('x');
25 var y = document.createElement('y');
26 parent.appendChild(x);
27 assert_throws('HierarchyRequestError', function() { parent.append(y); }) ;
28 assert_array_equals(parent.childNodes, [x]);
29 }, 'Document.append() with only one element as an argument, on a Document ha ving one child.');
30
31 test(function() {
32 var parent = node.cloneNode();
33 assert_throws('HierarchyRequestError', function() { parent.append('text' ); });
34 assert_array_equals(parent.childNodes, []);
35 }, 'Document.append() with text as an argument, on a Document having no chil d.');
36
37 test(function() {
38 var parent = node.cloneNode();
39 var x = document.createElement('x');
40 var y = document.createElement('y');
41 assert_throws('HierarchyRequestError', function() { parent.append(x, y); });
42 assert_array_equals(parent.childNodes, []);
43 }, 'Document.append() with two elements as the argument, on a Document havin g no child.');
44
45 }
46
47 test_append_on_Document();
48
49 </script>
50 </html>
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/ParentNode/append.html ('k') | LayoutTests/fast/dom/ParentNode/prepend.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698