Replace all references to canvas.width and
canvas.height with canvas.clientWidth and
canvas.clientHeight respectively, as per:
http://games.greggman.com/game/webgl-anti-patterns/