OLD | NEW |
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
2 <p>Test that a linked stylesheet with a crossorigin=anonymous attribute loads a
CORS enabled resource.</p> | 2 <html> |
3 <pre></pre> | 3 <head> |
| 4 <script src="/js-test-resources/js-test.js"></script> |
| 5 <script> |
| 6 description("Test that a linked stylesheet with a crossorigin=anonymous attribut
e loads a CORS enabled resource."); |
| 7 </script> |
4 <script src="resources/link-crossorigin-common.js"></script> | 8 <script src="resources/link-crossorigin-common.js"></script> |
| 9 </head> |
5 <link crossorigin="anonymous" rel="stylesheet" href="http://localhost:8080/secur
ity/resources/green-background-allow-star.php" onload="pass()" onerror="fail()"> | 10 <link crossorigin="anonymous" rel="stylesheet" href="http://localhost:8080/secur
ity/resources/green-background-allow-star.php" onload="pass()" onerror="fail()"> |
6 <link crossorigin="anonymous" rel="stylesheet" href="http://localhost:8080/secur
ity/resources/green-background-allow-credentials.php" onload="pass()" onerror="f
ail()"> | 11 <link crossorigin="anonymous" rel="stylesheet" href="http://localhost:8080/secur
ity/resources/green-background-allow-credentials.php" onload="pass()" onerror="f
ail()"> |
7 <script> | 12 <script> |
8 // Test that dynamically inserted <link> elements are handled the same way. | 13 function runTest() |
9 var link = document.createElement("link"); | 14 { |
10 link.rel = "stylesheet"; | 15 // Test that dynamically inserted <link> elements are handled the same way. |
11 link.crossOrigin = "anonymous"; | 16 var link = document.createElement("link"); |
12 link.onload = pass; | 17 link.rel = "stylesheet"; |
13 link.onerror = fail; | 18 link.crossOrigin = "anonymous"; |
14 link.href = "http://localhost:8080/security/resources/green-background-allow-sta
r.php"; | 19 link.onload = pass; |
15 document.body.appendChild(link); | 20 link.onerror = fail; |
| 21 link.href = "http://localhost:8080/security/resources/green-background-allow
-star.php"; |
| 22 document.body.appendChild(link); |
16 | 23 |
17 link = document.createElement("link"); | 24 link = document.createElement("link"); |
18 link.rel = "stylesheet"; | 25 link.rel = "stylesheet"; |
19 link.crossOrigin = "use-credentials"; | 26 link.crossOrigin = "use-credentials"; |
20 link.onload = pass; | 27 link.onload = pass; |
21 link.onerror = fail; | 28 link.onerror = fail; |
22 link.href = "http://localhost:8080/security/resources/green-background-allow-cre
dentials.php"; | 29 link.href = "http://localhost:8080/security/resources/green-background-allow
-credentials.php"; |
23 document.body.appendChild(link); | 30 document.body.appendChild(link); |
| 31 } |
| 32 window.onload = runTest; |
24 </script> | 33 </script> |
| 34 </body> |
| 35 </html> |
OLD | NEW |