blob: 2e6ae6f13a1833a7be95e6d027e979469f338e5f [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.testRunner)
testRunner.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>