Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / insertBefore-refChild-crash.html
blob18de84af807979e8d30672b8005dd544c310212b
1 <div>Test passes if it does not crash.</div>
2 <span id=container><span></span></span>
3 <span id=newChild></span>
4 <script src="../../resources/gc.js"></script>
5 <script>
6 if (window.testRunner)
7 testRunner.dumpAsText();
9 var container = document.getElementById('container');
10 var newChild = document.getElementById('newChild');
11 function handleNodeRemoved() {
12 newChild.removeEventListener('DOMNodeRemoved', handleNodeRemoved);
13 container.innerHTML = '';
14 gc();
16 newChild.addEventListener('DOMNodeRemoved', handleNodeRemoved, false);
17 var range = document.createRange();
18 range.selectNodeContents(container);
19 range.insertNode(newChild);
20 </script>