tor-browser

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

test_border_device_pixel_rounding_initial_style.html (917B)


      1 <!doctype html>
      2 <script src="/tests/SimpleTest/SimpleTest.js"></script>
      3 <link rel="stylesheet" href="/tests/SimpleTest/test.css">
      4 <iframe id="frame"></iframe>
      5 <script>
      6 SimpleTest.waitForExplicitFinish();
      7 SpecialPowers.pushPrefEnv({ "set": [["layout.css.devPixelsPerPx", "1.25"]] },
      8  function() {
      9    is(window.devicePixelRatio, 1.25, "devPixelsPerPx should work");
     10    const frame = document.getElementById("frame");
     11    frame.addEventListener("load", function() {
     12      let doc = frame.contentDocument;
     13      let win = frame.contentWindow;
     14      is(win.devicePixelRatio, 1.25, "devPixelsPerPx should work inside the frame");
     15      is(win.getComputedStyle(doc.querySelector("div")).borderTopWidth, "0.8px", "Shouldn't incorrectly round with 60 app units after getting the initial style");
     16      SimpleTest.finish();
     17    });
     18    frame.srcdoc = "<div style='border: 1px solid; display: none;'></div>";
     19  });
     20 </script>