Ticket #1316 (closed bug: fixed)

Opened 5 years ago

Last modified 5 years ago

map.removeControl sometimes chokes in IE

Reported by: tschaub Owned by:
Priority: minor Milestone: 2.6 Release
Component: Map Version: 2.5
Keywords: Cc:
State: Complete

Description

When a page unloads, map.removeControl is called for all controls. We check if control.outsideViewport before trying to remove control.div from map.viewportDiv. Though this seems like a sufficient check, the real check is to see if control.div.parentNode is map.viewportDiv before trying to remove child from parent.

Attachments

removeControl.patch Download (0.6 KB) - added by tschaub 5 years ago.
safer dom cleanup

Change History

Changed 5 years ago by tschaub

safer dom cleanup

Changed 5 years ago by tschaub

  • state set to Review

Aside from the failure of the OSM tests in IE, all tests pass in FF, IE6, and IE7.

Please review.

Changed 5 years ago by crschmidt

  • state changed from Review to Commit

Yeah, this probably means that our displayOutsideViewport check is wrong in some cases, but whatev. This is the right check to make, rather than depending on a hueristic that people can break.

Changed 5 years ago by tschaub

Yeah, that was my initial concern, and I dug around a bit to see if we were messing up in an obvious way. The alternative explanation is that the div might already be removed from the viewport by other means (the page is closing, who knows how the browser deconstructs the dom).

Changed 5 years ago by tschaub

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

(In [5973]) Explicitly check that we know who the parent is before removing child from parent. r=crschmidt (closes #1316)

Note: See TracTickets for help on using tickets.