I’m mucking around with the canvas element and drawing, and a simple rectangle renders fewer pixels than it should. I can’t figure out why – happens in the latest Firefox, Safari and Mobile Safari browsers. I would expect this to fill the entire canvas.

<html>
<body>
<canvas id="draw" style="width:100px;height:100px;border:1px solid #f00;"
onClick="doDraw(event)">
</canvas>
<script>
function doDraw(ev) {
console.log(ev.clientX,ev.clientY);
var el = document.getElementById('draw');
var ctx = el.getContext('2d');
ctx.fillRect(0,0,100,100);
}
</script>
</body>
</html>
needs to be
you are modifying the style of the container, not the container. If that makes sense.