Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/svg/canvas/canvas-default-object-sizing-expected.html |
| diff --git a/third_party/WebKit/LayoutTests/svg/canvas/canvas-default-object-sizing-expected.html b/third_party/WebKit/LayoutTests/svg/canvas/canvas-default-object-sizing-expected.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..082aaed78c42689e8a3fe42f06a7249d803e514a |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/svg/canvas/canvas-default-object-sizing-expected.html |
| @@ -0,0 +1,31 @@ |
| +<!DOCTYPE html> |
| +<title>Sizing SVG image when drawn to canvas</title> |
| +<script> |
| +function createCircle(x, y, r, sx, sy) |
| +{ |
| + sx = typeof sx !== 'undefined' ? sx : 1; |
|
fs
2016/02/23 11:44:23
Nit: Assuming we don't intend to pass 0, then mayb
davve
2016/02/23 13:15:30
Fixed in dependent CL.
|
| + sy = typeof sy !== 'undefined' ? sy : 1; |
| + |
| + var canvas = document.createElement('canvas'); |
| + canvas.width = 100; |
| + canvas.height = 100; |
| + document.documentElement.appendChild(canvas); |
| + |
| + var ctx = canvas.getContext('2d'); |
| + ctx.fillStyle = "blue"; |
| + |
| + ctx.translate(50, 50); |
| + ctx.scale(sx, sy); |
| + ctx.beginPath(); |
| + ctx.arc(x, y, r, 0, 2*Math.PI); |
| + ctx.fill(); |
| +} |
| +createCircle(0, 0, 50); |
| +createCircle(0, -25, 25); |
| +createCircle(-25, 0, 25); |
| +createCircle(0, 0, 25, 1, 2); |
| +createCircle(0, 0, 25, 2, 1); |
| +createCircle(-25, 0, 25); |
| +createCircle(0, -25, 25); |
| +createCircle(0, -25, 25); |
| +</script> |