| Index: third_party/WebKit/LayoutTests/csspaint/paint2d-paths.html
|
| diff --git a/third_party/WebKit/LayoutTests/csspaint/paint2d-paths.html b/third_party/WebKit/LayoutTests/csspaint/paint2d-paths.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..20f86d9826d7a5d127e4a6ccbe26e826a6478f5a
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/csspaint/paint2d-paths.html
|
| @@ -0,0 +1,60 @@
|
| +<!DOCTYPE html>
|
| +<html>
|
| +<head>
|
| +<script src="../resources/run-after-layout-and-paint.js"></script>
|
| +<style>
|
| + #output {
|
| + width: 200px;
|
| + height: 400px;
|
| + background-image: paint(paths);
|
| + }
|
| +</style>
|
| +</head>
|
| +<body>
|
| +<div id="output"></div>
|
| +
|
| +<script id="code" type="text/worklet">
|
| +registerPaint('paths', class {
|
| + paint(ctx) {
|
| + ctx.beginPath();
|
| + ctx.lineWidth = '10';
|
| + ctx.strokeStyle = 'green';
|
| + ctx.lineJoin = 'round';
|
| + ctx.moveTo(15, 15);
|
| + ctx.lineTo(135, 15);
|
| + ctx.lineTo(70, 170);
|
| + ctx.closePath();
|
| + ctx.stroke();
|
| +
|
| + var path1 = new Path2D();
|
| + path1.moveTo(150, 25);
|
| + path1.bezierCurveTo(10, 150, 10, 300, 100, 200);
|
| + ctx.strokeStyle = 'purple';
|
| + ctx.setLineDash([ 10, 5 ]);
|
| + ctx.stroke(path1);
|
| +
|
| + ctx.fillStyle = 'red';
|
| + ctx.beginPath()
|
| + ctx.arc(75, 325, 50, 0, Math.PI * 2, true);
|
| + ctx.arc(75, 325, 20, 0, Math.PI * 2, true);
|
| + ctx.fill("evenodd");
|
| + }
|
| +});
|
| +</script>
|
| +
|
| +<script>
|
| +if (window.testRunner) {
|
| + testRunner.waitUntilDone();
|
| +}
|
| +
|
| +var blob = new Blob([document.getElementById('code').textContent]);
|
| +paintWorklet.import(URL.createObjectURL(blob)).then(function() {
|
| + runAfterLayoutAndPaint(function() {
|
| + if (window.testRunner) {
|
| + testRunner.notifyDone();
|
| + }
|
| + });
|
| +});
|
| +</script>
|
| +</body>
|
| +</html>
|
|
|