OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="resources/link-load-utilities.js"></script> | 4 <script src="resources/link-load-utilities.js"></script> |
5 <script> | 5 <script> |
6 var expectedLoadEventTargets = ["link", "body"]; | 6 var expectedLoadEventTargets = ["link", "body"]; |
7 | 7 |
8 function didReceiveLoadEvent(elementName) | 8 function didReceiveLoadEvent(elementName) |
9 { | 9 { |
10 var expectedTarget = expectedLoadEventTargets.shift(); | 10 var expectedTarget = expectedLoadEventTargets.shift(); |
11 if (expectedTarget === elementName) | 11 if (expectedTarget === elementName) |
12 testPassedAndNotifyDone("Fired Load event at " + elementName + "."); | 12 testPassedAndNotifyDone("Fired Load event at " + elementName + "."); |
13 else { | 13 else { |
14 // We don't call testFailedAndNotifyDone() or testFinished() because we want
to log additional Load events as it | 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. | 15 // may help towards debugging this test case. |
16 testFailed("Fired Load event at " + elementName + ", but should have fired i
t at " + expectedTarget + "."); | 16 testFailed("Fired Load event at " + elementName + ", but should have fired i
t at " + expectedTarget + "."); |
17 } | 17 } |
18 } | 18 } |
19 </script> | 19 </script> |
20 <link rel="stylesheet" href="resources/stylesheet.css" onload="didReceiveLoadEve
nt('link')"> | |
21 </head> | 20 </head> |
22 <body onload="didReceiveLoadEvent('body')"> | 21 <body onload="didReceiveLoadEvent('body')"> |
23 <p>This tests that a Load event for an HTML Link element comes before the Load e
vent for the window. This test PASSED if you see the word PASS below. Otherwise,
it FAILED.</p> | 22 <p>This tests that a Load event for an HTML Link element comes before the Load e
vent for the window. This test PASSED if you see the word PASS below. Otherwise,
it FAILED.</p> |
24 <pre id="console"></pre> | 23 <pre id="console"></pre> |
| 24 <link rel="stylesheet" href="resources/stylesheet.css" onload="didReceiveLoadEve
nt('link')"> |
25 </body> | 25 </body> |
26 </html> | 26 </html> |
OLD | NEW |