Ticket #842 (closed bug: fixed)

Opened 6 years ago

Last modified 5 years ago

Tile.Image should register for abort and cancel events as well as load events

Reported by: crschmidt Owned by:
Priority: minor Milestone: 2.6 Release
Component: Tile.Image Version: 2.4
Keywords: Cc:
State: Complete

Description

Currently, tile.image does not always correctly report when tiles are loaded, because it does not listen for abort or error events. These should be added, probably in initImgDiv, so that these events fire the loadend for the tile.

Attachments

onabort.html Download (0.7 KB) - added by ahocevar 6 years ago.
Simple html page to prove that the onabort event only works in IE. To try, press ESC shortly after saying "ok" to the "start" alert box.
Image.js.patch Download (1.1 KB) - added by ahocevar 5 years ago.

Change History

follow-up: ↓ 3   Changed 6 years ago by crschmidt

Okay, cancel and abort events don't seem to do anything in Firefox. Either that, or I'm crazy -- not sure which. Anyone know anything about this?

  Changed 6 years ago by crschmidt

  • milestone changed from 2.5 Release to 2.6 Release

Bumping this for 2.6 investigation -- I'm not going to make the time to dig into it before then.

Changed 6 years ago by ahocevar

Simple html page to prove that the onabort event only works in IE. To try, press ESC shortly after saying "ok" to the "start" alert box.

in reply to: ↑ 1   Changed 6 years ago by ahocevar

Replying to crschmidt:

Okay, cancel and abort events don't seem to do anything in Firefox. Either that, or I'm crazy -- not sure which. Anyone know anything about this?

I just spent some time investigating this. The onabort event really does not work in Firefox, Opera and Safari. The attached file "onabort.html" proves this. I also tried to set the img.onabort property directly, which was unsuccessful either. Setting the onabort attribute in the html img tag also does not lead to the expected behaviour.

  Changed 6 years ago by ahocevar

  • keywords review added

I created a patch, as proposed in the initial issue description, to take care of the onerror event. Because the onabort event only seems to work in IE, I did not take care about that.

follow-up: ↓ 6   Changed 5 years ago by crschmidt

  • keywords review removed

Andreas:

I think this should be 'this.onload()' in the function call, no? We have this bound via the Observe -- I think we should be using it?

in reply to: ↑ 5   Changed 5 years ago by ahocevar

  • keywords review added

Replying to crschmidt:

Andreas: I think this should be 'this.onload()' in the function call, no? We have this bound via the Observe -- I think we should be using it?

No but yes. It is defined as var onload = function() {...} , but in the context of Image. So I had to change the patch to do onload.call(this); instead of just onload();.

Changed 5 years ago by ahocevar

  Changed 5 years ago by crschmidt

  • status changed from new to closed
  • state changed from Review to Complete
  • resolution set to fixed

(In [5428]) Tile.Image should register for error events with respect to tile loading events -- this means that if an image fails to load, it will still trigger a loadend event, and the layer will eventually be in a state where it is no longer waiting to load. Thanks to Andreas for the investigation! (Closes #842)

Note: See TracTickets for help on using tickets.