OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <head> | 2 <head> |
3 <title>SRI on cross origin CORS enabled style, without CORS fetch</title> | 3 <title>SRI on cross origin CORS enabled style, without CORS fetch</title> |
4 <script src="/resources/testharness.js"></script> | 4 <script src="/resources/testharness.js"></script> |
5 <script src="/resources/testharnessreport.js"></script> | 5 <script src="/resources/testharnessreport.js"></script> |
6 <script> | 6 <script> |
7 function styleLoad() { | |
8 assert_unreached("Style loaded."); | |
9 } | |
10 function styleError() { | 7 function styleError() { |
11 assert_true(true, "Style did not load."); | 8 assert_unreached("Style did not load."); |
12 } | 9 } |
13 </script> | 10 </script> |
14 <style>.id1 { background-color: red }</style> | 11 <style>.id1 { background-color: red }</style> |
15 <link rel="stylesheet" | 12 <link rel="stylesheet" |
16 onload="styleLoad()" | |
17 onerror="styleError();" | 13 onerror="styleError();" |
18 integrity="sha256-fy1lC6jbv7rOG6Flb00n5PYLggqe25IcE6QlZf8KtwI=" | 14 integrity="sha256-fy1lC6jbv7rOG6Flb00n5PYLggqe25IcE6QlZf8KtwI=" |
19 href="http://localhost:8000/security/resources/cors-style.php"></link> | 15 href="http://localhost:8000/security/resources/cors-style.php"></link> |
20 </head> | 16 </head> |
21 <body> | 17 <body> |
22 <script> | 18 <script> |
23 window.onload = function () { | 19 window.onload = function () { |
24 var ele = document.getElementById('id1'); | 20 var ele = document.getElementById('id1'); |
25 var divBackground = window.getComputedStyle(ele, null).getPropertyVa
lue('background-color'); | 21 var divBackground = window.getComputedStyle(ele, null).getPropertyVa
lue('background-color'); |
26 assert_equals(divBackground, "rgb(255, 0, 0)"); | 22 assert_equals(divBackground, "rgb(255, 255, 0)"); |
27 done(); | 23 done(); |
28 }; | 24 }; |
29 </script> | 25 </script> |
30 <div id="id1" class="id1"></div> | 26 <div id="id1" class="id1"></div> |
31 </body> | 27 </body> |
32 </html> | 28 </html> |
OLD | NEW |