fcp-whitespace.html (1114B)
1 <!DOCTYPE html> 2 <head> 3 <title>Performance Paint Timing Test: Whitespace should not count as contentful</title> 4 <style> 5 #main { 6 position: relative; 7 width: 100px; 8 height: 100px; 9 background-image: url(../resources/circles.png); 10 background-size: 0 0; 11 } 12 13 #text { 14 display: none; 15 } 16 17 /* contentful class is defined in test_fcp script. */ 18 #main.contentful #text{ 19 display: block; 20 } 21 </style> 22 </head> 23 <body> 24 <script src="/resources/testharness.js"></script> 25 <script src="/resources/testharnessreport.js"></script> 26 <script src="../resources/utils.js"></script> 27 <div id="main"> 28 <div id="whitespace"> </div> 29 <div id="text">TEXT</div> 30 </div> 31 <script> 32 // Load the image into memory first to make sure it's decoded. 33 function load_image() { 34 const img = document.createElement("img"); 35 img.src = "../resources/circles.png"; 36 37 return new Promise(resolve => { 38 img.onload = async () => resolve(); 39 }); 40 } 41 42 test_fcp("Whitespace should not count as contentful.", load_image) 43 </script> 44 </body> 45 </html>