| Index: LayoutTests/fast/dom/script-tests/parentnode-prepend.js
|
| diff --git a/LayoutTests/fast/dom/script-tests/parentnode-prepend.js b/LayoutTests/fast/dom/script-tests/parentnode-prepend.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..64e00392ee66d8979b02e5810ca99dcf36ce7547
|
| --- /dev/null
|
| +++ b/LayoutTests/fast/dom/script-tests/parentnode-prepend.js
|
| @@ -0,0 +1,29 @@
|
| +function testPrepend(node, parent, type) {
|
| +test(function() {
|
| +assert_true("prepend" in parent);
|
| +assert_equals(typeof parent.prepend, "function");
|
| +assert_equals(parent.prepend.length, 0);
|
| +}, type + " should support prepend()");
|
| +test(function() {
|
| +var x, y;
|
| +if (type == 'element' || type == 'document-fragment' || type == 'document') {
|
| + x = document.createElement('x');
|
| + y = document.createElement('y');
|
| +}
|
| +if (type == 'comment') {
|
| + x = document.createComment('x');
|
| + y = document.createComment('y');
|
| +}
|
| +if (type == 'text') {
|
| + x = document.createTextNode('x');
|
| + y = document.createTextNode('y');
|
| +}
|
| +parent.appendChild(node);
|
| +assert_equals(node.parentNode, parent, "Appended node should have a parent");
|
| +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[2].data, 'z', "Parent's third child's data should be z");
|
| +assert_equals(parent.lastChild, node, "Parent's last child should be node");
|
| +}, "prepend() should work for " + type);
|
| +}
|
|
|