Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / misc / DOMContentLoaded-event.html
blobd1b31f030bee5f7f9d5200de9cd8a0f58f7b61d1
1 <html>
2 <head>
3 <title>Test case for bug 5122: Equivalent of Mozilla's DOMContentLoaded needed</title>
4 <script type="text/javascript">
5 function log(message)
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();
14 log = alert;
18 counter = 0;
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!');
22 counter++;
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)
26 }, false);
27 window.addEventListener('load', function() {
28 log('load event fired!');
29 if (counter == 3)
30 log('PASSED');
31 else
32 log('FAILED');
33 }, false);
34 </script>
35 </head>
36 <body>
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'>
42 <ol id='log'>
43 </ol>
44 </body>
45 </html>