diff options
Diffstat (limited to 'testing/web-platform/tests/css/css-paint-api/hidpi/canvas-reset.https.html')
-rw-r--r-- | testing/web-platform/tests/css/css-paint-api/hidpi/canvas-reset.https.html | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-paint-api/hidpi/canvas-reset.https.html b/testing/web-platform/tests/css/css-paint-api/hidpi/canvas-reset.https.html new file mode 100644 index 0000000000..d8073d6452 --- /dev/null +++ b/testing/web-platform/tests/css/css-paint-api/hidpi/canvas-reset.https.html @@ -0,0 +1,44 @@ +<!DOCTYPE html> +<html class="reftest-wait"> +<link rel="help" href="https://drafts.css-houdini.org/css-paint-api/"> +<link rel="match" href="canvas-reset-ref.html"> +<style> +.container { + width: 270px; + height: 275px; +} + +#canvas-geometry { + background-image: paint(geometry); +} +</style> +<script src="/common/reftest-wait.js"></script> +<script src="/common/worklet-reftest.js"></script> +<body> +<div id="canvas-geometry" class="container"></div> + +<script id="code" type="text/worklet"> +registerPaint('geometry', class { + paint(ctx, geom) { + // Set some transform then reset the canvas. + ctx.translate(20, 30); + ctx.scale(1.5, 2.5); + ctx.reset(); + + var fillW = 250; + var fillH = 50; + ctx.beginPath(); + ctx.rect(0, 0, fillW, fillH); + ctx.closePath(); + ctx.clip(); + ctx.fillStyle = 'green'; + ctx.fillRect(0, 0, fillW, fillH); + } +}); +</script> + +<script> + importWorkletAndTerminateTestAfterAsyncPaint(CSS.paintWorklet, document.getElementById('code').textContent); +</script> +</body> +</html> |