| 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: 200px; | |
| 9 height: 100px; | |
| 10 background-image: paint(shadows); | |
| 11 } | |
| 12 </style> | |
| 13 </head> | |
| 14 <body> | |
| 15 <div id="output"></div> | |
| 16 | |
| 17 <script id="code" type="text/worklet"> | |
| 18 registerPaint('shadows', class { | |
| 19 paint(ctx, geom) { | |
| 20 ctx.shadowColor = 'black'; | |
| 21 ctx.shadowOffsetY = 10; | |
| 22 ctx.shadowOffsetX = 10; | |
| 23 ctx.fillStyle = 'green' | |
| 24 ctx.fillRect(10, 10, 50, 50); | |
| 25 | |
| 26 ctx.shadowColor = 'blue'; | |
| 27 ctx.shadowBlur = 10; | |
| 28 ctx.shadowOffsetX = 5; | |
| 29 ctx.shadowOffsetY = 5; | |
| 30 ctx.fillStyle = 'green'; | |
| 31 ctx.fillRect(110, 10, 50, 50); | |
| 32 } | |
| 33 }); | |
| 34 </script> | |
| 35 | |
| 36 <script> | |
| 37 importPaintWorkletAndTerminateTestAfterAsyncPaint(document.getElementById('c
ode').textContent); | |
| 38 </script> | |
| 39 </body> | |
| 40 </html> | |
| OLD | NEW |