Hmm… it seems that when creating an image, Mozilla doesn’t update the height after changing the source, but after a reload it does. This is strange. I could just replace the offset subtractions with the static dimensions, but hopefully I can also find out what the proper behavior is supposed to be (or if it’s even specified).

The specs are unclear on the behavior of this, so I switched to the older DOM constructor so I could pre-declare width/height there. This incidentally breaks Safari corner rendering (assigning document.createElement(“img”).style properties work, but the JS engine just stops on Image.style properties – the Image object doesn’t inherit from the DOM2 Element object?)