tor-browser

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

fcp-opacity.html (1021B)


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