[Release] Webkit-EFL Ver. 2.0_beta_118996_0.6.22
[framework/web/webkit-efl.git] / LayoutTests / fast / events / iframe-object-onload.html
1 <div> 
2 This test checks that onload events fire on iframe and object
3 elements when their contents finish loading, and that these are
4 separate event objects from those that fire on the body inside the
5 frame. If it passes, you will see 6 blocks below, each with a
6 three-line message that ends in false.
7 </div>
8 <div id="console">
9 </div>
10 <script>
11 if (window.layoutTestController)
12     layoutTestController.dumpAsText();
13
14 function log(s)
15 {
16     currentLogEntry += s + "<br>";    
17 }
18
19 var innerEvent = null;
20 var logArray = [];
21 var currentLogEntry = '';
22
23 function logOuter(msg, event)
24 {
25     log(msg);
26     log('Outer event same as inner: ' + (innerEvent == event));
27     log('------');
28
29     logArray.push(currentLogEntry);
30     currentLogEntry = '';
31     
32     if (logArray.length == 6) {
33         logArray.sort();
34         document.getElementById("console").innerHTML = logArray.join('');
35     }
36 }
37
38 function logInner(tag, event)
39 {
40     parent.log("Fired load event on body inside " + tag); 
41     parent.innerEvent = event;
42 }
43
44 </script>
45
46 <iframe 
47     src="resources/iframe-object-onload-iframe-1.html" 
48     onload="logOuter('Fired event on iframe', event)">
49 </iframe>
50
51 <iframe 
52     src="resources/iframe-object-onload-iframe-2.html" 
53     onload="logOuter('Fired event on iframe even though default was prevented', event)">
54 </iframe>
55
56 <iframe
57     src="resources/iframe-object-onload-iframe-3.html" 
58     onload="logOuter('Fired event on object even though propagation was stopped', event)">
59 </iframe>
60
61 <object 
62     type="text/html"
63     data="resources/iframe-object-onload-object-1.html" 
64     onload="logOuter('Fired event on object', event)">
65 </object>
66
67 <object 
68     type="text/html"
69     data="resources/iframe-object-onload-object-2.html" 
70     onload="logOuter('Fired event on object even though default was prevented', event)">
71 </object>
72
73 <object 
74     type="text/html"
75     data="resources/iframe-object-onload-object-3.html" 
76     onload="logOuter('Fired event on object even though propagation was stopped', event)">
77 </object>