| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <script src="../resources/run-after-layout-and-paint.js"></script> |
| 5 <style> |
| 6 #output { |
| 7 width: 100px; |
| 8 height: 100px; |
| 9 background-image: paint(green); |
| 10 background-color: red; |
| 11 } |
| 12 </style> |
| 13 </head> |
| 14 <body> |
| 15 <div id="output"></div> |
| 16 |
| 17 <script id="code" type="text/worklet"> |
| 18 registerPaint('green', class { |
| 19 paint(ctx) { |
| 20 ctx.fillStyle = 'green'; |
| 21 ctx.fillRect(0, 0, 100, 100); |
| 22 } |
| 23 }); |
| 24 </script> |
| 25 |
| 26 <script> |
| 27 if (window.testRunner) { |
| 28 testRunner.waitUntilDone(); |
| 29 } |
| 30 |
| 31 var blob = new Blob([document.getElementById('code').textContent]); |
| 32 paintWorklet.import(URL.createObjectURL(blob)).then(function() { |
| 33 runAfterLayoutAndPaint(function() { |
| 34 if (window.testRunner) { |
| 35 testRunner.notifyDone(); |
| 36 } |
| 37 }); |
| 38 }); |
| 39 </script> |
| 40 </body> |
| 41 </html> |
| OLD | NEW |