Bug 1400618 part 1 - Collect NAC / generated content and call DestroyAnonymousContent / UnbindFromTree on those after the frames are destroyed. r=bz

MozReview-Commit-ID: 2trDgeJPw25
This commit is contained in:
Mats Palmgren
2017-11-07 01:20:33 +01:00
parent 26516bfdd9
commit 616f910f82
117 changed files with 300 additions and 256 deletions

View File

@@ -95,7 +95,7 @@ nsRangeFrame::Init(nsIContent* aContent,
}
void
nsRangeFrame::DestroyFrom(nsIFrame* aDestructRoot)
nsRangeFrame::DestroyFrom(nsIFrame* aDestructRoot, PostDestroyData& aPostDestroyData)
{
NS_ASSERTION(!GetPrevContinuation() && !GetNextContinuation(),
"nsRangeFrame should not have continuations; if it does we "
@@ -104,10 +104,10 @@ nsRangeFrame::DestroyFrom(nsIFrame* aDestructRoot)
mContent->RemoveEventListener(NS_LITERAL_STRING("touchstart"), mDummyTouchListener, false);
nsCheckboxRadioFrame::RegUnRegAccessKey(static_cast<nsIFrame*>(this), false);
DestroyAnonymousContent(mTrackDiv.forget());
DestroyAnonymousContent(mProgressDiv.forget());
DestroyAnonymousContent(mThumbDiv.forget());
nsContainerFrame::DestroyFrom(aDestructRoot);
aPostDestroyData.AddAnonymousContent(mTrackDiv.forget());
aPostDestroyData.AddAnonymousContent(mProgressDiv.forget());
aPostDestroyData.AddAnonymousContent(mThumbDiv.forget());
nsContainerFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
}
nsresult