blob: 7c3577139b39101fe21e597cc0487abed470686b [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<HTML>
<HEAD>
<TITLE>Test onunload and onload events for body-type document</TITLE>
<SCRIPT>
if (window.testRunner)
testRunner.dumpAsText();
function removeElementById(victimID)
{
vic = document.getElementById(victimID);
if (!vic) {
alert("not found : " + victimID);
return;
}
vic.parentNode.removeChild(vic);
}
function boldCaption(captionID)
{
cap = document.getElementById(captionID);
if (!cap) {
alert("not found : " + captionID);
return;
}
cap.setAttribute('style','font-weight:bold;');
cap.innerText += " - fired";
}
</SCRIPT>
</HEAD>
<BODY id="myBody" onload="removeElementById('myImage'); removeElementById('myObject'); removeElementById('myIFrame');"">
<P><U>Any lines that are bold and say "- fired" correspond to event handlers that fired. Only the iframe onload event should fire in this test case.</U></P>
<P id="loadIMAGE">IMG onloadEvent</P>
<P id="loadOBJECT">OBJECT onloadEvent</P>
<P id="loadIFRAME">IFRAME onloadEvent</P>
<P id="unloadIMAGE">IMG onunloadEvent</P>
<P id="unloadOBJECT">OBJECT onunloadEvent</P>
<P id="unloadIFRAME">IFRAME onunloadEvent</P>
<IMG id="myImage" onload="boldCaption('loadIMAGE')" onunload="boldCaption('unloadIMAGE')" width="40" height="40"></IMG>
<OBJECT id="myObject" onload="boldCaption('loadOBJECT')" onunload="boldCaption('unloadOBJECT')">Apple</OBJECT>
<IFRAME id="myIFrame" src="about:blank" onload="boldCaption('loadIFRAME')" onunload="boldCaption('unloadIFRAME')" style="border-style:solid; border-color:red;"></IFRAME>
</BODY>
</HTML>