| Chromium WPT Sync | 812fde4 | 2017-06-13 12:55:58 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <html class="reftest-wait"> |
| 3 | <link rel="match" href="background-image-multiple-ref.html"> |
| 4 | <style> |
| 5 | #output { |
| 6 | width: 100px; |
| 7 | height: 100px; |
| 8 | background-image: paint(n0), paint(n1), paint(n2); |
| 9 | } |
| 10 | </style> |
| 11 | <script src="/common/reftest-wait.js"></script> |
| 12 | <script src="/common/css-paint-tests.js"></script> |
| 13 | <body> |
| 14 | <div id="output"></div> |
| 15 | |
| 16 | <script id="code" type="text/worklet"> |
| 17 | var colors = ['red', 'green', 'blue']; |
| 18 | |
| 19 | for (let i = 0; i < 3; i++) { |
| 20 | registerPaint('n' + i, class { |
| 21 | paint(ctx, geom) { |
| 22 | ctx.fillStyle = colors[i]; |
| 23 | ctx.fillRect(i * 20, i * 20, 40, 40); |
| 24 | } |
| 25 | }); |
| 26 | } |
| 27 | </script> |
| 28 | |
| 29 | <script> |
| 30 | importPaintWorkletAndTerminateTestAfterAsyncPaint(document.getElementById('code').textContent); |
| 31 | </script> |
| 32 | </body> |
| 33 | </html> |