I am confused why this interface needs the parameter "format":
void texImage2D(GLenum target, GLint level, GLenum internalformat,GLenum format, GLenum type, ImageData pixels);
I can not find a way to get the format of a Image object using javascript.
So to load a Image into a texture I have to assume the image has a specified format.
Why not remove the parameter "format" from the interface and just let the browser implementation to check it automatically so that the developers can load any supported format into one texture.