OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/testharness.js"></script> |
| 3 <script src="../../../resources/testharnessreport.js"></script> |
| 4 <div id="sample"></div> |
| 5 <div id="log"></div> |
| 6 <script> |
| 7 var moved = false; |
| 8 var sample = document.getElementById('sample'); |
| 9 var range = document.createRange(); |
| 10 range.setStart(sample, 0); |
| 11 range.setEnd(sample, 0); |
| 12 sample.addEventListener('DOMNodeRemoved', function() { |
| 13 if (moved) |
| 14 return; |
| 15 moved = true; |
| 16 document.implementation.createDocument('', null).appendChild(sample); |
| 17 }); |
| 18 test(function() { |
| 19 var doc = document.implementation.createDocument('http://www.w3.org/1999/xht
ml', 'html'); |
| 20 try { |
| 21 doc.documentElement.appendChild(sample); |
| 22 } catch (exception) { |
| 23 assert_equals(exception.toString(), 'NotFoundError: Failed to execute \'
appendChild\' on \'Node\': The node to be removed is no longer a child of this n
ode. Perhaps it was moved in response to a mutation?'); |
| 24 } |
| 25 }); |
| 26 </script> |
OLD | NEW |