tor-browser

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

fcp-bg-image-set.html (1036B)


      1 <!DOCTYPE html>
      2 <head>
      3 <title>Performance Paint Timing Test: FCP due to background image in image-set</title>
      4 <style>
      5    #main {
      6        width: 100px;
      7        height: 100px;
      8    }
      9 
     10    /* contentful class is defined in test_fcp script. */
     11    #main.contentful {
     12        background-image: -webkit-image-set(url(../resources/circles.png) 1x);
     13        background-image: image-set(url(../resources/circles.png) 1x);
     14    }
     15 </style>
     16 </head>
     17 <body>
     18 <script src="/resources/testharness.js"></script>
     19 <script src="/resources/testharnessreport.js"></script>
     20 <script src="../resources/utils.js"></script>
     21 <div id="main"></div>
     22 <script>
     23    // Load the image into memory first to make sure it's decoded.
     24    function load_image() {
     25      const img = document.createElement("img");
     26      img.src = "../resources/circles.png";
     27 
     28      return new Promise(resolve => {
     29        img.onload = async () => resolve();
     30      });
     31    }
     32 
     33    test_fcp("First contentful paint fires due to background image in image-set.", load_image);
     34 </script>
     35 </body>
     36 </html>