Fix crash when we do a ReconstructDocElementHierarchy on a XUL document, which destroys the nsDocElementBoxFrame (which constructs the popupset) but not the nsRootBoxFrame. b=156719 r=waterson sr=ben a=asa

This commit is contained in:
dbaron%fas.harvard.edu 2002-07-12 01:46:20 +00:00
Родитель e3b908170b
Коммит 725f1e7cab
1 изменённых файлов: 6 добавлений и 3 удалений

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

@ -289,9 +289,12 @@ nsRootBoxFrame::GetPopupSetFrame(nsIFrame** aResult)
NS_IMETHODIMP
nsRootBoxFrame::SetPopupSetFrame(nsIFrame* aPopupSet)
{
NS_ASSERTION(!mPopupSetFrame, "Popup set is already defined! Only 1 allowed.");
if (!mPopupSetFrame)
mPopupSetFrame = aPopupSet;
// Under normal conditions this should only be called once. However,
// if something triggers ReconstructDocElementHierarchy, we will
// destroy this frame's child (the nsDocElementBoxFrame), but not this
// frame. Since the anonymous content is associated with the
// nsDocElementBoxFrame, we'll get a new popupset.
mPopupSetFrame = aPopupSet;
return NS_OK;
}