Bug 1522987 - Cleanup frames for areas properly. r=bzbarsky a=lizzard
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 06 Feb 2019 16:10:02 +0000
changeset 515974 18d342734441414af9da34766ab764867714e955
parent 515973 6285113cbb139f05a2aae7a218e77a2f4bc64cde
child 515975 f222bec68b2672907576a15518af61e8bd6de88d
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbzbarsky, lizzard
bugs1522987
milestone66.0
Bug 1522987 - Cleanup frames for areas properly. r=bzbarsky a=lizzard Differential Revision: https://phabricator.services.mozilla.com/D17694
layout/generic/nsImageMap.cpp
--- a/layout/generic/nsImageMap.cpp
+++ b/layout/generic/nsImageMap.cpp
@@ -620,20 +620,17 @@ nsresult nsImageMap::GetBoundsForAreaCon
       area->GetRect(mImageFrame, aBounds);
       return NS_OK;
     }
   }
   return NS_ERROR_FAILURE;
 }
 
 void nsImageMap::AreaRemoved(HTMLAreaElement* aArea) {
-  if (aArea->IsInUncomposedDoc()) {
-    NS_ASSERTION(aArea->GetPrimaryFrame() == mImageFrame,
-                 "Unexpected primary frame");
-
+  if (aArea->GetPrimaryFrame() == mImageFrame) {
     aArea->SetPrimaryFrame(nullptr);
   }
 
   aArea->RemoveSystemEventListener(NS_LITERAL_STRING("focus"), this, false);
   aArea->RemoveSystemEventListener(NS_LITERAL_STRING("blur"), this, false);
 }
 
 void nsImageMap::FreeAreas() {