tor-browser

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

test_bug1931559.html (796B)


      1 <!DOCTYPE HTML>
      2 <title>Test for bug 1931559</title>
      3 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
      4 <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
      5 <div id="dut" class="foo"></div>
      6 <script>
      7 SimpleTest.waitForExplicitFinish();
      8 addEventListener("DOMContentLoaded", () => {
      9  const sss = Cc["@mozilla.org/content/style-sheet-service;1"]
     10    .getService(Ci.nsIStyleSheetService);
     11  const utils = window.windowUtils;
     12 
     13  const userUrl = encodeURI("data:text/css,body { @scope { .foo { color: green; } } }");
     14  utils.loadSheetUsingURIString(userUrl, sss.USER_SHEET);
     15 
     16  const s = getComputedStyle(dut);
     17  is(s.color, "rgb(0, 128, 0)", ".foo has implicitly scoped style applied.");
     18 
     19  SimpleTest.finish();
     20 });
     21 </script>