2008-11-04 Anders Carlsson <andersca@apple.com>
[webkit/qt.git] / LayoutTests / fast / events / event-targets.html
bloba6643e67877bac998aad73e0650122004a562335
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
2 "http://www.w3.org/TR/html4/frameset.dtd">
3 <HTML>
4 <HEAD>
5 <TITLE>Test onunload and onload events for body-type document</TITLE>
6 <SCRIPT>
7 if (window.layoutTestController)
8 layoutTestController.dumpAsText();
10 function removeElementById(victimID)
12 vic = document.getElementById(victimID);
13 if (!vic) {
14 alert("not found : " + victimID);
15 return;
18 vic.parentNode.removeChild(vic);
20 function boldCaption(captionID)
22 cap = document.getElementById(captionID);
23 if (!cap) {
24 alert("not found : " + captionID);
25 return;
28 cap.setAttribute('style','font-weight:bold;');
29 cap.innerText += " - fired";
32 </SCRIPT>
33 </HEAD>
34 <BODY id="myBody" onload="removeElementById('myImage'); removeElementById('myObject'); removeElementById('myIFrame');"">
35 <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>
36 <P id="loadIMAGE">IMG onloadEvent</P>
37 <P id="loadOBJECT">OBJECT onloadEvent</P>
38 <P id="loadIFRAME">IFRAME onloadEvent</P>
39 <P id="unloadIMAGE">IMG onunloadEvent</P>
40 <P id="unloadOBJECT">OBJECT onunloadEvent</P>
41 <P id="unloadIFRAME">IFRAME onunloadEvent</P>
42 <IMG id="myImage" onload="boldCaption('loadIMAGE')" onunload="boldCaption('unloadIMAGE')" width="40" height="40"></IMG>
43 <OBJECT id="myObject" onload="boldCaption('loadOBJECT')" onunload="boldCaption('unloadOBJECT')">Apple</OBJECT>
44 <IFRAME id="myIFrame" src="about:blank" onload="boldCaption('loadIFRAME')" onunload="boldCaption('unloadIFRAME')" style="border-style:solid; border-color:red;"></IFRAME>
45 </BODY>
46 </HTML>