Chromium Code Reviews| Index: LayoutTests/fast/canvas/canvas-unballanced-save.html |
| diff --git a/LayoutTests/fast/canvas/canvas-unballanced-save.html b/LayoutTests/fast/canvas/canvas-unballanced-save.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..bc564529f9b3b356c7a1b90e8d28a8040fcdd3aa |
| --- /dev/null |
| +++ b/LayoutTests/fast/canvas/canvas-unballanced-save.html |
| @@ -0,0 +1,31 @@ |
| +<!DOCTYPE html> |
| +<script> |
| +var ctx; |
| +window.onload = function () { |
| + if (window.testRunner) { |
| + testRunner.waitUntilDone(); |
| + } |
| + ctx = document.getElementById('c').getContext('2d'); |
| + ctx.fillStyle = 'green'; |
| + ctx.fillRect(0, 0, 100, 100); |
| + ctx.save(); |
| + ctx.translate(10, 0); |
| + requestAnimationFrame(blueSquare); |
| +} |
| + |
| +function blueSquare() { |
| + ctx.fillStyle = 'blue'; |
| + ctx.fillRect(0, 10, 80, 80); |
| + requestAnimationFrame(redSquare); |
| +} |
| + |
| +function redSquare() { |
| + ctx.fillStyle = 'red'; |
| + ctx.fillRect(10, 20, 60, 60); |
| + if (window.testRunner) { |
| + testRunner.notifyDone(); |
| + } |
|
Stephen White
2014/10/16 17:40:47
Nit: weird indentation here.
Justin Novosad
2014/10/16 18:05:01
Looks like presubmit script does not warn about ta
|
| +} |
| +</script> |
| +<p>The canvas below should contain green, blue and red nested squares, all centered with respect to each other.</p> |
| +<canvas id="c" width="100" height="100"></canvas> |