tor-browser

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

image-loading-lazy-data-url-to-https.html (887B)


      1 <!DOCTYPE html>
      2 <html class="reftest-wait">
      3 <head>
      4  <title>Lazy loaded Images with data url placeholders can be overwritten by a src change</title>
      5  <link rel="help" href="https://html.spec.whatwg.org/multipage/images.html#update-the-image-data">
      6  <link rel="match" href="image-loading-lazy-data-url-to-https-ref.html">
      7  <script src="/common/reftest-wait.js"></script>
      8 </head>
      9 
     10 <body>
     11  <img id="image" loading="lazy" src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 872 490' width='872' height='490' style='background: green' %3E%3C/svg%3E">
     12 
     13 <script>
     14  const image = document.querySelector('#image');
     15 
     16  window.onload = function() {
     17    // trigger intersection observer through forced layout.
     18    image.offsetWidth;
     19    image.setAttribute("src", 'resources/image.png');
     20    setTimeout(() => { takeScreenshot(); }, 100);
     21  };
     22 </script>
     23 </body>
     24 </html>