| 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 child = document.createElement('p'); | 7 var child = document.createElement('p'); |
| 8 assert_true('before' in child); | 8 assert_true('before' in child); |
| 9 var before = 'mine'; | 9 var before = 'mine'; |
| 10 var getAttribute = 'mine'; | 10 var getAttribute = 'mine'; |
| 11 with (child) { | 11 with (child) { |
| 12 assert_true(before === 'mine'); | 12 assert_true(before === 'mine'); |
| 13 assert_false(getAttribute === 'mine'); | 13 assert_false(getAttribute === 'mine'); |
| 14 } | 14 } |
| 15 assert_true('Symbol' in window); | 15 assert_true('Symbol' in window); |
| 16 var unscopables = Object.getPrototypeOf(child)[Symbol.unscopables]; | 16 var unscopables = Object.getPrototypeOf(child)[Symbol.unscopables]; |
| 17 assert_true(unscopables.before); | 17 assert_true(unscopables.before); |
| 18 }, 'ChildNode.before() unscopeable'); | 18 }, 'ChildNode.before() unscopable'); |
| 19 | 19 |
| 20 function test_before(nodeName) { | 20 function test_before(nodeName) { |
| 21 var child; | 21 var child; |
| 22 var innerHTML; | 22 var innerHTML; |
| 23 if (nodeName == 'Comment') { | 23 if (nodeName == 'Comment') { |
| 24 child = document.createComment('test'); | 24 child = document.createComment('test'); |
| 25 innerHTML = '<!--test-->'; | 25 innerHTML = '<!--test-->'; |
| 26 } else if (nodeName == 'Element') { | 26 } else if (nodeName == 'Element') { |
| 27 child = document.createElement('test'); | 27 child = document.createElement('test'); |
| 28 innerHTML = '<test></test>'; | 28 innerHTML = '<test></test>'; |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 assert_equals(parent.firstChild, child); | 148 assert_equals(parent.firstChild, child); |
| 149 }, nodeName + '.before() with a Document as an argument should throw.'); | 149 }, nodeName + '.before() with a Document as an argument should throw.'); |
| 150 } | 150 } |
| 151 | 151 |
| 152 test_before('Comment'); | 152 test_before('Comment'); |
| 153 test_before('Element'); | 153 test_before('Element'); |
| 154 test_before('Text'); | 154 test_before('Text'); |
| 155 | 155 |
| 156 </script> | 156 </script> |
| 157 </html> | 157 </html> |
| OLD | NEW |