4 <script src=
"../HTMLLinkElement/resources/link-load-utilities.js"></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
+ ".");
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
+ ".");
20 <style onload=
"didReceiveLoadEvent('style')"></style>
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>