Index: LayoutTests/fast/dom/ParentNode/prepend.html |
diff --git a/LayoutTests/fast/dom/ParentNode/prepend.html b/LayoutTests/fast/dom/ParentNode/prepend.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5773438cc5da8478be6236883d94ef306ae3dda0 |
--- /dev/null |
+++ b/LayoutTests/fast/dom/ParentNode/prepend.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('prepend' in node); |
+ assert_equals(typeof node.prepend, 'function'); |
+ assert_equals(node.prepend.length, 0); |
+}, "Element should support prepend()"); |
+ |
+test(function() { |
+ var parent = document.createElement('div'); |
+ var test = document.createComment('test'); |
+ parent.appendChild(test); |
+ var x = document.createElement('x'); |
+ var z = document.createElement('z'); |
+ |
+ parent.prepend(x, 'y', z); |
+ |
+ assert_equals(parent.childNodes.length, 4, 'parent should have 4 children'); |
+ assert_equals(parent.firstChild, x, 'parent\'s first child should be x'); |
+ assert_equals(parent.childNodes[1].data, 'y', 'parent\'s second child should be "y"'); |
+ assert_equals(parent.childNodes[2], z, 'parent\'s third child should be z'); |
+ assert_equals(parent.lastChild, test, 'parent\'s last child should be test'); |
+}, "prepend() should work for Element"); |
+</script> |
+</html> |