Index: LayoutTests/canvas/state-stack.html |
diff --git a/LayoutTests/canvas/state-stack.html b/LayoutTests/canvas/state-stack.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..710b897e832756da2ea3595c0e720ffc401ddd04 |
--- /dev/null |
+++ b/LayoutTests/canvas/state-stack.html |
@@ -0,0 +1,51 @@ |
+<!DOCTYPE html> |
+<title>Canvas.drawImage with narrow destination.</title> |
zino
2014/09/03 10:50:17
nit: This should be in <head></head>.
Sergey
2014/09/11 12:58:52
Layout test re-written.
|
+<html> |
+ <body> |
+ <canvas id="myCanvas" width="100" height="100"></canvas> |
+ <script> |
+ var canvas = document.getElementById('myCanvas'); |
+ var context = canvas.getContext('2d'); |
+ var width = 100, height = 100; |
+ var x1 = 0, y1 = 0, w = width, h = height; |
+ |
+ function draw() { |
+ context.restore(); |
+ context.clearRect(0, 0, width, height); |
+ context.beginPath(); |
+ context.rect(x1, y1, w, h); |
+ context.fillStyle = 'blue'; |
+ context.fill(); |
+ x1+=5; |
+ y1+=5; |
+ w-=10; |
+ h-=10; |
+ |
+ context.save(); |
+ context.beginPath(); |
+ context.rect(200, 200, 400, 400); |
+ context.clip(); |
+ |
+ if (w > 0) { |
+ setTimeout(draw, 1); |
+ } else { |
+ finishTest('PASS'); |
+ } |
+ } |
+ |
+ context.beginPath(); |
+ context.rect(0, 0, 800, 800); |
+ context.fillStyle = 'blue'; |
+ context.fill(); |
+ context.save(); |
+ draw(); |
+ function finishTest(output) { |
+ document.write(output); |
+ if (window.testRunner) { |
+ testRunner.dumpAsText(); |
+ testRunner.notifyDone(); |
+ } |
+ } |
+ </script> |
+ </body> |
+</html> |