dynamic-render-blocking-link-stylesheet-does-not-block-script.html (699B)
1 <!DOCTYPE html> 2 <title>Script-created render-blocking link stylesheet is not script-blocking</title> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <script src="support/utils.js"></script> 6 <script> 7 const link = document.createElement('link'); 8 link.rel = 'stylesheet'; 9 link.href = 'stylesheet.py?delay=1'; 10 link.blocking = 'render'; 11 document.head.appendChild(link); 12 </script> 13 <h1>Some text</h1> 14 <script> 15 test(() => { 16 assert_false(styleExists("h1 { color: purple; }"), 17 'stylesheet should still be pending'); 18 const h1 = document.querySelector('h1'); 19 assert_equals(getComputedStyle(h1).color, 'rgb(0, 0, 0)'); 20 }); 21 </script>