Bug 1420547: Fix removal of <area> elements from an image map. r=bz
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 13 Dec 2017 01:58:48 +0100
changeset 397085 e482d3fc80e40910ee6944beb5b4f2e889d0d93c
parent 397084 46e5fc9628c836db4236cc9c4e6481bfb547e40a
child 397086 04a9c149d299878293af6551518e0eb42df11f18
push id57264
push userecoal95@gmail.com
push dateThu, 21 Dec 2017 03:01:09 +0000
treeherderautoland@24e90541f056 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1420547
milestone59.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 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
layout/base/nsCSSFrameConstructor.cpp
--- 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?");