tor-browser

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

image-loading-lazy-empty-src.html (791B)


      1 <!DOCTYPE html>
      2 <html>
      3 <title>Lazy loaded Images handle correctly when setting src to empty</title>
      4 <link rel="help" href="https://html.spec.whatwg.org/multipage/images.html#update-the-image-data">
      5 <div id=log></div>
      6 <script src="/resources/testharness.js"></script>
      7 <script src="/resources/testharnessreport.js"></script>
      8 
      9 <img id="image" loading="lazy" src="resources/image.png">
     10 
     11 <script>
     12  const image = document.querySelector('#image');
     13 
     14 async_test(function(t) {
     15    image.onerror = t.step_func(function(e) {
     16        assert_equals(e.type, "error", "null image source check failed");
     17        image.onload = t.step_func(function() {
     18            t.done();
     19        });
     20        image.src = "resources/image.png";
     21    });
     22    image.src = "";
     23 }, "lazy loaded image and empty src");
     24 
     25 </script>