Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / getElementById-consistency4.html
blob3abbf7ef38f1cd6f9eeb30b53e1db87cf78c4cfa
1 <!DOCTYPE html>
2 <script src="../../resources/js-test.js"></script>
3 <div id=container>
4 <span id=el>
5 </span>
6 </div>
7 <script>
8 description('Test that DOMSubtreeModified listeners cannot cause DocumentOrderedMap to be incorrect');
10 var counter = 0;
11 var container = document.getElementById('container');
12 var el = document.getElementById('el');
13 function broken() {
14 if (++counter > 2) {
15 document.removeEventListener('DOMSubtreeModified', broken, true);
16 return;
17 } else if (counter == 1)
18 container.innerHTML = '';
19 else
20 container.appendChild(el);
23 document.addEventListener("DOMSubtreeModified", broken, true);
24 broken();
25 shouldBeTrue("document.contains(el)");
26 el.parentNode.removeChild(el);
27 el = null;
28 gc();
29 shouldBeNull("document.getElementById('el')");
30 </script>