From 79eb911422e336ed24641ab0e56ed15be2176fb3 Mon Sep 17 00:00:00 2001 From: "troy%netscape.com" Date: Thu, 24 Sep 1998 03:49:45 +0000 Subject: [PATCH] Removed some XXX CONSTRUCTION code that was work-in-progress, but is no longer needed --- layout/base/public/nsIFrame.h | 39 ----------- layout/generic/nsBlockFrame.cpp | 73 --------------------- layout/generic/nsBlockReflowState.cpp | 73 --------------------- layout/generic/nsBlockReflowState.h | 73 --------------------- layout/generic/nsHTMLContainerFrame.h | 9 +-- layout/generic/nsIFrame.h | 39 ----------- layout/generic/nsPlaceholderFrame.cpp | 20 ------ layout/generic/nsPlaceholderFrame.h | 8 --- layout/html/base/src/nsBlockFrame.cpp | 73 --------------------- layout/html/base/src/nsBlockReflowState.cpp | 73 --------------------- layout/html/base/src/nsBlockReflowState.h | 73 --------------------- layout/html/base/src/nsHTMLContainerFrame.h | 9 +-- layout/html/base/src/nsPlaceholderFrame.cpp | 20 ------ layout/html/base/src/nsPlaceholderFrame.h | 8 --- 14 files changed, 2 insertions(+), 588 deletions(-) diff --git a/layout/base/public/nsIFrame.h b/layout/base/public/nsIFrame.h index 2067ea3a18b..ca4292d7f07 100644 --- a/layout/base/public/nsIFrame.h +++ b/layout/base/public/nsIFrame.h @@ -476,45 +476,6 @@ public: NS_IMETHOD DidReflow(nsIPresContext& aPresContext, nsDidReflowStatus aStatus) = 0; - /** - * This call is invoked when content is appended to the content tree. - * - * This frame is the frame that maps the content object that has appended - * content. A typical response to this notification is to generate a - * FrameAppended incremental reflow command. You then handle the incremental - * reflow command by creating frames for the appended content. - */ - // XXX CONSTRUCTION -#if 0 - NS_IMETHOD ContentAppended(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer) = 0; -#endif - - // XXX CONSTRUCTION -#if 0 - /** - * This call is invoked when content is inserted in the content - * tree. - * - * This frame is the frame that maps the content object that has inserted - * content. A typical response to this notification is to update the - * index-in-parent values for the affected child frames, create and insert - * new frame(s), and generate a FrameInserted incremental reflow command. - * - * You respond to the incremental reflow command by reflowing the newly - * inserted frame and any impacted frames. - * - * @param aIndexInParent the index in the content container where - * the new content was inserted. - */ - NS_IMETHOD ContentInserted(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInParent) = 0; -#endif - /** * This call is invoked when content is replaced in the content * tree. The container frame that maps that content is asked to deal diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index 699e86f537a..203bc5d3db4 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -244,14 +244,6 @@ public: nsIRenderingContext& aRenderingContext, const nsRect& aDirtyRect); - // XXX CONSTRUCTION -#if 0 - NS_IMETHOD ContentInserted(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInParent); -#endif NS_IMETHOD ContentDeleted(nsIPresShell* aShell, nsIPresContext* aPresContext, nsIContent* aContainer, @@ -3529,71 +3521,6 @@ nsBlockFrame::InsertNewFrame(nsBlockFrame* aParentFrame, return NS_OK; } -// XXX CONSTRUCTION -#if 0 -// XXX we assume that the insertion is really an assertion and never an append -// XXX what about zero lines case -NS_IMETHODIMP -nsBlockFrame::ContentInserted(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInParent) -{ - // Find the frame that precedes this frame - nsIFrame* prevSibling = nsnull; - if (aIndexInParent > 0) { - nsIContent* precedingContent; - aContainer->ChildAt(aIndexInParent - 1, precedingContent); - prevSibling = aShell->FindFrameWithContent(precedingContent); - NS_ASSERTION(nsnull != prevSibling, "no frame for preceding content"); - NS_RELEASE(precedingContent); - - // The frame may have a next-in-flow. Get the last-in-flow; we do - // it the hard way because we can't assume that prevSibling is a - // subclass of nsSplittableFrame. - nsIFrame* nextInFlow; - do { - prevSibling->GetNextInFlow(nextInFlow); - if (nsnull != nextInFlow) { - prevSibling = nextInFlow; - } - } while (nsnull != nextInFlow); - } - - // Get the parent of the previous sibling (which will be the proper - // next-in-flow for the child). We expect it to be this frame or one - // of our next-in-flow(s). - nsBlockFrame* flow = this; - if (nsnull != prevSibling) { - prevSibling->GetGeometricParent((nsIFrame*&)flow); - } - - // Now that we have the right flow block we can create the new - // frame; test and see if the inserted frame is a block or not. - // XXX create-frame could return that fact - nsIFrame* newFrame; - nsresult rv = nsHTMLContainerFrame::CreateFrame(aPresContext, flow, aChild, - nsnull, newFrame); - if (NS_OK != rv) { - return rv; - } - - InsertNewFrame(flow, newFrame, prevSibling); - - // Generate a reflow command - nsIReflowCommand* cmd; - rv = NS_NewHTMLReflowCommand(&cmd, flow, nsIReflowCommand::FrameInserted); - if (NS_OK != rv) { - return rv; - } - aShell->AppendReflowCommand(cmd); - NS_RELEASE(cmd); - - return NS_OK; -} -#endif - NS_IMETHODIMP nsBlockFrame::ContentDeleted(nsIPresShell* aShell, nsIPresContext* aPresContext, diff --git a/layout/generic/nsBlockReflowState.cpp b/layout/generic/nsBlockReflowState.cpp index 699e86f537a..203bc5d3db4 100644 --- a/layout/generic/nsBlockReflowState.cpp +++ b/layout/generic/nsBlockReflowState.cpp @@ -244,14 +244,6 @@ public: nsIRenderingContext& aRenderingContext, const nsRect& aDirtyRect); - // XXX CONSTRUCTION -#if 0 - NS_IMETHOD ContentInserted(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInParent); -#endif NS_IMETHOD ContentDeleted(nsIPresShell* aShell, nsIPresContext* aPresContext, nsIContent* aContainer, @@ -3529,71 +3521,6 @@ nsBlockFrame::InsertNewFrame(nsBlockFrame* aParentFrame, return NS_OK; } -// XXX CONSTRUCTION -#if 0 -// XXX we assume that the insertion is really an assertion and never an append -// XXX what about zero lines case -NS_IMETHODIMP -nsBlockFrame::ContentInserted(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInParent) -{ - // Find the frame that precedes this frame - nsIFrame* prevSibling = nsnull; - if (aIndexInParent > 0) { - nsIContent* precedingContent; - aContainer->ChildAt(aIndexInParent - 1, precedingContent); - prevSibling = aShell->FindFrameWithContent(precedingContent); - NS_ASSERTION(nsnull != prevSibling, "no frame for preceding content"); - NS_RELEASE(precedingContent); - - // The frame may have a next-in-flow. Get the last-in-flow; we do - // it the hard way because we can't assume that prevSibling is a - // subclass of nsSplittableFrame. - nsIFrame* nextInFlow; - do { - prevSibling->GetNextInFlow(nextInFlow); - if (nsnull != nextInFlow) { - prevSibling = nextInFlow; - } - } while (nsnull != nextInFlow); - } - - // Get the parent of the previous sibling (which will be the proper - // next-in-flow for the child). We expect it to be this frame or one - // of our next-in-flow(s). - nsBlockFrame* flow = this; - if (nsnull != prevSibling) { - prevSibling->GetGeometricParent((nsIFrame*&)flow); - } - - // Now that we have the right flow block we can create the new - // frame; test and see if the inserted frame is a block or not. - // XXX create-frame could return that fact - nsIFrame* newFrame; - nsresult rv = nsHTMLContainerFrame::CreateFrame(aPresContext, flow, aChild, - nsnull, newFrame); - if (NS_OK != rv) { - return rv; - } - - InsertNewFrame(flow, newFrame, prevSibling); - - // Generate a reflow command - nsIReflowCommand* cmd; - rv = NS_NewHTMLReflowCommand(&cmd, flow, nsIReflowCommand::FrameInserted); - if (NS_OK != rv) { - return rv; - } - aShell->AppendReflowCommand(cmd); - NS_RELEASE(cmd); - - return NS_OK; -} -#endif - NS_IMETHODIMP nsBlockFrame::ContentDeleted(nsIPresShell* aShell, nsIPresContext* aPresContext, diff --git a/layout/generic/nsBlockReflowState.h b/layout/generic/nsBlockReflowState.h index 699e86f537a..203bc5d3db4 100644 --- a/layout/generic/nsBlockReflowState.h +++ b/layout/generic/nsBlockReflowState.h @@ -244,14 +244,6 @@ public: nsIRenderingContext& aRenderingContext, const nsRect& aDirtyRect); - // XXX CONSTRUCTION -#if 0 - NS_IMETHOD ContentInserted(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInParent); -#endif NS_IMETHOD ContentDeleted(nsIPresShell* aShell, nsIPresContext* aPresContext, nsIContent* aContainer, @@ -3529,71 +3521,6 @@ nsBlockFrame::InsertNewFrame(nsBlockFrame* aParentFrame, return NS_OK; } -// XXX CONSTRUCTION -#if 0 -// XXX we assume that the insertion is really an assertion and never an append -// XXX what about zero lines case -NS_IMETHODIMP -nsBlockFrame::ContentInserted(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInParent) -{ - // Find the frame that precedes this frame - nsIFrame* prevSibling = nsnull; - if (aIndexInParent > 0) { - nsIContent* precedingContent; - aContainer->ChildAt(aIndexInParent - 1, precedingContent); - prevSibling = aShell->FindFrameWithContent(precedingContent); - NS_ASSERTION(nsnull != prevSibling, "no frame for preceding content"); - NS_RELEASE(precedingContent); - - // The frame may have a next-in-flow. Get the last-in-flow; we do - // it the hard way because we can't assume that prevSibling is a - // subclass of nsSplittableFrame. - nsIFrame* nextInFlow; - do { - prevSibling->GetNextInFlow(nextInFlow); - if (nsnull != nextInFlow) { - prevSibling = nextInFlow; - } - } while (nsnull != nextInFlow); - } - - // Get the parent of the previous sibling (which will be the proper - // next-in-flow for the child). We expect it to be this frame or one - // of our next-in-flow(s). - nsBlockFrame* flow = this; - if (nsnull != prevSibling) { - prevSibling->GetGeometricParent((nsIFrame*&)flow); - } - - // Now that we have the right flow block we can create the new - // frame; test and see if the inserted frame is a block or not. - // XXX create-frame could return that fact - nsIFrame* newFrame; - nsresult rv = nsHTMLContainerFrame::CreateFrame(aPresContext, flow, aChild, - nsnull, newFrame); - if (NS_OK != rv) { - return rv; - } - - InsertNewFrame(flow, newFrame, prevSibling); - - // Generate a reflow command - nsIReflowCommand* cmd; - rv = NS_NewHTMLReflowCommand(&cmd, flow, nsIReflowCommand::FrameInserted); - if (NS_OK != rv) { - return rv; - } - aShell->AppendReflowCommand(cmd); - NS_RELEASE(cmd); - - return NS_OK; -} -#endif - NS_IMETHODIMP nsBlockFrame::ContentDeleted(nsIPresShell* aShell, nsIPresContext* aPresContext, diff --git a/layout/generic/nsHTMLContainerFrame.h b/layout/generic/nsHTMLContainerFrame.h index 09c2b1f6c06..45616e3ba7e 100644 --- a/layout/generic/nsHTMLContainerFrame.h +++ b/layout/generic/nsHTMLContainerFrame.h @@ -40,14 +40,7 @@ public: nsIFrame** aFrame, nsIContent** aContent, PRInt32& aCursor); - // XXX CONSTRUCTION -#if 0 - NS_IMETHOD ContentInserted(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInParent); -#endif + NS_IMETHOD ContentDeleted(nsIPresShell* aShell, nsIPresContext* aPresContext, nsIContent* aContainer, diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h index 2067ea3a18b..ca4292d7f07 100644 --- a/layout/generic/nsIFrame.h +++ b/layout/generic/nsIFrame.h @@ -476,45 +476,6 @@ public: NS_IMETHOD DidReflow(nsIPresContext& aPresContext, nsDidReflowStatus aStatus) = 0; - /** - * This call is invoked when content is appended to the content tree. - * - * This frame is the frame that maps the content object that has appended - * content. A typical response to this notification is to generate a - * FrameAppended incremental reflow command. You then handle the incremental - * reflow command by creating frames for the appended content. - */ - // XXX CONSTRUCTION -#if 0 - NS_IMETHOD ContentAppended(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer) = 0; -#endif - - // XXX CONSTRUCTION -#if 0 - /** - * This call is invoked when content is inserted in the content - * tree. - * - * This frame is the frame that maps the content object that has inserted - * content. A typical response to this notification is to update the - * index-in-parent values for the affected child frames, create and insert - * new frame(s), and generate a FrameInserted incremental reflow command. - * - * You respond to the incremental reflow command by reflowing the newly - * inserted frame and any impacted frames. - * - * @param aIndexInParent the index in the content container where - * the new content was inserted. - */ - NS_IMETHOD ContentInserted(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInParent) = 0; -#endif - /** * This call is invoked when content is replaced in the content * tree. The container frame that maps that content is asked to deal diff --git a/layout/generic/nsPlaceholderFrame.cpp b/layout/generic/nsPlaceholderFrame.cpp index 6854f0ef4c4..547ab1ba9c1 100644 --- a/layout/generic/nsPlaceholderFrame.cpp +++ b/layout/generic/nsPlaceholderFrame.cpp @@ -139,26 +139,6 @@ nsPlaceholderFrame::Paint(nsIPresContext& aPresContext, return NS_OK; } -// XXX CONSTRUCTION -#if 0 -NS_IMETHODIMP nsPlaceholderFrame::ContentInserted(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInParent) -{ - NS_ASSERTION(mContent == aContainer, "bad content-inserted target"); - - // Forward the notification to the floater - if (nsnull != mAnchoredItem) { - return mAnchoredItem->ContentInserted(aShell, aPresContext, aContainer, - aChild, aIndexInParent); - } - - return NS_OK; -} -#endif - NS_IMETHODIMP nsPlaceholderFrame::ContentReplaced(nsIPresShell* aShell, nsIPresContext* aPresContext, nsIContent* aContainer, diff --git a/layout/generic/nsPlaceholderFrame.h b/layout/generic/nsPlaceholderFrame.h index c74d1009ac5..afe55cff38f 100644 --- a/layout/generic/nsPlaceholderFrame.h +++ b/layout/generic/nsPlaceholderFrame.h @@ -50,14 +50,6 @@ public: nsIRenderingContext& aRenderingContext, const nsRect& aDirtyRect); -// XXX CONSTRUCTION -#if 0 - NS_IMETHOD ContentInserted(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInParent); -#endif NS_IMETHOD ContentReplaced(nsIPresShell* aShell, nsIPresContext* aPresContext, nsIContent* aContainer, diff --git a/layout/html/base/src/nsBlockFrame.cpp b/layout/html/base/src/nsBlockFrame.cpp index 699e86f537a..203bc5d3db4 100644 --- a/layout/html/base/src/nsBlockFrame.cpp +++ b/layout/html/base/src/nsBlockFrame.cpp @@ -244,14 +244,6 @@ public: nsIRenderingContext& aRenderingContext, const nsRect& aDirtyRect); - // XXX CONSTRUCTION -#if 0 - NS_IMETHOD ContentInserted(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInParent); -#endif NS_IMETHOD ContentDeleted(nsIPresShell* aShell, nsIPresContext* aPresContext, nsIContent* aContainer, @@ -3529,71 +3521,6 @@ nsBlockFrame::InsertNewFrame(nsBlockFrame* aParentFrame, return NS_OK; } -// XXX CONSTRUCTION -#if 0 -// XXX we assume that the insertion is really an assertion and never an append -// XXX what about zero lines case -NS_IMETHODIMP -nsBlockFrame::ContentInserted(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInParent) -{ - // Find the frame that precedes this frame - nsIFrame* prevSibling = nsnull; - if (aIndexInParent > 0) { - nsIContent* precedingContent; - aContainer->ChildAt(aIndexInParent - 1, precedingContent); - prevSibling = aShell->FindFrameWithContent(precedingContent); - NS_ASSERTION(nsnull != prevSibling, "no frame for preceding content"); - NS_RELEASE(precedingContent); - - // The frame may have a next-in-flow. Get the last-in-flow; we do - // it the hard way because we can't assume that prevSibling is a - // subclass of nsSplittableFrame. - nsIFrame* nextInFlow; - do { - prevSibling->GetNextInFlow(nextInFlow); - if (nsnull != nextInFlow) { - prevSibling = nextInFlow; - } - } while (nsnull != nextInFlow); - } - - // Get the parent of the previous sibling (which will be the proper - // next-in-flow for the child). We expect it to be this frame or one - // of our next-in-flow(s). - nsBlockFrame* flow = this; - if (nsnull != prevSibling) { - prevSibling->GetGeometricParent((nsIFrame*&)flow); - } - - // Now that we have the right flow block we can create the new - // frame; test and see if the inserted frame is a block or not. - // XXX create-frame could return that fact - nsIFrame* newFrame; - nsresult rv = nsHTMLContainerFrame::CreateFrame(aPresContext, flow, aChild, - nsnull, newFrame); - if (NS_OK != rv) { - return rv; - } - - InsertNewFrame(flow, newFrame, prevSibling); - - // Generate a reflow command - nsIReflowCommand* cmd; - rv = NS_NewHTMLReflowCommand(&cmd, flow, nsIReflowCommand::FrameInserted); - if (NS_OK != rv) { - return rv; - } - aShell->AppendReflowCommand(cmd); - NS_RELEASE(cmd); - - return NS_OK; -} -#endif - NS_IMETHODIMP nsBlockFrame::ContentDeleted(nsIPresShell* aShell, nsIPresContext* aPresContext, diff --git a/layout/html/base/src/nsBlockReflowState.cpp b/layout/html/base/src/nsBlockReflowState.cpp index 699e86f537a..203bc5d3db4 100644 --- a/layout/html/base/src/nsBlockReflowState.cpp +++ b/layout/html/base/src/nsBlockReflowState.cpp @@ -244,14 +244,6 @@ public: nsIRenderingContext& aRenderingContext, const nsRect& aDirtyRect); - // XXX CONSTRUCTION -#if 0 - NS_IMETHOD ContentInserted(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInParent); -#endif NS_IMETHOD ContentDeleted(nsIPresShell* aShell, nsIPresContext* aPresContext, nsIContent* aContainer, @@ -3529,71 +3521,6 @@ nsBlockFrame::InsertNewFrame(nsBlockFrame* aParentFrame, return NS_OK; } -// XXX CONSTRUCTION -#if 0 -// XXX we assume that the insertion is really an assertion and never an append -// XXX what about zero lines case -NS_IMETHODIMP -nsBlockFrame::ContentInserted(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInParent) -{ - // Find the frame that precedes this frame - nsIFrame* prevSibling = nsnull; - if (aIndexInParent > 0) { - nsIContent* precedingContent; - aContainer->ChildAt(aIndexInParent - 1, precedingContent); - prevSibling = aShell->FindFrameWithContent(precedingContent); - NS_ASSERTION(nsnull != prevSibling, "no frame for preceding content"); - NS_RELEASE(precedingContent); - - // The frame may have a next-in-flow. Get the last-in-flow; we do - // it the hard way because we can't assume that prevSibling is a - // subclass of nsSplittableFrame. - nsIFrame* nextInFlow; - do { - prevSibling->GetNextInFlow(nextInFlow); - if (nsnull != nextInFlow) { - prevSibling = nextInFlow; - } - } while (nsnull != nextInFlow); - } - - // Get the parent of the previous sibling (which will be the proper - // next-in-flow for the child). We expect it to be this frame or one - // of our next-in-flow(s). - nsBlockFrame* flow = this; - if (nsnull != prevSibling) { - prevSibling->GetGeometricParent((nsIFrame*&)flow); - } - - // Now that we have the right flow block we can create the new - // frame; test and see if the inserted frame is a block or not. - // XXX create-frame could return that fact - nsIFrame* newFrame; - nsresult rv = nsHTMLContainerFrame::CreateFrame(aPresContext, flow, aChild, - nsnull, newFrame); - if (NS_OK != rv) { - return rv; - } - - InsertNewFrame(flow, newFrame, prevSibling); - - // Generate a reflow command - nsIReflowCommand* cmd; - rv = NS_NewHTMLReflowCommand(&cmd, flow, nsIReflowCommand::FrameInserted); - if (NS_OK != rv) { - return rv; - } - aShell->AppendReflowCommand(cmd); - NS_RELEASE(cmd); - - return NS_OK; -} -#endif - NS_IMETHODIMP nsBlockFrame::ContentDeleted(nsIPresShell* aShell, nsIPresContext* aPresContext, diff --git a/layout/html/base/src/nsBlockReflowState.h b/layout/html/base/src/nsBlockReflowState.h index 699e86f537a..203bc5d3db4 100644 --- a/layout/html/base/src/nsBlockReflowState.h +++ b/layout/html/base/src/nsBlockReflowState.h @@ -244,14 +244,6 @@ public: nsIRenderingContext& aRenderingContext, const nsRect& aDirtyRect); - // XXX CONSTRUCTION -#if 0 - NS_IMETHOD ContentInserted(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInParent); -#endif NS_IMETHOD ContentDeleted(nsIPresShell* aShell, nsIPresContext* aPresContext, nsIContent* aContainer, @@ -3529,71 +3521,6 @@ nsBlockFrame::InsertNewFrame(nsBlockFrame* aParentFrame, return NS_OK; } -// XXX CONSTRUCTION -#if 0 -// XXX we assume that the insertion is really an assertion and never an append -// XXX what about zero lines case -NS_IMETHODIMP -nsBlockFrame::ContentInserted(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInParent) -{ - // Find the frame that precedes this frame - nsIFrame* prevSibling = nsnull; - if (aIndexInParent > 0) { - nsIContent* precedingContent; - aContainer->ChildAt(aIndexInParent - 1, precedingContent); - prevSibling = aShell->FindFrameWithContent(precedingContent); - NS_ASSERTION(nsnull != prevSibling, "no frame for preceding content"); - NS_RELEASE(precedingContent); - - // The frame may have a next-in-flow. Get the last-in-flow; we do - // it the hard way because we can't assume that prevSibling is a - // subclass of nsSplittableFrame. - nsIFrame* nextInFlow; - do { - prevSibling->GetNextInFlow(nextInFlow); - if (nsnull != nextInFlow) { - prevSibling = nextInFlow; - } - } while (nsnull != nextInFlow); - } - - // Get the parent of the previous sibling (which will be the proper - // next-in-flow for the child). We expect it to be this frame or one - // of our next-in-flow(s). - nsBlockFrame* flow = this; - if (nsnull != prevSibling) { - prevSibling->GetGeometricParent((nsIFrame*&)flow); - } - - // Now that we have the right flow block we can create the new - // frame; test and see if the inserted frame is a block or not. - // XXX create-frame could return that fact - nsIFrame* newFrame; - nsresult rv = nsHTMLContainerFrame::CreateFrame(aPresContext, flow, aChild, - nsnull, newFrame); - if (NS_OK != rv) { - return rv; - } - - InsertNewFrame(flow, newFrame, prevSibling); - - // Generate a reflow command - nsIReflowCommand* cmd; - rv = NS_NewHTMLReflowCommand(&cmd, flow, nsIReflowCommand::FrameInserted); - if (NS_OK != rv) { - return rv; - } - aShell->AppendReflowCommand(cmd); - NS_RELEASE(cmd); - - return NS_OK; -} -#endif - NS_IMETHODIMP nsBlockFrame::ContentDeleted(nsIPresShell* aShell, nsIPresContext* aPresContext, diff --git a/layout/html/base/src/nsHTMLContainerFrame.h b/layout/html/base/src/nsHTMLContainerFrame.h index 09c2b1f6c06..45616e3ba7e 100644 --- a/layout/html/base/src/nsHTMLContainerFrame.h +++ b/layout/html/base/src/nsHTMLContainerFrame.h @@ -40,14 +40,7 @@ public: nsIFrame** aFrame, nsIContent** aContent, PRInt32& aCursor); - // XXX CONSTRUCTION -#if 0 - NS_IMETHOD ContentInserted(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInParent); -#endif + NS_IMETHOD ContentDeleted(nsIPresShell* aShell, nsIPresContext* aPresContext, nsIContent* aContainer, diff --git a/layout/html/base/src/nsPlaceholderFrame.cpp b/layout/html/base/src/nsPlaceholderFrame.cpp index 6854f0ef4c4..547ab1ba9c1 100644 --- a/layout/html/base/src/nsPlaceholderFrame.cpp +++ b/layout/html/base/src/nsPlaceholderFrame.cpp @@ -139,26 +139,6 @@ nsPlaceholderFrame::Paint(nsIPresContext& aPresContext, return NS_OK; } -// XXX CONSTRUCTION -#if 0 -NS_IMETHODIMP nsPlaceholderFrame::ContentInserted(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInParent) -{ - NS_ASSERTION(mContent == aContainer, "bad content-inserted target"); - - // Forward the notification to the floater - if (nsnull != mAnchoredItem) { - return mAnchoredItem->ContentInserted(aShell, aPresContext, aContainer, - aChild, aIndexInParent); - } - - return NS_OK; -} -#endif - NS_IMETHODIMP nsPlaceholderFrame::ContentReplaced(nsIPresShell* aShell, nsIPresContext* aPresContext, nsIContent* aContainer, diff --git a/layout/html/base/src/nsPlaceholderFrame.h b/layout/html/base/src/nsPlaceholderFrame.h index c74d1009ac5..afe55cff38f 100644 --- a/layout/html/base/src/nsPlaceholderFrame.h +++ b/layout/html/base/src/nsPlaceholderFrame.h @@ -50,14 +50,6 @@ public: nsIRenderingContext& aRenderingContext, const nsRect& aDirtyRect); -// XXX CONSTRUCTION -#if 0 - NS_IMETHOD ContentInserted(nsIPresShell* aShell, - nsIPresContext* aPresContext, - nsIContent* aContainer, - nsIContent* aChild, - PRInt32 aIndexInParent); -#endif NS_IMETHOD ContentReplaced(nsIPresShell* aShell, nsIPresContext* aPresContext, nsIContent* aContainer,