OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 |
| 4 <head> |
| 5 <!-- Programmatically converted from a WebKit Reftest, please forgive result
ing idiosyncracies.--> |
| 6 <title>stylenonce-allowed</title> |
| 7 <script src="/resources/testharness.js"></script> |
| 8 <script src="/resources/testharnessreport.js"></script> |
| 9 <script src="../support/logTest.sub.js?logs=[]"></script> |
| 10 <script src="../support/alertAssert.sub.js?alerts=[]"></script> |
| 11 <!-- enforcing policy: |
| 12 style-src 'self' nonce-noncynonce' 'nonce-noncy+/nonce='; script-src 'self' 'uns
afe-inline'; connect-src 'self'; |
| 13 --> |
| 14 <script></script> |
| 15 <style nonce="noncynonce"> |
| 16 #test1 { |
| 17 color: green; |
| 18 } |
| 19 |
| 20 </style> |
| 21 <style> |
| 22 #test1 { |
| 23 color: red; |
| 24 } |
| 25 |
| 26 </style> |
| 27 <style nonce="noncynonce"> |
| 28 #test2 { |
| 29 color: green; |
| 30 } |
| 31 |
| 32 </style> |
| 33 </head> |
| 34 |
| 35 <body> |
| 36 <p id="test1">This text should be green.</p> |
| 37 <p id="test2">This text should also be green.</p> |
| 38 <script> |
| 39 var el = document.querySelector('#test1'); |
| 40 test(function() { |
| 41 assert_equals(window.getComputedStyle(el).color, "rgb(0, 128, 0)") |
| 42 }); |
| 43 var el = document.querySelector('#test2'); |
| 44 test(function() { |
| 45 assert_equals(window.getComputedStyle(el).color, "rgb(0, 128, 0)") |
| 46 }); |
| 47 |
| 48 </script> |
| 49 <p>Style correctly whitelisted via a 'nonce-*' expression in 'style-src' sho
uld be applied to the page.</p> |
| 50 <div id="log"></div> |
| 51 <script async defer src="../support/checkReport.sub.js?reportExists=true&
;reportField=violated-directive&reportValue=style-src%20'nonce-noncynon
ce'%20'nonce-noncy+/nonce='"></script> |
| 52 </body> |
| 53 |
| 54 </html> |
OLD | NEW |