tor-browser

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

relative-urls.html (782B)


      1 <!doctype html>
      2 <head>
      3  <title>Test resolution of relative URL in CSS module</title>
      4  <script src="/resources/testharness.js"></script>
      5  <script src="/resources/testharnessreport.js"></script>
      6 </head>
      7 <body>
      8  <div id="target"></div>
      9  <script type="module">
     10    import styleSheet from "./resources/load-relative-url.css" with { type: "css"};
     11    test(() => {
     12      const target = document.querySelector("#target");
     13      document.adoptedStyleSheets = [ styleSheet ];
     14      let backgroundStyle = window.getComputedStyle(target).backgroundImage;
     15      assert_not_equals(backgroundStyle.indexOf("css-module/resources/image.png"), -1);
     16    }, "A relative URL in a CSS module should be resolved relative to the CSS file's URL, not the importing document's URL");
     17  </script>
     18 </body>