link-stylesheet-with-non-match-media-does-not-block-render.tentative.html (738B)
1 <!DOCTYPE html> 2 <title> 3 Delayed Stylesheet imported using link tag should not block rendering 4 or JS execution when media doesn't match. 5 </title> 6 <script src="/resources/testharness.js"></script> 7 <script src="/resources/testharnessreport.js"></script> 8 <script src="support/utils.js"></script> 9 <link rel="stylesheet" href="support/link-style.css?pipe=trickle(d1)" 10 media="print" onload="this.media='all'"> 11 <h1> 12 This text is black in color till stylesheet is fetched. 13 </h1> 14 <script> 15 test(() => { 16 assert_false(styleExists("h1 { color: purple; }"), 17 'Stylesheet should still be pending due to delay'); 18 const h1 = document.querySelector('h1'); 19 assert_equals(getComputedStyle(h1).color, 'rgb(0, 0, 0)'); 20 }); 21 </script>