OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script> | 3 <script> |
4 function testOne(operation, quirk) | 4 function testOne(operation) |
5 { | 5 { |
6 if (window.testRunner){ | 6 var context = document.getElementById(operation).getContext('2d'); |
7 » » testRunner.dumpAsTextWithPixelResults(); | |
8 if (testRunner.setUseDashboardCompatibilityMode) | |
9 testRunner.setUseDashboardCompatibilityMode(quirk); | |
10 } | |
11 | 7 |
12 var canvas = document.getElementById(operation + "-" + (quirk ? "" : "no-")
+ "quirk"); | 8 context.fillStyle = "red"; |
13 var context = canvas.getContext('2d'); | |
14 | |
15 context.fillStyle = quirk ? "green" : "red"; | |
16 context.fillRect(0, 0, 1000, 1000); | 9 context.fillRect(0, 0, 1000, 1000); |
17 | 10 |
18 context.moveTo(0, 0); | 11 context.moveTo(0, 0); |
19 context.lineTo(0, 1000); | 12 context.lineTo(0, 1000); |
20 context.lineTo(1000, 1000); | 13 context.lineTo(1000, 1000); |
21 context.lineTo(1000, 0); | 14 context.lineTo(1000, 0); |
22 context.closePath(); | 15 context.closePath(); |
23 context[operation](); | 16 context[operation](); |
24 | 17 |
25 context.fillStyle = quirk ? "red" : "green"; | 18 context.fillStyle = "green"; |
26 context.fill(); | 19 context.fill(); |
27 } | 20 } |
28 function test() | 21 function test() |
29 { | 22 { |
30 testOne("fill", false); | 23 testOne("fill"); |
31 testOne("stroke", false); | 24 testOne("stroke"); |
32 testOne("clip", false); | 25 testOne("clip"); |
33 testOne("fill", true); | |
34 testOne("stroke", true); | |
35 testOne("clip", true); | |
36 } | 26 } |
37 </script> | 27 </script> |
38 </head> | 28 </head> |
39 <body onload="test()"> | 29 <body onload="test()"> |
40 <p>All three of these small canvases should be green, not red.</p> | 30 <p>All three of these small canvases should be green, not red.</p> |
41 <canvas id="fill-no-quirk" width="20" height="20"></canvas> | 31 <canvas id="fill" width="20" height="20"></canvas> |
42 <canvas id="stroke-no-quirk" width="20" height="20"></canvas> | 32 <canvas id="stroke" width="20" height="20"></canvas> |
43 <canvas id="clip-no-quirk" width="20" height="20"></canvas> | 33 <canvas id="clip" width="20" height="20"></canvas> |
44 <p>All three of these small canvases should be green, not red, too, but these te
st the Dashboard compatibility mode so they work properly only under DumpRenderT
ree.</p> | |
45 <canvas id="fill-quirk" width="20" height="20"></canvas> | |
46 <canvas id="stroke-quirk" width="20" height="20"></canvas> | |
47 <canvas id="clip-quirk" width="20" height="20"></canvas> | |
48 </body> | 34 </body> |
49 </html> | 35 </html> |
OLD | NEW |