OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <script src="../resources/run-after-layout-and-paint.js"></script> |
| 5 <script src="resources/test-runner-paint-worklet.js"></script> |
| 6 <style> |
| 7 #output { |
| 8 width: 100px; |
| 9 height: 100px; |
| 10 background-image: paint(error); |
| 11 background-color: green; |
| 12 } |
| 13 </style> |
| 14 </head> |
| 15 <body> |
| 16 <div id="output"></div> |
| 17 |
| 18 <script id="code" type="text/worklet"> |
| 19 registerPaint('error', class { |
| 20 constructor() { throw Error('failed!'); } |
| 21 paint(ctx, geom) { |
| 22 ctx.fillStyle = 'red'; |
| 23 ctx.fillRect(0, 0, geom.width, geom.height); |
| 24 } |
| 25 }); |
| 26 </script> |
| 27 |
| 28 <script> |
| 29 importPaintWorkletAndTerminateTestAfterAsyncPaint(document.getElementById('c
ode').textContent); |
| 30 </script> |
| 31 |
| 32 </body> |
| 33 </html> |
OLD | NEW |