Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / HTMLStyleElement / style-onload2.html
blob031bcfea8e820e652eaf9e7cbe6810dab5cf7fa7
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../HTMLLinkElement/resources/link-load-utilities.js"></script>
5 <script>
6 var numberOfFiredLoadEvents = 0;
7 var expectedNumberOfFiredLoadEvents = 2;
9 function checkIfDone(elementName)
11 ++numberOfFiredLoadEvents;
13 if (numberOfFiredLoadEvents < expectedNumberOfFiredLoadEvents && elementName === 'body') {
14 log("FAIL Fired window Load event before style Load events.");
15 testFinished();
17 if (numberOfFiredLoadEvents === expectedNumberOfFiredLoadEvents) {
18 log("PASS Fired " + numberOfFiredLoadEvents + " Load events.");
19 testFinished();
22 </script>
23 <style onload="checkIfDone('style1')"></style>
24 <style onload="checkIfDone('style2')"></style>
25 </head>
26 <body onload="checkIfDone('body')">
27 <p>This tests that we fire two Load events on a page with two HTML Style elements and that both events are fired before the Load event for the window is dispatched. This test PASSED if you see the word PASS below. Otherwise, it FAILED.
28 <pre id="console"></pre>
29 </body>
30 </html>