Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / canvas / patternfill-repeat-expected.html
blob4272fc09e7d288037f0b7779d8c39ccafab608f1
1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4 <title>createPattern repeat test</title>
5 <style> canvas { border:solid #000 } </style>
6 <script>
7 if (window.testRunner) {
8 testRunner.waitUntilDone();
10 window.onload = function(){
11 var i = new Image();
12 i.src = "resources/apple.gif";
13 i.onload = function() {
14 var ctx = document.getElementsByTagName('canvas')[0].getContext('2d');
16 var w = i.width;
17 var h = i.height;
18 //ctx.strokeWidth(1.0);
19 ctx.translate(10, 10);
20 ctx.save();
21 ctx.beginPath();
22 ctx.rect(0, 0, 150, 150);
23 ctx.clip();
24 ctx.drawImage(i, 0, 0);
25 ctx.drawImage(i, 0, h);
26 ctx.drawImage(i, 0, 2*h);
27 ctx.drawImage(i, w, 0);
28 ctx.drawImage(i, w, h);
29 ctx.drawImage(i, w, 2*h);
30 ctx.drawImage(i, 2*w, 0);
31 ctx.drawImage(i, 2*w, h);
32 ctx.drawImage(i, 2*w, 2*h);
33 ctx.restore();
35 ctx.translate(0, 160);
36 ctx.save();
37 ctx.beginPath();
38 ctx.rect(0, 0, 150, 150);
39 ctx.clip();
40 ctx.drawImage(i, 0, 0);
41 ctx.drawImage(i, w, 0);
42 ctx.drawImage(i, 2*w, 0);
43 ctx.restore();
45 ctx.translate(160, 0);
46 ctx.save()
47 ctx.beginPath();
48 ctx.rect(0, 0, 150, 150);
49 ctx.clip();
50 ctx.drawImage(i, 0, 0);
51 ctx.restore();
53 ctx.translate(0, -160);
54 ctx.save();
55 ctx.beginPath();
56 ctx.rect(0, 0, 150, 150);
57 ctx.clip();
58 ctx.drawImage(i, 0, 0);
59 ctx.drawImage(i, 0, h);
60 ctx.drawImage(i, 0, 2*h);
61 ctx.restore();
63 if (window.testRunner)
64 testRunner.notifyDone();
67 </script>
68 </head>
69 <body>
70 <p>There should be one big square below containing four squares. Top left square should be filled with 3 rows of 2 and bit Apple images. Top right square should be 2 and a bit rows with one Apple image column along the left edge of the square. Bottom left square should be one row with three Apple images along the top of the square. Bottom right square should be one Apple image in top left corner.</p>
71 <p><canvas height="330" width="330"></canvas></p>
72 </body>
73 </html>