image-srcset-basic-selection-width-2x.html (806B)
1 <!DOCTYPE html> 2 <html reftest-zoom="2" class="reftest-wait"> 3 <head> 4 <style>img { width: 50px; }</style> 5 <script type="application/javascript"> 6 // reftest-zoom is only applied at onload, so ensure the source-selection 7 // has happened after that 8 function clearWait() { 9 document.documentElement.classList.remove("reftest-wait"); 10 } 11 window.addEventListener("load", function() { 12 setTimeout(function() { 13 var img = document.querySelector("img"); 14 img.onload = clearWait; 15 img.onerror = clearWait; 16 img.src = img.src; 17 }, 0); 18 }); 19 </script> 20 </head> 21 <body> 22 <img srcset="50.png 0.5x, 100.png 1x, 200.png 2x, 300.png 3x, 400.png" width="1000"> 23 <p>Ensure that width is honored and does not affect selection process</p> 24 </body> 25 </html>