non-registered-property-value.https.html (933B)
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="parse-input-arguments-ref.html"> 5 <style> 6 .container { 7 width: 100px; 8 height: 100px; 9 } 10 11 #canvas-geometry { 12 --foo:100; 13 background-image: paint(geometry); 14 } 15 </style> 16 <script src="/common/reftest-wait.js"></script> 17 <script src="/common/worklet-reftest.js"></script> 18 <body> 19 <div id="canvas-geometry" class="container"></div> 20 21 <script id="code" type="text/worklet"> 22 registerPaint('geometry', class { 23 static get inputProperties() { return ['--foo']; } 24 paint(ctx, geom, properties) { 25 let fooValue = parseFloat(properties.get('--foo').toString()); 26 ctx.fillStyle = 'green'; 27 ctx.fillRect(0, 0, fooValue, fooValue); 28 } 29 }); 30 </script> 31 32 <script> 33 importWorkletAndTerminateTestAfterAsyncPaint(CSS.paintWorklet, document.getElementById('code').textContent); 34 </script> 35 </body> 36 </html>