| 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(worklet); | |
| 11 } | |
| 12 </style> | |
| 13 </head> | |
| 14 <body> | |
| 15 <div id="output"></div> | |
| 16 | |
| 17 <script id="code" type="text/worklet"> | |
| 18 registerPaint('worklet', class { | |
| 19 paint(ctx, geom) { | |
| 20 ctx.rotate(10 * Math.PI / 180); | |
| 21 ctx.strokeStyle = 'blue'; | |
| 22 ctx.lineWidth = 4; | |
| 23 ctx.strokeRect(30, 10, 30, 30); | |
| 24 console.log('width: ' + geom.width + ', height: ' + geom.height); | |
| 25 } | |
| 26 }); | |
| 27 </script> | |
| 28 | |
| 29 <script> | |
| 30 document.body.style.zoom = "300%"; | |
| 31 console.log('The worklet should log: \'width: 100, height: 100\''); | |
| 32 importPaintWorkletAndTerminateTestAfterAsyncPaint(document.getElementById('c
ode').textContent); | |
| 33 </script> | |
| 34 </body> | |
| 35 </html> | |
| OLD | NEW |