b=32301 r=buster@netscape.com Changed DeleteChildsNextInFlow() to also

check the frame's overflow list
This commit is contained in:
troy%netscape.com 2000-03-20 23:11:39 +00:00
Родитель 7c60538a3d
Коммит dd0024a1e8
2 изменённых файлов: 28 добавлений и 2 удалений

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

@ -807,7 +807,20 @@ nsContainerFrame::DeleteChildsNextInFlow(nsIPresContext* aPresContext,
// Take the next-in-flow out of the parent's child list
PRBool result = parent->mFrames.RemoveFrame(nextInFlow);
NS_ASSERTION(result, "failed to remove frame");
if (!result) {
// We didn't find the child in the parent's principal child list.
// Maybe it's on the overflow list?
nsFrameList overflowFrames(parent->GetOverflowFrames(aPresContext, PR_TRUE));
if (overflowFrames.IsEmpty() || !overflowFrames.RemoveFrame(nextInFlow)) {
NS_ASSERTION(result, "failed to remove frame");
}
// Set the overflow property again
if (overflowFrames.NotEmpty()) {
parent->SetOverflowFrames(aPresContext, overflowFrames.FirstChild());
}
}
// Delete the next-in-flow frame
nextInFlow->Destroy(aPresContext);

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

@ -807,7 +807,20 @@ nsContainerFrame::DeleteChildsNextInFlow(nsIPresContext* aPresContext,
// Take the next-in-flow out of the parent's child list
PRBool result = parent->mFrames.RemoveFrame(nextInFlow);
NS_ASSERTION(result, "failed to remove frame");
if (!result) {
// We didn't find the child in the parent's principal child list.
// Maybe it's on the overflow list?
nsFrameList overflowFrames(parent->GetOverflowFrames(aPresContext, PR_TRUE));
if (overflowFrames.IsEmpty() || !overflowFrames.RemoveFrame(nextInFlow)) {
NS_ASSERTION(result, "failed to remove frame");
}
// Set the overflow property again
if (overflowFrames.NotEmpty()) {
parent->SetOverflowFrames(aPresContext, overflowFrames.FirstChild());
}
}
// Delete the next-in-flow frame
nextInFlow->Destroy(aPresContext);