OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE HTML> |
| 2 <p>Test that a linked stylesheet with a crossorigin attribute does not load a cr
oss-origin resource that isn't CORS enabled.</p> |
| 3 <pre></pre> |
| 4 <script>window.test_count = 8;</script> |
| 5 <script src="resources/link-crossorigin-common.js"></script> |
| 6 <link crossorigin="anonymous" rel="stylesheet" href="http://localhost:8080/secur
ity/resources/green-background.css?1" onload="fail()" onerror="pass()"> |
| 7 <link crossorigin="use-credentials" rel="stylesheet" href="http://localhost:8080
/security/resources/green-background.css?2" onload="fail()" onerror="pass()"> |
| 8 <!-- Check that from-cache loads are also failing (and does not generate separat
e loads.) --> |
| 9 <link crossorigin="anonymous" rel="stylesheet" href="http://localhost:8080/secur
ity/resources/green-background.css?1" onload="fail()" onerror="pass()"> |
| 10 <link crossorigin="use-credentials" rel="stylesheet" href="http://localhost:8080
/security/resources/green-background.css?2" onload="fail()" onerror="pass()"> |
| 11 <!-- These are same-origin and should load as the fetch wasn't out of origin --> |
| 12 <link crossorigin="anonymous" rel="stylesheet" href="resources/green-background.
css?3" onload="pass()" onerror="fail()"> |
| 13 <link crossorigin="use-credentials" rel="stylesheet" href="resources/green-backg
round.css?4" onload="pass()" onerror="fail()"> |
| 14 <script> |
| 15 // Test that dynamically inserted <link> elements are handled the same way. |
| 16 var link = document.createElement("link"); |
| 17 link.rel = "stylesheet"; |
| 18 link.crossOrigin = "anonymous"; |
| 19 link.onload = fail; |
| 20 link.onerror = pass; |
| 21 link.href = "http://localhost:8080/security/resources/green-background.css?8"; |
| 22 document.body.appendChild(link); |
| 23 |
| 24 link = document.createElement("link"); |
| 25 link.rel = "stylesheet"; |
| 26 link.crossOrigin = "use-credentials"; |
| 27 link.onload = fail; |
| 28 link.onerror = pass; |
| 29 link.href = "http://localhost:8080/security/resources/green-background.css?9"; |
| 30 document.body.appendChild(link); |
| 31 </script> |
OLD | NEW |