3 <script src=
"../../resources/js-test.js"></script>
8 description("This tests that several ways of making an iframe that isn't inserted into a document tree"
9 + " but has a child frame will fail.");
11 main
= document
.getElementById("main");
14 container
= main
.appendChild(document
.createElement("div"));
15 helperFrame
= container
.appendChild(document
.createElement("iframe"));
16 targetFrame1
= document
.createElement("iframe");
18 helperFrame
.contentWindow
.onunload = function() {
19 container
.insertBefore(targetFrame1
, helperFrame
);
22 main
.removeChild(container
);
24 shouldBeTrue("targetFrame1.contentWindow == undefined");
27 container
= main
.appendChild(document
.createElement("div"));
28 helperElement
= container
.appendChild(document
.createElement("input"));
29 helperElement
.focus();
30 targetFrame2
= document
.createElement("iframe");
32 helperElement
.onblur = function() {
33 container
.appendChild(targetFrame2
);
36 main
.removeChild(container
);
38 shouldBeTrue("targetFrame2.contentWindow == undefined");
41 container
= document
.createElement("div");
42 targetFrame3
= container
.appendChild(document
.createElement("iframe"));
43 helperFrame
= targetFrame3
.appendChild(document
.createElement("iframe"));
44 helperFrame
.src
= "javascript:top.container.removeChild(top.targetFrame3)";
45 document
.body
.appendChild(container
);
47 shouldBeTrue("targetFrame3.contentWindow == undefined");
49 isSuccessfullyParsed();