blob: e9e576beec0682c7e93d200ce413b78bf3184f5e [file] [log] [blame]
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<div id="main"/>
<script>
description("This tests that several ways of making an iframe that isn't inserted into a document tree"
+ " but has a child frame will fail.");
main = document.getElementById("main");
try {
container = main.appendChild(document.createElement("div"));
helperFrame = container.appendChild(document.createElement("iframe"));
targetFrame1 = document.createElement("iframe");
helperFrame.contentWindow.onunload = function() {
container.insertBefore(targetFrame1, helperFrame);
}
main.removeChild(container);
} catch (e) { }
shouldBeTrue("targetFrame1.contentWindow == undefined");
try {
container = main.appendChild(document.createElement("div"));
helperElement = container.appendChild(document.createElement("input"));
helperElement.focus();
targetFrame2 = document.createElement("iframe");
helperElement.onblur = function() {
container.appendChild(targetFrame2);
}
main.removeChild(container);
} catch (e) { }
shouldBeTrue("targetFrame2.contentWindow == undefined");
try {
container = document.createElement("div");
targetFrame3 = container.appendChild(document.createElement("iframe"));
helperFrame = targetFrame3.appendChild(document.createElement("iframe"));
helperFrame.src = "javascript:top.container.removeChild(top.targetFrame3)";
document.body.appendChild(container);
} catch (e) { }
shouldBeTrue("targetFrame3.contentWindow == undefined");
isSuccessfullyParsed();
</script>
</body>
</html>