Bug 1522987 - Cleanup frames for areas properly. r=bzbarsky
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 06 Feb 2019 16:10:02 +0000
changeset 458750 bac61e8bf3a1
parent 458749 cea0ec7278c1
child 458751 e4db508a2d78
push id35548
push useropoprus@mozilla.com
push dateWed, 13 Feb 2019 09:48:26 +0000
treeherdermozilla-central@93e37c529818 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbzbarsky
bugs1522987
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1522987 - Cleanup frames for areas properly. r=bzbarsky 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() {