From b2cf6296b52b41f3882ed68000b3e06366433682 Mon Sep 17 00:00:00 2001 From: "dholbert@cs.stanford.edu" Date: Tue, 2 Oct 2007 20:44:18 -0700 Subject: [PATCH] Bug 395316 - Clear OutOfFlowFrame after unregistering placeholder, and make recursive call to RemoveFrame. r/sr/a=roc --- layout/base/nsCSSFrameConstructor.cpp | 1 + layout/generic/nsContainerFrame.cpp | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 880184a97ad..852d9a33b98 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -9385,6 +9385,7 @@ static void UnregisterPlaceholderChain(nsFrameManager* frameManager, nsPlaceholderFrame* curFrame = placeholderFrame; do { frameManager->UnregisterPlaceholderFrame(curFrame); + curFrame->SetOutOfFlowFrame(nsnull); curFrame = static_cast(curFrame->GetNextContinuation()); } while (curFrame); } diff --git a/layout/generic/nsContainerFrame.cpp b/layout/generic/nsContainerFrame.cpp index 4c34e3e6f2c..969451a2b25 100644 --- a/layout/generic/nsContainerFrame.cpp +++ b/layout/generic/nsContainerFrame.cpp @@ -224,7 +224,14 @@ nsContainerFrame::RemoveFrame(nsIAtom* aListName, // check the overflow lists atm, but we'll need a prescontext lookup // for overflow containers once we can split abspos elements with // inline containing blocks. - parent->mFrames.DestroyFrame(aOldFrame); + if (parent == this) { + parent->mFrames.DestroyFrame(aOldFrame); + } else { + // This recursive call takes care of all continuations after aOldFrame, + // so we don't need to loop anymore. + parent->RemoveFrame(nsnull, aOldFrame); + break; + } aOldFrame = oldFrameNextContinuation; if (aOldFrame) { parent = static_cast(aOldFrame->GetParent());