paint2d-imageSmoothingQuality.med.https.html (1045B)
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="paint2d-imageSmoothingQuality.med-ref.html"> 5 <style> 6 #output { 7 width: 300px; 8 height: 300px; 9 background-image: paint(image); 10 border-image: url(./resources/html5.png); 11 } 12 </style> 13 <script src="/common/reftest-wait.js"></script> 14 <script src="/common/worklet-reftest.js"></script> 15 <div id="output"></div> 16 17 <script id="code" type="text/worklet"> 18 registerPaint('image', class { 19 static get inputProperties() { return [ 'border-image-source' ]; }; 20 paint(ctx, geom, styleMap) { 21 ctx.imageSmoothingQuality = 'medium'; 22 ctx.fillStyle = 'green'; 23 ctx.fillRect(0, 0, geom.width, geom.height); 24 ctx.drawImage(styleMap.get('border-image-source'), 0, 0, 200, 200); 25 } 26 }); 27 </script> 28 29 <script> 30 importWorkletAndTerminateTestAfterAsyncPaint( 31 CSS.paintWorklet, document.getElementById('code').textContent); 32 </script> 33 </html>