Bug 1420547: Fix removal of <area> elements from an image map. r?bz
This code was relying on nsImageFrame::ContentRemoved running before it.
MozReview-Commit-ID: Imjhd9exjQS
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -8433,16 +8433,17 @@ nsCSSFrameConstructor::ContentRemoved(ns
}
}
#endif
nsIFrame* childFrame = aChild->GetPrimaryFrame();
if (!childFrame || childFrame->GetContent() != aChild) {
// XXXbz the GetContent() != aChild check is needed due to bug 135040.
// Remove it once that's fixed.
+ childFrame = nullptr;
UnregisterDisplayNoneStyleFor(aChild, aContainer);
}
MOZ_ASSERT(!childFrame || !GetDisplayContentsStyleFor(aChild),
"display:contents nodes shouldn't have a frame");
if (!childFrame && GetDisplayContentsStyleFor(aChild)) {
if (HasGeneratedContent(aChild)) {
nsIContent* ancestor = aChild->GetFlattenedTreeParent();
MOZ_ASSERT(ancestor, "display: contents on the root?");