Bug Tracker

Opened 12 years ago

Closed 12 years ago

#6971 closed bug (wontfix)

Chrome optimization avoids load events

Reported by: vegetablebread Owned by:
Priority: low Milestone: 1.4.3
Component: unfiled Version: 1.4.2
Keywords: webkit image load Cc:
Blocked by: Blocking:


Google's chrome browser will not load a new image if the image's src attribute is set to the same value, although all other browsers will. Example:

$('#image_id').load(function(){alert('test');}); $('#image_id').attr('src',path); $('#image_id').attr('src',path);

Change History (3)

comment:1 Changed 12 years ago by dmethvin

Your particular example might actually abort the previous request and start a new one since it doesn't wait for the first load. If it does fail to fire on a cached request, I'm not sure there's anything we can do about it inside jQuery. We could document it in the .load() api page I suppose.

comment:2 Changed 12 years ago by snover

Priority: undecided

All WebKits act the same way here and do not fire any events if you are setting the src of an image to the same value that is already set. There was some work to try to normalize image load events cross-browser, but in these cases, the behaviour will end up being normalized to match WebKit behaviour.

comment:3 Changed 12 years ago by addyosmani

Keywords: webkit image load added
Priority: undecidedlow
Resolution: wontfix
Status: newclosed

Making a note to consider documenting this behavior in the API docs. As it would appear that the behavior listed would in any case be reverting to match Webkit's standard handling of the load events for the image src, it doesn't appear that there is much more we can do to resolve this particular ticket without breaking what Webkit expects to happen. Closing for now but I leave it open for another triage member to reopen if they feel otherwise.

Note: See TracTickets for help on using tickets.