2 <p>Test that a linked stylesheet with a crossorigin=anonymous attribute loads a CORS enabled resource.</p>
4 <script src="resources/link-crossorigin-common.js"></script>
5 <link crossorigin="anonymous" rel="stylesheet" href="http://localhost:8080/security/resources/green-background-allow-star.php" onload="pass()" onerror="fail()">
6 <link crossorigin="anonymous" rel="stylesheet" href="http://localhost:8080/security/resources/green-background-allow-credentials.php" onload="pass()" onerror="fail()">
8 // Test that dynamically inserted <link> elements are handled the same way.
9 var link = document.createElement("link");
10 link.rel = "stylesheet";
11 link.crossOrigin = "anonymous";
14 link.href = "http://localhost:8080/security/resources/green-background-allow-star.php";
15 document.body.appendChild(link);
17 link = document.createElement("link");
18 link.rel = "stylesheet";
19 link.crossOrigin = "use-credentials";
22 link.href = "http://localhost:8080/security/resources/green-background-allow-credentials.php";
23 document.body.appendChild(link);