| <!DOCTYPE html> |
| <script src="../resources/run-after-layout-and-paint.js"></script> |
| <script src="resources/test-runner-paint-worklet.js"></script> |
| <style> |
| #output { |
| width: 300px; |
| height: 300px; |
| background-image: paint(image); |
| border-image: url("resources/html5.png"); |
| } |
| </style> |
| <div id="output"></div> |
| |
| <script id="code" type="text/worklet"> |
| registerPaint('image', class { |
| static get inputProperties() { return [ 'border-image-source' ]; }; |
| paint(ctx, geom, styleMap) { |
| ctx.drawImage(styleMap.get('border-image-source'), 0, 0); |
| } |
| }); |
| </script> |
| |
| <script> |
| importPaintWorkletAndTerminateTestAfterAsyncPaint(document.getElementById('code').textContent); |
| </script> |