OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/js-test.js"></script> |
| 3 <body></body> |
| 4 <script> |
| 5 description('Test case that a MutationObserver is deleted while events are colle
cted for it. crbug.com/557981'); |
| 6 |
| 7 var div = document.createElement('div'); |
| 8 var div2 = document.createElement('div'); |
| 9 document.body.appendChild(div); |
| 10 |
| 11 observer = new MutationObserver(function() {}); |
| 12 observer.observe(div, {childList: true}); |
| 13 |
| 14 var script = document.createElement('script'); |
| 15 script.textContent = 'unregister_observer()'; |
| 16 div2.appendChild(script); |
| 17 div.appendChild(div2); |
| 18 |
| 19 function unregister_observer() { |
| 20 observer.disconnect(); |
| 21 delete observer; |
| 22 gc(); |
| 23 } |
| 24 </script> |
OLD | NEW |