tor-browser

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

img-replaced-box-while-loading.html (1142B)


      1 <!doctype html>
      2 <title>Images don't render as a non-replaced inline while loading, even when there's no concrete size specified</title>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Álvarez">
      6 <link rel="author" href="https://mozilla.org" title="Mozilla">
      7 <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1472637">
      8 <style>
      9  img {
     10    min-width: 1000px;
     11  }
     12 </style>
     13 <img alt="T">
     14 <script>
     15 // Do an async test off the onload handler to avoid waiting for the load even for too long unnecessarily.
     16 let t = async_test("Loading images should get a replaced box, even without specified size");
     17 onload = t.step_func(function() {
     18  const image = document.querySelector("img");
     19  // Use the trickle pipe to have 100 seconds until the image actually loads,
     20  // that should be enough to run the test.
     21  image.src = "../../../../../images/blue.png?pipe=trickle(d100)";
     22  t.step_timeout(t.step_func_done(function() {
     23    assert_equals(
     24      image.offsetWidth,
     25      1000,
     26    );
     27  }), 0);
     28 });
     29 </script>