[whatwg] <img> element: downloading a resource

Shadow2531 shadow2531 at gmail.com
Thu Nov 9 11:24:13 PST 2006


On 11/7/06, Alexey Feldgendler <alexey at feldgendler.ru> wrote:
> On Tue, 07 Nov 2006 15:39:56 +0600, Anne van Kesteren
> <fora at annevankesteren.nl> wrote:
>
> > The definition of downloading a resource must be clear that even if the
> > resource does not need to be downloaded (because it has been cached or
> > something) the load event still needs to be dispatched (or the error
> > event, in case it contains errors).
>
> Even for data: URIs?

I think so. Why should a data uri image be different?

> And what about
>
> img.src = img.src;
>
> ?

I also think so because IE, Firefox and Opera 8 fire a load event for
that. Opera 9 doesn't though, but it should.

If that's not a good enough reason to fire a load | error event:

Say if  you do img.src = img.src and the image is no longer at the
address and is not cached?  You'd want it to fire an error event
right?

Also img.src = img.src doesn't fire an onchange event ( not saying it
should ) so you can't use that to tell if the img.src setter was used.
 I guess you could use setAttribute and check for the attribute to be
modifed, but that still doesn't tell you when the image is fully
loaded or not.

That's my take on this.

-- 
burnout426



More information about the whatwg mailing list