Removed CreateFrame() from nsIHTMLContent

This commit is contained in:
troy@netscape.com
1998-09-18 18:04:42 +00:00
parent 7f644b87ab
commit 75ef26abf7
39 changed files with 168 additions and 875 deletions

View File

@@ -139,89 +139,6 @@ NS_METHOD nsHTMLContainerFrame::GetCursorAndContentAt(nsIPresContext& aPresConte
return NS_OK;
}
// XXX CONSTRUCTION
#if 0
NS_IMETHODIMP
nsHTMLContainerFrame::ContentInserted(nsIPresShell* aShell,
nsIPresContext* aPresContext,
nsIContent* aContainer,
nsIContent* aChild,
PRInt32 aIndexInParent)
{
NS_ASSERTION(!IsPseudoFrame(), "pseudos not supported here");
// Find the frame that precedes the insertion point
nsIFrame* prevSibling = nsnull;
if (aIndexInParent > 0) {
nsIContent* precedingContent;
aContainer->ChildAt(aIndexInParent - 1, precedingContent);
prevSibling = aShell->FindFrameWithContent(precedingContent);
NS_RELEASE(precedingContent);
// The frame may have a next-in-flow. Get the last-in-flow
nsIFrame* nextInFlow;
do {
prevSibling->GetNextInFlow(nextInFlow);
if (nsnull != nextInFlow) {
prevSibling = nextInFlow;
}
} while (nsnull != nextInFlow);
}
// Get the geometric parent for the prevSibling. We expect it to be
// this frame or one of its next-in-flow(s).
nsHTMLContainerFrame* flow = this;
if (nsnull != prevSibling) {
prevSibling->GetGeometricParent((nsIFrame*&)flow);
}
// Create the new frame as a child of the same parent as prevSibling
nsIFrame* newFrame;
nsresult rv = nsHTMLBase::CreateFrame(aPresContext, flow, aChild, nsnull,
newFrame);
if (NS_OK != rv) {
return rv;
}
flow->mChildCount++;
// Place the new frame into the parents sibling list
if (nsnull == prevSibling) {
newFrame->SetNextSibling(flow->mFirstChild);
flow->mFirstChild = newFrame;
}
else {
nsIFrame* nextSibling;
prevSibling->GetNextSibling(nextSibling);
newFrame->SetNextSibling(nextSibling);
prevSibling->SetNextSibling(newFrame);
if (nsnull == nextSibling) {
// newFrame ended up being flow's last child
flow->mLastContentIsComplete = PR_TRUE;
}
}
flow->mLastContentOffset++;
// Generate a reflow command
nsIReflowCommand* cmd;
rv = NS_NewHTMLReflowCommand(&cmd, flow,
nsIReflowCommand::FrameInserted,
newFrame);
if (NS_OK != rv) {
return rv;
}
aShell->AppendReflowCommand(cmd);
NS_RELEASE(cmd);
// Fix up the next-in-flows of parent now that it has a new child
flow = (nsHTMLContainerFrame*) flow->mNextInFlow;
while (nsnull != flow) {
flow->mFirstContentOffset++;
flow->mLastContentOffset++;
}
return rv;
}
#endif
NS_IMETHODIMP
nsHTMLContainerFrame::ContentDeleted(nsIPresShell* aShell,
nsIPresContext* aPresContext,