Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / HTMLStyleElement / style-onload-before-page-load.html
blob2d29f7a52d5b5038ad2d1abe3425f2435c96120e
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../HTMLLinkElement/resources/link-load-utilities.js"></script>
5 <script>
6 var expectedLoadEventTargets = ["style", "body"];
8 function didReceiveLoadEvent(elementName)
10 var expectedTarget = expectedLoadEventTargets.shift();
11 if (expectedTarget === elementName)
12 testPassedAndNotifyDone("Fired Load event at " + elementName + ".");
13 else {
14 // We don't call testFailedAndNotifyDone() or testFinished() because we want to log additional Load events as it
15 // may help towards debugging this test case.
16 testFailed("Fired Load event at " + elementName + ", but should have fired it at " + expectedTarget + ".");
19 </script>
20 <style onload="didReceiveLoadEvent('style')"></style>
21 </head>
22 <body onload="didReceiveLoadEvent('body')">
23 <p>This tests that a Load event for an HTML Style element comes before the Load event for the window. This test PASSED if you see the word PASS below. Otherwise, it FAILED.</p>
24 <pre id="console"></pre>
25 </body>
26 </html>