invalid-image-paint-error.https.html (1011B)
1 <!DOCTYPE html> 2 <html class="reftest-wait"> 3 <link rel="help" href="https://drafts.css-houdini.org/css-paint-api/"> 4 <link rel="match" href="invalid-image-paint-error-ref.html"> 5 <style> 6 #output { 7 width: 100px; 8 height: 100px; 9 background-image: paint(errorIndicator), paint(successIndicator); 10 } 11 </style> 12 <script src="/common/reftest-wait.js"></script> 13 <script src="/common/worklet-reftest.js"></script> 14 <body> 15 <div id="output"></div> 16 17 <script id="code" type="text/worklet"> 18 registerPaint('errorIndicator', class { 19 paint(ctx, geom) { 20 ctx.fillStyle = 'red'; 21 ctx.fillRect(0, 0, geom.width, geom.height); 22 throw Error('failed!'); 23 } 24 }); 25 registerPaint('successIndicator', class { 26 paint(ctx, geom) { 27 ctx.fillStyle = 'green'; 28 ctx.fillRect(0, 0, geom.width, geom.height); 29 } 30 }); 31 </script> 32 33 <script> 34 importWorkletAndTerminateTestAfterAsyncPaint(CSS.paintWorklet, document.getElementById('code').textContent); 35 </script> 36 </body> 37 </html>