<!DOCTYPE html> | |
<html> | |
<body> | |
<p>Tests that the source rect is clipped when outside the image rect.</p> | |
<canvas id='target' width='100px' height='100px'></canvas> | |
<script> | |
if (window.testRunner) | |
testRunner.waitUntilDone(); | |
var image = new Image(); | |
image.onload = function () { | |
target.getContext('2d').drawImage(image, 50, 50, 100, 100, 0, 0, 100, 100); | |
if (window.testRunner) | |
testRunner.notifyDone(); | |
}; | |
image.src = '../css/resources/greenbox-100px.png'; | |
</script> | |
</body> | |
</html> |