HTML 5 Gotchas

On this page I will place all of the gotchas that I come across during my HTML 5 developments.

IndexSizeError: Index or size is negative or greater than the allowed amount

I got this error Firefox and a similar error in Internet Explorer whilst drawing an image to the HTML 5 canvas using drawImage(). The problem turned out to be trying to draw a portion of an image that was outside its bounds. I was drawing what I thought was an 800×600 image, which was actually 798×600 so the source rectangular area that I was drawing was off the edge of the actual image. Doh!