test_bug_1364262.html (1221B)
1 <!DOCTYPE HTML> 2 <!-- Any copyright is dedicated to the Public Domain. 3 http://creativecommons.org/publicdomain/zero/1.0/ --> 4 <html> 5 <head> 6 <script src="/tests/SimpleTest/SimpleTest.js"></script> 7 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 8 <script type="application/javascript"> 9 SimpleTest.waitForExplicitFinish(); 10 SimpleTest.setExpected(["pass", 1]); 11 12 function good_correctlyBlockedStylesheet() { 13 ok(true, "Non-base64 hash blocked the load.") 14 }; 15 function bad_shouldNotLoadStylesheet() { 16 ok(false, "Non-base64 hashes should not load!") 17 } 18 window.onload = function() { 19 SimpleTest.finish(); 20 } 21 22 let link = document.createElement('link'); 23 document.head.appendChild(link); 24 link.setAttribute('rel', 'stylesheet'); 25 link.onerror = good_correctlyBlockedStylesheet; 26 link.onload = bad_shouldNotLoadStylesheet; 27 link.integrity = 'sha512-\uD89D\uDF05\uD89D\uDEE6'; 28 link.setAttribute('href', 'data:text/css;small[contenteditable^="false"], summary { }'); 29 </script> 30 </head> 31 <body> 32 <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1364262">Bug 1364262</a> 33 </body> 34 </html>