Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(298)

Side by Side Diff: third_party/WebKit/LayoutTests/csspaint/paint2d-paths.html

Issue 2868003002: CSSPaint: Move layout tests in csspaint/ to http/tests/csspaint/ (Closed)
Patch Set: rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../resources/run-after-layout-and-paint.js"></script>
5 <script src="resources/test-runner-paint-worklet.js"></script>
6 <style>
7 #output {
8 width: 300px;
9 height: 400px;
10 background-image: paint(paths);
11 }
12 </style>
13 </head>
14 <body>
15 <div id="output"></div>
16
17 <script id="code" type="text/worklet">
18 registerPaint('paths', class {
19 paint(ctx, geom) {
20 ctx.beginPath();
21 ctx.lineWidth = '10';
22 ctx.strokeStyle = 'green';
23 ctx.moveTo(15, 15);
24 ctx.lineTo(135, 15);
25 ctx.lineTo(70, 170);
26 ctx.closePath();
27 ctx.stroke();
28
29 var path1 = new Path2D();
30 path1.moveTo(250, 25);
31 path1.bezierCurveTo(110, 150, 110, 300, 200, 200);
32 ctx.strokeStyle = 'purple';
33 ctx.setLineDash([ 10, 5 ]);
34 ctx.stroke(path1);
35
36 ctx.fillStyle = 'red';
37 ctx.beginPath()
38 ctx.arc(75, 325, 50, 0, Math.PI * 2, true);
39 ctx.arc(75, 325, 20, 0, Math.PI * 2, true);
40 ctx.fill('evenodd');
41 }
42 });
43 </script>
44
45 <script>
46 importPaintWorkletAndTerminateTestAfterAsyncPaint(document.getElementById('c ode').textContent);
47 </script>
48 </body>
49 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698