Bug 1400618 part 6 - Remove the workaround for the broken IsPrimaryFrame() in nsFrame::DestroyFrom since it now works also for NAC frames. r=bz

MozReview-Commit-ID: 1DFyWZBpzwP
This commit is contained in:
Mats Palmgren 2017-11-07 01:20:34 +01:00
Родитель c908bacce6
Коммит 652757273a
1 изменённых файлов: 2 добавлений и 9 удалений

Просмотреть файл

@ -763,14 +763,7 @@ nsFrame::DestroyFrom(nsIFrame* aDestructRoot, PostDestroyData& aPostDestroyData)
} }
} }
// XXXneerja All instances of 'mContent->GetPrimaryFrame() == this' have been if (IsPrimaryFrame()) {
// 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) {
// This needs to happen before we clear our Properties() table. // This needs to happen before we clear our Properties() table.
ActiveLayerTracker::TransferActivityToContent(this, mContent); 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() // Make sure that our deleted frame can't be returned from GetPrimaryFrame()
if (isPrimaryFrame) { if (IsPrimaryFrame()) {
mContent->SetPrimaryFrame(nullptr); mContent->SetPrimaryFrame(nullptr);
// Pass the root of a generated content subtree (e.g. ::after/::before) to // Pass the root of a generated content subtree (e.g. ::after/::before) to