<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - ctx.drawImage fails silently if arguments are non-integers"
href="https://bugs.webkit.org/show_bug.cgi?id=160804">160804</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>ctx.drawImage fails silently if arguments are non-integers
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr>
<tr>
<th>Product</th>
<td>WebKit
</td>
</tr>
<tr>
<th>Version</th>
<td>Safari Technology Preview
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Macintosh
</td>
</tr>
<tr>
<th>OS</th>
<td>OS X 10.11
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>Major
</td>
</tr>
<tr>
<th>Priority</th>
<td>P2
</td>
</tr>
<tr>
<th>Component</th>
<td>Canvas
</td>
</tr>
<tr>
<th>Assignee</th>
<td>webkit-unassigned@lists.webkit.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>richard.a.harris@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dino@apple.com
</td>
</tr></table>
<p>
<div>
<pre>Overview:
Using ctx.drawImage(image, sx, sy, swidth, sheight, dx, dy, dwidth, dheight), where ctx is a CanvasRenderingContext2D, fails if any of sx, sy, swidth or sheight are non-integers. No error is given.
Steps to Reproduce:
Create an HTML page with the following code, and open it in Safari or Safari Technology Preview:
<canvas id='target' width='100' height='100'/>
<script>
image = new Image();
image.onload = function () {
// Changing 0.1 to 0 will cause the image to appear
target.getContext( '2d' ).drawImage( image, 0.1, 0, 100, 100, 0, 0, 100, 100 );
};
image.src = '<a href="http://placehold.it/100x100">http://placehold.it/100x100</a>';
</script>
Actual Results:
The canvas remains blank.
Expected Results:
The image is drawn to the canvas (albeit possibly with some sampling artifacts).
Build Date & Platform: Date and platform of the build in which you first encountered the bug.
Safari Version 9.1.2 (11601.7.7) on Mac OS 10.
Additional Information:
This works as expected in all other browsers. The dx, dy, dwidth and dheight arguments work whether or not they are integers.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>