| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <title>Node.insertBefore</title> | 2 <title>Node.insertBefore</title> |
| 3 <script src="../../../../resources/testharness.js"></script> | 3 <script src="/resources/testharness.js"></script> |
| 4 <script src="../../../../resources/testharnessreport.js"></script> | 4 <script src="/resources/testharnessreport.js"></script> |
| 5 <div id="log"></div> | 5 <div id="log"></div> |
| 6 <script> | 6 <script> |
| 7 function testLeafNode(nodeName, createNodeFunction) { | 7 function testLeafNode(nodeName, createNodeFunction) { |
| 8 test(function() { | 8 test(function() { |
| 9 var node = createNodeFunction(); | 9 var node = createNodeFunction(); |
| 10 assert_throws(new TypeError(), function() { node.insertBefore(null, null) }) | 10 assert_throws(new TypeError(), function() { node.insertBefore(null, null) }) |
| 11 }, "Calling insertBefore with a non-Node first argument on a leaf node " + nod
eName + " must throw TypeError.") | 11 }, "Calling insertBefore with a non-Node first argument on a leaf node " + nod
eName + " must throw TypeError.") |
| 12 test(function() { | 12 test(function() { |
| 13 var node = createNodeFunction(); | 13 var node = createNodeFunction(); |
| 14 assert_throws("HIERARCHY_REQUEST_ERR", function() { node.insertBefore(docume
nt.createTextNode("fail"), null) }) | 14 assert_throws("HIERARCHY_REQUEST_ERR", function() { node.insertBefore(docume
nt.createTextNode("fail"), null) }) |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 var c = document.createElement("div"); | 297 var c = document.createElement("div"); |
| 298 a.appendChild(b); | 298 a.appendChild(b); |
| 299 a.appendChild(c); | 299 a.appendChild(c); |
| 300 assert_array_equals(a.childNodes, [b, c]); | 300 assert_array_equals(a.childNodes, [b, c]); |
| 301 assert_equals(a.insertBefore(b, b), b); | 301 assert_equals(a.insertBefore(b, b), b); |
| 302 assert_array_equals(a.childNodes, [b, c]); | 302 assert_array_equals(a.childNodes, [b, c]); |
| 303 assert_equals(a.insertBefore(c, c), c); | 303 assert_equals(a.insertBefore(c, c), c); |
| 304 assert_array_equals(a.childNodes, [b, c]); | 304 assert_array_equals(a.childNodes, [b, c]); |
| 305 }, "Inserting a node before itself should not move the node"); | 305 }, "Inserting a node before itself should not move the node"); |
| 306 </script> | 306 </script> |
| OLD | NEW |