Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / ready-state-change-crash.html
blobe39e23e67281d394b32c2b5c965a6be83f2376f6
1 <!DOCTYPE html>
2 <html>
3 Test passes if it does not crash.
4 <body>
5 <div id="a"></div>
6 <div id="b">
7 <iframe id="f" src="about:blank"></iframe>
8 </div>
10 <script>
11 if (window.testRunner)
12 testRunner.dumpAsText();
14 var listenerActive = false;
15 var fDoc = document.getElementById('f').contentDocument;
16 fDoc.open();
18 // Waits for frame f to finish loading, then moves div b into div a.
19 moveDivBIntoDivA = function() {
20 if (fDoc.readyState == 'loading') {
21 if (!listenerActive) {
22 fDoc.addEventListener('readystatechange', moveDivBIntoDivA);
23 listenerActive = true;
25 return;
27 document.getElementById('a').appendChild(document.getElementById('b'));
30 moveDivBIntoDivA();
31 fDoc.close();
32 </script>
33 </body>
34 </html>