Bug 694503 - image map doesn't get updated when map element is removed as part of container subtree, r=bz

This commit is contained in:
Olli Pettay
2011-10-29 13:44:50 +03:00
parent 033ce45158
commit 118e2c36b1
6 changed files with 111 additions and 8 deletions

View File

@@ -204,16 +204,22 @@ nsImageFrame::CreateAccessible()
}
#endif
void
nsImageFrame::DisconnectMap()
{
if (mImageMap) {
mImageMap->Destroy();
NS_RELEASE(mImageMap);
}
}
void
nsImageFrame::DestroyFrom(nsIFrame* aDestructRoot)
{
// Tell our image map, if there is one, to clean up
// This causes the nsImageMap to unregister itself as
// a DOM listener.
if (mImageMap) {
mImageMap->Destroy();
NS_RELEASE(mImageMap);
}
DisconnectMap();
// set the frame to null so we don't send messages to a dead object.
if (mListener) {