style-src-elem-allowed-src-blocked.html (683B)
1 <!DOCTYPE html> 2 <html> 3 4 <head> 5 <meta http-equiv="Content-Security-Policy" content="style-src-elem 'unsafe-inline'; 6 style-src 'none';"> 7 <script src="/resources/testharness.js"></script> 8 <script src="/resources/testharnessreport.js"></script> 9 <script> 10 var t = async_test("Inline style should be applied"); 11 window.addEventListener('securitypolicyviolation', t.unreached_func("Should not have fired a spv event")); 12 </script> 13 </head> 14 15 <body> 16 <style> 17 body {background: green;} 18 </style> 19 <script> 20 t.step(function() { 21 assert_equals(document.styleSheets.length, 1); 22 t.done(); 23 }); 24 </script> 25 </body> 26 27 </html>