3 <title>Test case for bug
5122: Equivalent of Mozilla's DOMContentLoaded needed
</title>
4 <script type=
"text/javascript">
7 var item
= document
.createElement("li");
8 item
.appendChild(document
.createTextNode(message
));
9 document
.getElementById('log').appendChild(item
);
12 if (window
.testRunner
) {
13 testRunner
.dumpAsText();
19 document
.addEventListener('DOMContentLoaded', function() { log('DOMContentLoaded event fired on document!'); counter
++; }, false);
20 window
.addEventListener('DOMContentLoaded', function() {
21 log('DOMContentLoaded event bubbled to window!');
23 // Fire a short-duration timer that will fire before the image completes loading to ensure that
24 // DOMContentLoaded is in fact happening before the image has loaded.
25 window
.setTimeout(function() { log('Timer callback called.'); counter
++; }, 10)
27 window
.addEventListener('load', function() {
28 log('load event fired!');
37 <h1>Test case for
<a href='http://bugs.webkit.org/show_bug.cgi?id=
5122'
>bug
5122</a>: Equivalent of Mozilla's DOMContentLoaded needed
</h1>
39 <p>You should see a note about the DOMContentLoaded event being fired and bubbled, a timer being called, and then the load event being fired.
</p>
41 <img src='../../navigation/resources/slow-resource.pl?delay=
250'
>