Bug 504221 part 3. Switch overflowFrames storage to nsFrameList. r=fantasai, r+sr=roc

This commit is contained in:
Boris Zbarsky
2009-07-28 08:51:09 -04:00
parent 8d7520a22e
commit 2eb38e3023
12 changed files with 232 additions and 200 deletions

View File

@@ -601,15 +601,16 @@ CanvasFrame::Reflow(nsPresContext* aPresContext,
CanvasFrame* prevCanvasFrame = static_cast<CanvasFrame*>
(GetPrevInFlow());
if (prevCanvasFrame) {
nsIFrame* overflow = prevCanvasFrame->GetOverflowFrames(aPresContext, PR_TRUE);
nsAutoPtr<nsFrameList> overflow(prevCanvasFrame->StealOverflowFrames());
if (overflow) {
NS_ASSERTION(!overflow->GetNextSibling(),
NS_ASSERTION(overflow->OnlyChild(),
"must have doc root as canvas frame's only child");
nsHTMLContainerFrame::ReparentFrameView(aPresContext, overflow, prevCanvasFrame, this);
nsHTMLContainerFrame::ReparentFrameViewList(aPresContext, *overflow,
prevCanvasFrame, this);
// Prepend overflow to the our child list. There may already be
// children placeholders for fixed-pos elements, which don't get
// reflowed but must not be lost until the canvas frame is destroyed.
mFrames.InsertFrames(this, nsnull, overflow);
mFrames.InsertFrames(this, nsnull, *overflow);
}
}