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