зеркало из https://github.com/mozilla/pjs.git
Removed some XXX CONSTRUCTION code that was work-in-progress, but is
no longer needed
This commit is contained in:
Родитель
5e4611081b
Коммит
79eb911422
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Загрузка…
Ссылка в новой задаче