Fix crashes by making CreateContinuingFrame able to deal with a frame that already has a next-in-flow. b=140948 Patch by Mats Palmgren <mats.palmgren@bredband.net>. r+sr=dbaron a=chofmann

This commit is contained in:
dbaron%dbaron.org 2004-04-02 00:09:57 +00:00
parent 85871d75fb
commit 2981d39de1
2 changed files with 14 additions and 0 deletions

View File

@ -10570,6 +10570,9 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresContext* aPresContext,
nsStyleContext* styleContext = aFrame->GetStyleContext();
nsIFrame* newFrame = nsnull;
nsresult rv = NS_OK;
nsIFrame* nextInFlow = nsnull;
aFrame->GetNextInFlow(&nextInFlow);
// Use the frame type to determine what type of frame to create
nsIAtom* frameType = aFrame->GetType();
@ -10750,6 +10753,10 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresContext* aPresContext,
}
if (aParentFrame->GetType() != nsLayoutAtoms::pageContentFrame) {
if (nextInFlow) {
nextInFlow->SetPrevInFlow(newFrame);
newFrame->SetNextInFlow(nextInFlow);
}
return NS_OK;
}

View File

@ -10570,6 +10570,9 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresContext* aPresContext,
nsStyleContext* styleContext = aFrame->GetStyleContext();
nsIFrame* newFrame = nsnull;
nsresult rv = NS_OK;
nsIFrame* nextInFlow = nsnull;
aFrame->GetNextInFlow(&nextInFlow);
// Use the frame type to determine what type of frame to create
nsIAtom* frameType = aFrame->GetType();
@ -10750,6 +10753,10 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresContext* aPresContext,
}
if (aParentFrame->GetType() != nsLayoutAtoms::pageContentFrame) {
if (nextInFlow) {
nextInFlow->SetPrevInFlow(newFrame);
newFrame->SetNextInFlow(nextInFlow);
}
return NS_OK;
}