summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/dom/HTMLBodyElement/body-inserting-iframe-crash.html
blob: 35cece8d5318de3c9503a5832bdbcc0c8300ce9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<script>
if (window.testRunner)
    testRunner.dumpAsText();

var iframe = null;

function start() {
    iframe = document.createElement('iframe');
    iframe.setAttribute('marginwidth', 1);
    document.body.appendChild(iframe);

    var bodyInFrame = document.createElement('body');
    bodyInFrame.addEventListener('DOMSubtreeModified', removeIframe);
    iframe.contentDocument.documentElement.appendChild(bodyInFrame);
    document.body.innerHTML = 'PASS if not crashed.';
}

function removeIframe() {
    iframe.parentNode.removeChild(iframe);
    iframe = null;
    gc();
}
</script>
<body onload="start()">
</body>