tor-browser

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

style-element-media-match-block-script.html (574B)


      1 <!DOCTYPE html>
      2 <title>Style element is script-blocking when media matches</title>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <script src="support/utils.js"></script>
      6 <style>
      7 @import url('stylesheet.py?delay=1');
      8 </style>
      9 <h1>Some text</h1>
     10 <script>
     11 test(() => {
     12  assert_true(styleExists("h1 { color: purple; }"),
     13              'script should be blocked until the stylesheet is loaded');
     14  const h1 = document.querySelector('h1');
     15  assert_equals(getComputedStyle(h1).color, 'rgb(128, 0, 128)');
     16 });
     17 </script>