| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/testharness.js"></script> | 2 <script src="../../../resources/testharness.js"></script> |
| 3 <script src="../../../resources/testharnessreport.js"></script> | 3 <script src="../../../resources/testharnessreport.js"></script> |
| 4 <script> | 4 <script> |
| 5 | 5 |
| 6 test(function () { | 6 test(function () { |
| 7 var node = document.createElement('div'); | 7 var node = document.createElement('div'); |
| 8 assert_true('append' in node); | 8 assert_true('append' in node); |
| 9 var append = 'mine'; | 9 var append = 'mine'; |
| 10 var getAttribute = 'mine'; | 10 var getAttribute = 'mine'; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 test(function() { | 72 test(function() { |
| 73 var parent = node.cloneNode(); | 73 var parent = node.cloneNode(); |
| 74 var x = document.createElement('x'); | 74 var x = document.createElement('x'); |
| 75 var child = document.createElement('test'); | 75 var child = document.createElement('test'); |
| 76 parent.appendChild(child); | 76 parent.appendChild(child); |
| 77 parent.append(x, 'text'); | 77 parent.append(x, 'text'); |
| 78 assert_equals(parent.childNodes[0], child); | 78 assert_equals(parent.childNodes[0], child); |
| 79 assert_equals(parent.childNodes[1], x); | 79 assert_equals(parent.childNodes[1], x); |
| 80 assert_equals(parent.childNodes[2].textContent, 'text'); | 80 assert_equals(parent.childNodes[2].textContent, 'text'); |
| 81 }, nodeName + '.append() with one element and text as argument, on a parent
having a child.'); | 81 }, nodeName + '.append() with one element and text as argument, on a parent
having a child.'); |
| 82 |
| 83 test(function() { |
| 84 var parent = node.cloneNode(); |
| 85 var doc2 = document.implementation.createDocument("http://www.w3.org/199
9/xhtml", "html"); |
| 86 assert_throws('HierarchyRequestError', () => { parent.append(doc2, "foo"
) }); |
| 87 assert_equals(parent.firstChild, null); |
| 88 }, nodeName + '.append() with a Document as an argument should throw.'); |
| 82 } | 89 } |
| 83 | 90 |
| 84 test_append(document.createElement('div'), 'Element'); | 91 test_append(document.createElement('div'), 'Element'); |
| 85 test_append(document.createDocumentFragment(), 'DocumentFrgment'); | 92 test_append(document.createDocumentFragment(), 'DocumentFrgment'); |
| 86 </script> | 93 </script> |
| 87 </html> | 94 </html> |
| OLD | NEW |