| <!DOCTYPE html> |
| <html> |
| <script src="./resources/test-runner-paint-worklet.js"></script> |
| <style> |
| html, body { margin: 0; padding: 0; } |
| #output { |
| width: 100px; |
| height: 100px; |
| background-image: paint(worklet); |
| } |
| </style> |
| <body> |
| <div id="output"></div> |
| |
| <script id="code" type="text/worklet"> |
| registerPaint('worklet', class { |
| paint(ctx, geom) { |
| ctx.fillStyle = 'green'; |
| ctx.fillRect(0, 0, geom.width, geom.height); |
| } |
| }); |
| </script> |
| |
| <script> |
| document.body.style.zoom = "200%"; |
| importPaintWorkletThenEndTest(document.getElementById('code').textContent); |
| </script> |
| </body> |
| </html> |