blob: 671e10d581f86d76a8a998357a715bc40ce5724b [file] [log] [blame]
<html>
<head>
<script>
function testOne(operation, quirk)
{
if (window.testRunner){
testRunner.dumpAsText(true);
if (testRunner.setUseDashboardCompatibilityMode)
testRunner.setUseDashboardCompatibilityMode(quirk);
}
var canvas = document.getElementById(operation + "-" + (quirk ? "" : "no-") + "quirk");
var context = canvas.getContext('2d');
context.fillStyle = quirk ? "green" : "red";
context.fillRect(0, 0, 1000, 1000);
context.moveTo(0, 0);
context.lineTo(0, 1000);
context.lineTo(1000, 1000);
context.lineTo(1000, 0);
context.closePath();
context[operation]();
context.fillStyle = quirk ? "red" : "green";
context.fill();
}
function test()
{
testOne("fill", false);
testOne("stroke", false);
testOne("clip", false);
testOne("fill", true);
testOne("stroke", true);
testOne("clip", true);
}
</script>
</head>
<body onload="test()">
<p>All three of these small canvases should be green, not red.</p>
<canvas id="fill-no-quirk" width="20" height="20"></canvas>
<canvas id="stroke-no-quirk" width="20" height="20"></canvas>
<canvas id="clip-no-quirk" width="20" height="20"></canvas>
<p>All three of these small canvases should be green, not red, too, but these test the Dashboard compatibility mode so they work properly only under DumpRenderTree.</p>
<canvas id="fill-quirk" width="20" height="20"></canvas>
<canvas id="stroke-quirk" width="20" height="20"></canvas>
<canvas id="clip-quirk" width="20" height="20"></canvas>
</body>
</html>