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