Changed new frame construction code to handle floaters

git-svn-id: svn://10.0.0.236/trunk@9811 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
troy%netscape.com
1998-09-11 04:13:29 +00:00
parent 8d91096b15
commit 4e1f178389
5 changed files with 80 additions and 16 deletions

View File

@@ -30,13 +30,14 @@
nsresult
nsPlaceholderFrame::NewFrame(nsIFrame** aInstancePtrResult,
nsIContent* aContent,
nsIFrame* aParent)
nsIFrame* aParent,
nsIFrame* aAnchoredItem)
{
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
if (nsnull == aInstancePtrResult) {
return NS_ERROR_NULL_POINTER;
}
nsIFrame* it = new nsPlaceholderFrame(aContent, aParent);
nsIFrame* it = new nsPlaceholderFrame(aContent, aParent, aAnchoredItem);
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
@@ -44,9 +45,12 @@ nsPlaceholderFrame::NewFrame(nsIFrame** aInstancePtrResult,
return NS_OK;
}
nsPlaceholderFrame::nsPlaceholderFrame(nsIContent* aContent, nsIFrame* aParent)
nsPlaceholderFrame::nsPlaceholderFrame(nsIContent* aContent,
nsIFrame* aParent,
nsIFrame* aAnchoredItem)
: nsFrame(aContent, aParent)
{
mAnchoredItem = aAnchoredItem;
}
nsPlaceholderFrame::~nsPlaceholderFrame()
@@ -143,6 +147,10 @@ nsPlaceholderFrame::InlineReflow(nsCSSLineLayout& aLineLayout,
// Notify our containing block that there's a new floater
container->AddFloater(&presContext, aReflowState, mAnchoredItem, this);
} else if (eReflowReason_Initial == aReflowState.reason) {
// Notify our containing block that there's a new floater
container->AddFloater(&presContext, aReflowState, mAnchoredItem, this);
}
// Let line layout know about the floater