| <p>Test that a linked stylesheet with a crossorigin=anonymous attribute loads a CORS enabled resource.</p> |
| <script src="resources/link-crossorigin-common.js"></script> |
| <link crossorigin="anonymous" rel="stylesheet" href="http://localhost:8080/security/resources/green-background-allow-star.php" onload="pass()" onerror="fail()"> |
| <link crossorigin="anonymous" rel="stylesheet" href="http://localhost:8080/security/resources/green-background-allow-credentials.php" onload="pass()" onerror="fail()"> |
| // Test that dynamically inserted <link> elements are handled the same way. |
| var link = document.createElement("link"); |
| link.crossOrigin = "anonymous"; |
| link.href = "http://localhost:8080/security/resources/green-background-allow-star.php"; |
| document.body.appendChild(link); |
| link = document.createElement("link"); |
| link.crossOrigin = "use-credentials"; |
| link.href = "http://localhost:8080/security/resources/green-background-allow-credentials.php"; |
| document.body.appendChild(link); |