tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

dynamic-render-blocking-style-element-does-not-block-script.html (743B)


      1 <!DOCTYPE html>
      2 <title>Script-created render-blocking style element 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 style = document.createElement('style');
      8 const sheet = document.createTextNode('@import url(stylesheet.py?delay=1);');
      9 style.appendChild(sheet);
     10 style.blocking = 'render';
     11 document.head.appendChild(style);
     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>