1805599-1.html (1224B)
1 <!DOCTYPE html> 2 <html class="reftest-no-flush reftest-wait" reftest-no-sync-layers> 3 <!-- reftest-no-sync-layers so that the updateLayerTree call doesn't a sync decode paint which would hide the bug --> 4 <script> 5 async function loadimg() { 6 let theimg = document.createElement("img"); 7 document.body.appendChild(theimg); 8 theimg.src = "1805599-1.svg"; 9 let paintpromise = new Promise(resolve => { 10 window.addEventListener("MozAfterPaint", resolve, { once: true }); 11 }); 12 await theimg.decode(); 13 await paintpromise; 14 setTimeout(finish, 0); 15 } 16 async function waitForPendingPaints() { 17 while (SpecialPowers.wrap(window).windowUtils.isMozAfterPaintPending) { 18 await new Promise(resolve => { 19 window.addEventListener("MozAfterPaint", resolve, { once: true }); 20 }); 21 } 22 } 23 // we have to do this when we use reftest-no-sync-layers to make sure the rendering is up to date 24 async function finish() { 25 await waitForPendingPaints(); 26 await new Promise(resolve => requestAnimationFrame(resolve)); 27 await new Promise(resolve => requestAnimationFrame(resolve)); 28 await waitForPendingPaints(); 29 document.documentElement.className = ""; 30 } 31 window.addEventListener("MozReftestInvalidate", loadimg); 32 </script> 33 34 </html>