4 function print(message
)
6 var line
= document
.createElement("div");
7 line
.appendChild(document
.createTextNode(message
));
8 document
.body
.appendChild(line
);
10 function handleDOMContentLoadedEvent()
12 document
.body
.removeChild(document
.body
.firstChild
);
13 print("A) Entered DOMContentLoaded event handler function.");
14 frame
= document
.createElement("iframe");
15 document
.body
.appendChild(frame
);
16 print("B) Exiting DOMContentLoaded event handler function.");
17 if (window
.testRunner
)
18 testRunner
.notifyDone();
20 function handleLoadEvent()
22 print("C) Entered load event handler function.");
23 document
.body
.removeChild(frame
);
24 print("D) Exiting load event handler function.");
25 print("Test passed if messages A, B, C, D were all in order and there was no crash.");
27 if (window
.testRunner
) {
28 testRunner
.dumpAsText();
29 testRunner
.waitUntilDone();
31 addEventListener("load", handleLoadEvent
);
32 addEventListener("DOMContentLoaded", handleDOMContentLoadedEvent
);
35 <body>TEST DID NOT RUN YET
</body>