tor-browser

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

fcp-pseudo-element-image.html (951B)


      1 <!DOCTYPE html>
      2 <head>
      3 <title>Performance Paint Timing Test: FCP due to pseudo-element image</title>
      4 <style>
      5    #main {
      6        position: relative;
      7        width: 100px;
      8        height: 100px;
      9    }
     10 
     11    /* contentful class is defined in test_fcp script. */
     12    #main.contentful:after {
     13        content: url(../resources/circles.png);
     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">
     22 </div>
     23 <script>
     24    // Load the image into memory first to make sure it's decoded.
     25    function load_image() {
     26      const img = document.createElement("img");
     27      img.src = "../resources/circles.png";
     28 
     29      return new Promise(resolve => {
     30        img.onload = async () => resolve();
     31      });
     32    }
     33 
     34    test_fcp("First contentful paint fires due to pseudo-element image.", load_image)
     35 </script>
     36 </body>
     37 
     38 </html>