background-image-tiled.https.html (1124B)
1 <!DOCTYPE html> 2 <html class="reftest-wait"> 3 <link rel="help" href="https://drafts.css-houdini.org/css-paint-api/"> 4 <link rel="match" href="background-image-tiled-ref.html"> 5 <style> 6 div { 7 display: inline-block; 8 width: 100px; 9 height: 100px; 10 } 11 12 #one { 13 background: 14 paint(ellipse) top left/50% 50% repeat-x, 15 paint(ellipse) bottom left/100% 50% no-repeat; 16 } 17 18 #two { 19 background: 20 paint(ellipse) top left/50% 20% repeat-y, 21 paint(ellipse) center right/50% 50% no-repeat; 22 } 23 </style> 24 <script src="/common/reftest-wait.js"></script> 25 <script src="/common/worklet-reftest.js"></script> 26 <body> 27 <div id="one"></div> 28 <div id="two"></div> 29 30 <script id="code" type="text/worklet"> 31 registerPaint('ellipse', class { 32 paint(ctx, geom) { 33 ctx.fillStyle = 'green'; 34 ctx.beginPath(); 35 ctx.rect(0, 0, geom.width, geom.height); 36 ctx.fill(); 37 } 38 }); 39 </script> 40 41 <script> 42 importWorkletAndTerminateTestAfterAsyncPaint(CSS.paintWorklet, document.getElementById('code').textContent); 43 </script> 44 </body> 45 </html>