diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index cda4f6ca668e..60805cc8a745 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -763,14 +763,7 @@ nsFrame::DestroyFrom(nsIFrame* aDestructRoot, PostDestroyData& aPostDestroyData) } } - // XXXneerja All instances of 'mContent->GetPrimaryFrame() == this' have been - // replaced with IsPrimaryFrame() except for this one. The reason is that - // for native anonymous content our subclass Destroy method has already - // called UnbindFromTree so nsINode::mSubtreeRoot might be in use here and - // we don't want to call mContent->SetPrimaryFrame(nullptr) in that case. - // (bug 1400618 will fix that order) - bool isPrimaryFrame = (mContent && mContent->GetPrimaryFrame() == this); - if (isPrimaryFrame) { + if (IsPrimaryFrame()) { // This needs to happen before we clear our Properties() table. ActiveLayerTracker::TransferActivityToContent(this, mContent); @@ -825,7 +818,7 @@ nsFrame::DestroyFrom(nsIFrame* aDestructRoot, PostDestroyData& aPostDestroyData) } // Make sure that our deleted frame can't be returned from GetPrimaryFrame() - if (isPrimaryFrame) { + if (IsPrimaryFrame()) { mContent->SetPrimaryFrame(nullptr); // Pass the root of a generated content subtree (e.g. ::after/::before) to