blob: ef8f8ff12b2e62b7dc1fd27af595497667149adf [file] [log] [blame]
<div>
This test checks that onload events fire on iframe and object
elements when their contents finish loading, and that these are
separate event objects from those that fire on the body inside the
frame. If it passes, you will see 6 blocks below, each with a
three-line message that ends in false.
</div>
<div id="console">
</div>
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
function log(s)
{
currentLogEntry += s + "<br>";
}
var innerEvent = null;
var logArray = [];
var currentLogEntry = '';
function logOuter(msg, event)
{
log(msg);
log('Outer event same as inner: ' + (innerEvent == event));
log('------');
logArray.push(currentLogEntry);
currentLogEntry = '';
if (logArray.length == 6) {
logArray.sort();
document.getElementById("console").innerHTML = logArray.join('');
}
}
function logInner(tag, event)
{
parent.log("Fired load event on body inside " + tag);
parent.innerEvent = event;
}
</script>
<iframe
src="resources/iframe-object-onload-iframe-1.html"
onload="logOuter('Fired event on iframe', event)">
</iframe>
<iframe
src="resources/iframe-object-onload-iframe-2.html"
onload="logOuter('Fired event on iframe even though default was prevented', event)">
</iframe>
<iframe
src="resources/iframe-object-onload-iframe-3.html"
onload="logOuter('Fired event on object even though propagation was stopped', event)">
</iframe>
<object
type="text/html"
data="resources/iframe-object-onload-object-1.html"
onload="logOuter('Fired event on object', event)">
</object>
<object
type="text/html"
data="resources/iframe-object-onload-object-2.html"
onload="logOuter('Fired event on object even though default was prevented', event)">
</object>
<object
type="text/html"
data="resources/iframe-object-onload-object-3.html"
onload="logOuter('Fired event on object even though propagation was stopped', event)">
</object>