Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / frames / iframe-onload-and-domnodeinserted.html
blob87680f788cfebc0d6945767917582513dd9856b3
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <div id="g"></div>
8 <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.");
23 </script>
24 </body>
25 </html>