[whatwg] ProgressEvents for Images

Glenn Maynard glenn at zewt.org
Fri Feb 24 09:50:09 PST 2012


It seems odd that loadend is considered useful enough to be recommended by
Progress Events, but not useful enough to be used here.

As an aside, it's odd that if images are unsupported or disabled, no event
is fired at all ("update the image data", step 4).  That means that if you
do this:

var url = URL.createObjectURL(blob);
img.src = url;
img.onload = img.onerror = function(e) { URL.revokeObjectURL(url); }

the blob will leak a reference if images are disabled.  This seems like a
very easy mistake to make, with no clean workaround...

-- 
Glenn Maynard



More information about the whatwg mailing list