Index: LayoutTests/fast/dom/ParentNode/append.html |
diff --git a/LayoutTests/fast/dom/ParentNode/append.html b/LayoutTests/fast/dom/ParentNode/append.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5649dbb3f4d6c389726662cbb01bd24e39257a1b |
--- /dev/null |
+++ b/LayoutTests/fast/dom/ParentNode/append.html |
@@ -0,0 +1,29 @@ |
+<!DOCTYPE html> |
+<script src="../../../resources/testharness.js"></script> |
+<script src="../../../resources/testharnessreport.js"></script> |
+<script> |
+ |
+test(function() { |
+ var node = document.createElement('node'); |
+ assert_true('append' in node); |
+ assert_equals(typeof node.append, 'function'); |
+ assert_equals(node.append.length, 0); |
+}, "Element should support append()"); |
+ |
+test(function() { |
+ var parent = document.createElement('div'); |
+ var test = document.createElement('test'); |
+ parent.appendChild(test); |
+ var x = document.createElement('x'); |
+ var z = document.createElement('z'); |
+ |
+ parent.append(x, 'y', z); |
+ |
+ assert_equals(parent.childNodes.length, 4, 'parent should have 4 children'); |
+ assert_equals(parent.firstChild, test, 'parent\'s first child should be test'); |
+ assert_equals(parent.childNodes[1], x, 'parent\'s second child should be x'); |
+ assert_equals(parent.childNodes[2].data, 'y', 'parent\'s third child should be "y"'); |
+ assert_equals(parent.lastChild, z, 'parent\'s last child should be z'); |
+}, "append() should work for Element"); |
+</script> |
+</html> |