22 lines
491 B
HTML
22 lines
491 B
HTML
<!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, 50, 50, 0, 0, 50, 50);
|
|
if (window.testRunner)
|
|
testRunner.notifyDone();
|
|
};
|
|
|
|
image.src = '../css/resources/greenbox-100px.png';
|
|
</script>
|
|
</body>
|
|
</html>
|