tor-browser

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

not-rendered-dimension-getter.html (980B)


      1 <!doctype html>
      2 <meta charset="utf-8">
      3 <title>Image intrinsic dimensions are returned if the image isn't rendered</title>
      4 <link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
      5 <link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-img-width">
      6 <script src="/resources/testharness.js"></script>
      7 <script src="/resources/testharnessreport.js"></script>
      8 <div id="container" style="display: none">
      9 </div>
     10 <script>
     11 async_test(function(t) {
     12  var img = document.createElement('img');
     13  img.onload = t.step_func_done(function() {
     14    assert_equals(img.width, 389, "intrinsic width should've been returned")
     15    assert_equals(img.height, 590, "intrinsic height should've been returned")
     16    document.getElementById('container').appendChild(img);
     17    assert_equals(img.width, 389, "intrinsic width should've been returned");
     18    assert_equals(img.height, 590, "intrinsic height should've been returned");
     19  });
     20  img.src = "image-1.jpg";
     21 });
     22 </script>