4 <script src=
"../../resources/js-test.js"></script>
9 description("This test ensures that any tree mutation in the load event handler cannot harm the tree consistency.")
10 var docElement
= document
.documentElement
;
12 textareaElement
= document
.createElement("textarea");
13 iframeElement
= document
.createElement("iframe");
15 var loadEventFired
= false;
16 textareaElement
.appendChild(iframeElement
);
17 iframeElement
.addEventListener("load", function () { iframeElement
.innerHTML
= "X"; loadEventFired
= true; }, false);
18 textareaElement
.addEventListener("DOMNodeInserted", function () { document
.implementation
.createDocument("", "", null).adoptNode(textareaElement
) }, false);
19 document
.documentElement
.appendChild(textareaElement
); // The DOMNodeInserted event is triggered here through innerHTML = "X"
20 document
.getElementById("g").appendChild(textareaElement
);
21 shouldBeTrue("loadEventFired");
22 debug("PASS unless crash.");