зеркало из https://github.com/mozilla/gecko-dev.git
Added CreateContinuingFrame() function to frame construction code
This commit is contained in:
Родитель
4860bd34f7
Коммит
da0991df28
|
@ -136,6 +136,12 @@ public:
|
|||
NS_IMETHOD CantRenderReplacedElement(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame);
|
||||
|
||||
// Request to create a continuing frame
|
||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIFrame** aContinuingFrame);
|
||||
|
||||
virtual void List(FILE* out = stdout, PRInt32 aIndent = 0);
|
||||
|
||||
private:
|
||||
|
@ -818,6 +824,16 @@ StyleSetImpl::CantRenderReplacedElement(nsIPresContext* aPresContext,
|
|||
return mFrameConstructor->CantRenderReplacedElement(aPresContext, aFrame);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
StyleSetImpl::CreateContinuingFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIFrame** aContinuingFrame)
|
||||
{
|
||||
return mFrameConstructor->CreateContinuingFrame(aPresContext, aFrame, aParentFrame,
|
||||
aContinuingFrame);
|
||||
}
|
||||
|
||||
void StyleSetImpl::List(FILE* out, PRInt32 aIndent, nsISupportsArray* aSheets)
|
||||
{
|
||||
PRInt32 count = ((nsnull != aSheets) ? aSheets->Count() : 0);
|
||||
|
|
|
@ -3551,6 +3551,24 @@ nsCSSFrameConstructor::CantRenderReplacedElement(nsIPresContext* aPresContext,
|
|||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsCSSFrameConstructor::CreateContinuingFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIFrame** aContinuingFrame)
|
||||
{
|
||||
nsresult rv;
|
||||
nsIFrame* continuingFrame;
|
||||
|
||||
nsIStyleContext* styleContext;
|
||||
aFrame->GetStyleContext(&styleContext);
|
||||
rv = aFrame->CreateContinuingFrame(*aPresContext, aParentFrame, styleContext,
|
||||
continuingFrame);
|
||||
NS_RELEASE(styleContext);
|
||||
*aContinuingFrame = continuingFrame;
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsCSSFrameConstructor::RecreateFramesOnAttributeChange(nsIPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
|
|
|
@ -99,6 +99,12 @@ public:
|
|||
NS_IMETHOD CantRenderReplacedElement(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame);
|
||||
|
||||
// Request to create a continuing frame
|
||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIFrame** aContinuingFrame);
|
||||
|
||||
protected:
|
||||
|
||||
nsresult ResolveStyleContext(nsIPresContext* aPresContext,
|
||||
|
|
|
@ -93,6 +93,12 @@ public:
|
|||
// Notification that we were unable to render a replaced element.
|
||||
NS_IMETHOD CantRenderReplacedElement(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame) = 0;
|
||||
|
||||
// Request to create a continuing frame
|
||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIFrame** aContinuingFrame) = 0;
|
||||
};
|
||||
|
||||
#endif /* nsIStyleFrameConstruction_h___ */
|
||||
|
|
|
@ -145,6 +145,12 @@ public:
|
|||
NS_IMETHOD CantRenderReplacedElement(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame) = 0;
|
||||
|
||||
// Request to create a continuing frame
|
||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIFrame** aContinuingFrame) = 0;
|
||||
|
||||
virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) = 0;
|
||||
virtual void ListContexts(nsIStyleContext* aRootContext, FILE* out = stdout, PRInt32 aIndent = 0) = 0;
|
||||
};
|
||||
|
|
|
@ -136,6 +136,12 @@ public:
|
|||
NS_IMETHOD CantRenderReplacedElement(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame);
|
||||
|
||||
// Request to create a continuing frame
|
||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIFrame** aContinuingFrame);
|
||||
|
||||
virtual void List(FILE* out = stdout, PRInt32 aIndent = 0);
|
||||
|
||||
private:
|
||||
|
@ -818,6 +824,16 @@ StyleSetImpl::CantRenderReplacedElement(nsIPresContext* aPresContext,
|
|||
return mFrameConstructor->CantRenderReplacedElement(aPresContext, aFrame);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
StyleSetImpl::CreateContinuingFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIFrame** aContinuingFrame)
|
||||
{
|
||||
return mFrameConstructor->CreateContinuingFrame(aPresContext, aFrame, aParentFrame,
|
||||
aContinuingFrame);
|
||||
}
|
||||
|
||||
void StyleSetImpl::List(FILE* out, PRInt32 aIndent, nsISupportsArray* aSheets)
|
||||
{
|
||||
PRInt32 count = ((nsnull != aSheets) ? aSheets->Count() : 0);
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include "nsDOMEvent.h"
|
||||
#include "nsIScrollableView.h"
|
||||
#include "nsWidgetsCID.h"
|
||||
#include "nsIStyleSet.h"
|
||||
|
||||
static NS_DEFINE_IID(kScrollViewIID, NS_ISCROLLABLEVIEW_IID);
|
||||
static NS_DEFINE_IID(kCChildCID, NS_CHILD_CID);
|
||||
|
@ -160,11 +161,15 @@ nsHTMLContainerFrame::CreateNextInFlow(nsIPresContext& aPresContext,
|
|||
// into our lines child list.
|
||||
nsIFrame* nextFrame;
|
||||
aFrame->GetNextSibling(&nextFrame);
|
||||
nsIStyleContext* kidSC;
|
||||
aFrame->GetStyleContext(&kidSC);
|
||||
aFrame->CreateContinuingFrame(aPresContext, aOuterFrame,
|
||||
kidSC, nextInFlow);
|
||||
NS_RELEASE(kidSC);
|
||||
|
||||
nsIPresShell* presShell;
|
||||
nsIStyleSet* styleSet;
|
||||
aPresContext.GetShell(&presShell);
|
||||
presShell->GetStyleSet(&styleSet);
|
||||
NS_RELEASE(presShell);
|
||||
styleSet->CreateContinuingFrame(&aPresContext, aFrame, aOuterFrame, &nextInFlow);
|
||||
NS_RELEASE(styleSet);
|
||||
|
||||
if (nsnull == nextInFlow) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsLayoutAtoms.h"
|
||||
#include "nsIStyleSet.h"
|
||||
#include "nsIPresShell.h"
|
||||
|
||||
nsPageFrame::nsPageFrame()
|
||||
{
|
||||
|
@ -81,14 +83,16 @@ NS_METHOD nsPageFrame::Reflow(nsIPresContext& aPresContext,
|
|||
nsIFrame* prevLastChild = prevPage->mFrames.LastChild();
|
||||
|
||||
// Create a continuing child of the previous page's last child
|
||||
nsIStyleContext* kidSC;
|
||||
prevLastChild->GetStyleContext(&kidSC);
|
||||
nsIFrame* newFrame;
|
||||
nsresult rv = prevLastChild->CreateContinuingFrame(aPresContext, this,
|
||||
kidSC,
|
||||
newFrame);
|
||||
nsIPresShell* presShell;
|
||||
nsIStyleSet* styleSet;
|
||||
nsIFrame* newFrame;
|
||||
|
||||
aPresContext.GetShell(&presShell);
|
||||
presShell->GetStyleSet(&styleSet);
|
||||
NS_RELEASE(presShell);
|
||||
styleSet->CreateContinuingFrame(&aPresContext, prevLastChild, this, &newFrame);
|
||||
NS_RELEASE(styleSet);
|
||||
mFrames.SetFrames(newFrame);
|
||||
NS_RELEASE(kidSC);
|
||||
}
|
||||
|
||||
// Resize our frame allowing it only to be as big as we are
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "nsIDeviceContext.h"
|
||||
#include "nsIViewManager.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIStyleSet.h"
|
||||
|
||||
nsresult
|
||||
nsSimplePageSequenceFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
|
@ -151,11 +152,18 @@ nsSimplePageSequenceFrame::Reflow(nsIPresContext& aPresContext,
|
|||
} else if (nsnull == kidNextInFlow) {
|
||||
// The page isn't complete and it doesn't have a next-in-flow so
|
||||
// create a continuing page
|
||||
nsIStyleContext* kidSC;
|
||||
kidFrame->GetStyleContext(&kidSC);
|
||||
nsIFrame* continuingPage;
|
||||
nsresult rv = kidFrame->CreateContinuingFrame(aPresContext, this,
|
||||
kidSC, continuingPage);
|
||||
nsIPresShell* presShell;
|
||||
nsIStyleSet* styleSet;
|
||||
nsIFrame* continuingPage;
|
||||
|
||||
aPresContext.GetShell(&presShell);
|
||||
presShell->GetStyleSet(&styleSet);
|
||||
NS_RELEASE(presShell);
|
||||
styleSet->CreateContinuingFrame(&aPresContext, kidFrame, this, &continuingPage);
|
||||
NS_RELEASE(styleSet);
|
||||
// XXX TROY Should be handled by frame construction code
|
||||
nsIStyleContext* kidSC;
|
||||
continuingPage->GetStyleContext(&kidSC);
|
||||
nsHTMLContainerFrame::CreateViewForFrame(aPresContext, continuingPage,
|
||||
kidSC, PR_TRUE);
|
||||
NS_RELEASE(kidSC);
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include "nsDOMEvent.h"
|
||||
#include "nsIScrollableView.h"
|
||||
#include "nsWidgetsCID.h"
|
||||
#include "nsIStyleSet.h"
|
||||
|
||||
static NS_DEFINE_IID(kScrollViewIID, NS_ISCROLLABLEVIEW_IID);
|
||||
static NS_DEFINE_IID(kCChildCID, NS_CHILD_CID);
|
||||
|
@ -160,11 +161,15 @@ nsHTMLContainerFrame::CreateNextInFlow(nsIPresContext& aPresContext,
|
|||
// into our lines child list.
|
||||
nsIFrame* nextFrame;
|
||||
aFrame->GetNextSibling(&nextFrame);
|
||||
nsIStyleContext* kidSC;
|
||||
aFrame->GetStyleContext(&kidSC);
|
||||
aFrame->CreateContinuingFrame(aPresContext, aOuterFrame,
|
||||
kidSC, nextInFlow);
|
||||
NS_RELEASE(kidSC);
|
||||
|
||||
nsIPresShell* presShell;
|
||||
nsIStyleSet* styleSet;
|
||||
aPresContext.GetShell(&presShell);
|
||||
presShell->GetStyleSet(&styleSet);
|
||||
NS_RELEASE(presShell);
|
||||
styleSet->CreateContinuingFrame(&aPresContext, aFrame, aOuterFrame, &nextInFlow);
|
||||
NS_RELEASE(styleSet);
|
||||
|
||||
if (nsnull == nextInFlow) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLIIDs.h"
|
||||
#include "nsLayoutAtoms.h"
|
||||
#include "nsIStyleSet.h"
|
||||
#include "nsIPresShell.h"
|
||||
|
||||
nsPageFrame::nsPageFrame()
|
||||
{
|
||||
|
@ -81,14 +83,16 @@ NS_METHOD nsPageFrame::Reflow(nsIPresContext& aPresContext,
|
|||
nsIFrame* prevLastChild = prevPage->mFrames.LastChild();
|
||||
|
||||
// Create a continuing child of the previous page's last child
|
||||
nsIStyleContext* kidSC;
|
||||
prevLastChild->GetStyleContext(&kidSC);
|
||||
nsIFrame* newFrame;
|
||||
nsresult rv = prevLastChild->CreateContinuingFrame(aPresContext, this,
|
||||
kidSC,
|
||||
newFrame);
|
||||
nsIPresShell* presShell;
|
||||
nsIStyleSet* styleSet;
|
||||
nsIFrame* newFrame;
|
||||
|
||||
aPresContext.GetShell(&presShell);
|
||||
presShell->GetStyleSet(&styleSet);
|
||||
NS_RELEASE(presShell);
|
||||
styleSet->CreateContinuingFrame(&aPresContext, prevLastChild, this, &newFrame);
|
||||
NS_RELEASE(styleSet);
|
||||
mFrames.SetFrames(newFrame);
|
||||
NS_RELEASE(kidSC);
|
||||
}
|
||||
|
||||
// Resize our frame allowing it only to be as big as we are
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "nsIDeviceContext.h"
|
||||
#include "nsIViewManager.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIStyleSet.h"
|
||||
|
||||
nsresult
|
||||
nsSimplePageSequenceFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
|
@ -151,11 +152,18 @@ nsSimplePageSequenceFrame::Reflow(nsIPresContext& aPresContext,
|
|||
} else if (nsnull == kidNextInFlow) {
|
||||
// The page isn't complete and it doesn't have a next-in-flow so
|
||||
// create a continuing page
|
||||
nsIStyleContext* kidSC;
|
||||
kidFrame->GetStyleContext(&kidSC);
|
||||
nsIFrame* continuingPage;
|
||||
nsresult rv = kidFrame->CreateContinuingFrame(aPresContext, this,
|
||||
kidSC, continuingPage);
|
||||
nsIPresShell* presShell;
|
||||
nsIStyleSet* styleSet;
|
||||
nsIFrame* continuingPage;
|
||||
|
||||
aPresContext.GetShell(&presShell);
|
||||
presShell->GetStyleSet(&styleSet);
|
||||
NS_RELEASE(presShell);
|
||||
styleSet->CreateContinuingFrame(&aPresContext, kidFrame, this, &continuingPage);
|
||||
NS_RELEASE(styleSet);
|
||||
// XXX TROY Should be handled by frame construction code
|
||||
nsIStyleContext* kidSC;
|
||||
continuingPage->GetStyleContext(&kidSC);
|
||||
nsHTMLContainerFrame::CreateViewForFrame(aPresContext, continuingPage,
|
||||
kidSC, PR_TRUE);
|
||||
NS_RELEASE(kidSC);
|
||||
|
|
|
@ -3551,6 +3551,24 @@ nsCSSFrameConstructor::CantRenderReplacedElement(nsIPresContext* aPresContext,
|
|||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsCSSFrameConstructor::CreateContinuingFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIFrame** aContinuingFrame)
|
||||
{
|
||||
nsresult rv;
|
||||
nsIFrame* continuingFrame;
|
||||
|
||||
nsIStyleContext* styleContext;
|
||||
aFrame->GetStyleContext(&styleContext);
|
||||
rv = aFrame->CreateContinuingFrame(*aPresContext, aParentFrame, styleContext,
|
||||
continuingFrame);
|
||||
NS_RELEASE(styleContext);
|
||||
*aContinuingFrame = continuingFrame;
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsCSSFrameConstructor::RecreateFramesOnAttributeChange(nsIPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
|
|
|
@ -99,6 +99,12 @@ public:
|
|||
NS_IMETHOD CantRenderReplacedElement(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame);
|
||||
|
||||
// Request to create a continuing frame
|
||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIFrame** aContinuingFrame);
|
||||
|
||||
protected:
|
||||
|
||||
nsresult ResolveStyleContext(nsIPresContext* aPresContext,
|
||||
|
|
|
@ -44,6 +44,8 @@
|
|||
#include "nsIReflowCommand.h"
|
||||
#include "nsLayoutAtoms.h"
|
||||
#include "nsIDeviceContext.h"
|
||||
#include "nsIStyleSet.h"
|
||||
#include "nsIPresShell.h"
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
static PRBool gsDebug = PR_FALSE;
|
||||
|
@ -3586,13 +3588,15 @@ NS_METHOD nsTableFrame::ReflowMappedChildren(nsIPresContext& aPresContext,
|
|||
if (nsnull == kidNextInFlow) {
|
||||
// The child doesn't have a next-in-flow so create a continuing
|
||||
// frame. This hooks the child into the flow
|
||||
nsIFrame* continuingFrame;
|
||||
|
||||
nsIStyleContext* kidSC;
|
||||
kidFrame->GetStyleContext(&kidSC);
|
||||
kidFrame->CreateContinuingFrame(aPresContext, this, kidSC, continuingFrame);
|
||||
NS_RELEASE(kidSC);
|
||||
NS_ASSERTION(nsnull != continuingFrame, "frame creation failed");
|
||||
nsIFrame* continuingFrame;
|
||||
nsIPresShell* presShell;
|
||||
nsIStyleSet* styleSet;
|
||||
|
||||
aPresContext.GetShell(&presShell);
|
||||
presShell->GetStyleSet(&styleSet);
|
||||
NS_RELEASE(presShell);
|
||||
styleSet->CreateContinuingFrame(&aPresContext, kidFrame, this, &continuingFrame);
|
||||
NS_RELEASE(styleSet);
|
||||
|
||||
// Add the continuing frame to the sibling list
|
||||
nsIFrame* nextSib;
|
||||
|
@ -3738,13 +3742,14 @@ NS_METHOD nsTableFrame::PullUpChildren(nsIPresContext& aPresContext,
|
|||
// The child doesn't have a next-in-flow so create a
|
||||
// continuing frame. The creation appends it to the flow and
|
||||
// prepares it for reflow.
|
||||
nsIFrame* continuingFrame;
|
||||
|
||||
nsIStyleContext* kidSC;
|
||||
kidFrame->GetStyleContext(&kidSC);
|
||||
kidFrame->CreateContinuingFrame(aPresContext, this, kidSC, continuingFrame);
|
||||
NS_RELEASE(kidSC);
|
||||
NS_ASSERTION(nsnull != continuingFrame, "frame creation failed");
|
||||
nsIFrame* continuingFrame;
|
||||
nsIPresShell* presShell;
|
||||
nsIStyleSet* styleSet;
|
||||
aPresContext.GetShell(&presShell);
|
||||
presShell->GetStyleSet(&styleSet);
|
||||
NS_RELEASE(presShell);
|
||||
styleSet->CreateContinuingFrame(&aPresContext, kidFrame, this, &continuingFrame);
|
||||
NS_RELEASE(styleSet);
|
||||
|
||||
// Add the continuing frame to our sibling list and then push
|
||||
// it to the next-in-flow. This ensures the next-in-flow's
|
||||
|
|
|
@ -31,6 +31,8 @@
|
|||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIDeviceContext.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsIStyleSet.h"
|
||||
#include "nsIPresShell.h"
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
static PRBool gsDebug = PR_FALSE;
|
||||
|
@ -773,11 +775,14 @@ nsTableRowGroupFrame::SplitRowGroup(nsIPresContext& aPresContext,
|
|||
// Create a continuing frame, add it to the child list, and then push it
|
||||
// and the frames that follow
|
||||
nsIFrame* contRowFrame;
|
||||
nsIStyleContext* rowStyle;
|
||||
|
||||
rowFrame->GetStyleContext(&rowStyle);
|
||||
rowFrame->CreateContinuingFrame(aPresContext, this, rowStyle, contRowFrame);
|
||||
NS_RELEASE(rowStyle);
|
||||
nsIPresShell* presShell;
|
||||
nsIStyleSet* styleSet;
|
||||
|
||||
aPresContext.GetShell(&presShell);
|
||||
presShell->GetStyleSet(&styleSet);
|
||||
NS_RELEASE(presShell);
|
||||
styleSet->CreateContinuingFrame(&aPresContext, rowFrame, this, &contRowFrame);
|
||||
NS_RELEASE(styleSet);
|
||||
|
||||
// Add it to the child list
|
||||
nsIFrame* nextRow;
|
||||
|
@ -830,13 +835,15 @@ nsTableRowGroupFrame::SplitRowGroup(nsIPresContext& aPresContext,
|
|||
aReflowState, cellFrame, lastRowOrigin.y - firstRowOrigin.y, status);
|
||||
|
||||
// Create the continuing cell frame
|
||||
nsIStyleContext* cellStyle;
|
||||
nsIFrame* contCellFrame;
|
||||
nsIPresShell* presShell;
|
||||
nsIStyleSet* styleSet;
|
||||
|
||||
cellFrame->GetStyleContext(&cellStyle);
|
||||
cellFrame->CreateContinuingFrame(aPresContext, rowFrame, cellStyle,
|
||||
contCellFrame);
|
||||
NS_RELEASE(cellStyle);
|
||||
aPresContext.GetShell(&presShell);
|
||||
presShell->GetStyleSet(&styleSet);
|
||||
NS_RELEASE(presShell);
|
||||
styleSet->CreateContinuingFrame(&aPresContext, cellFrame, rowFrame, &contCellFrame);
|
||||
NS_RELEASE(styleSet);
|
||||
|
||||
// Add it to the row's child list
|
||||
((nsTableRowFrame*)rowFrame)->InsertCellFrame((nsTableCellFrame*)contCellFrame,
|
||||
|
|
|
@ -136,6 +136,12 @@ public:
|
|||
NS_IMETHOD CantRenderReplacedElement(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame);
|
||||
|
||||
// Request to create a continuing frame
|
||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIFrame** aContinuingFrame);
|
||||
|
||||
virtual void List(FILE* out = stdout, PRInt32 aIndent = 0);
|
||||
|
||||
private:
|
||||
|
@ -818,6 +824,16 @@ StyleSetImpl::CantRenderReplacedElement(nsIPresContext* aPresContext,
|
|||
return mFrameConstructor->CantRenderReplacedElement(aPresContext, aFrame);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
StyleSetImpl::CreateContinuingFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
nsIFrame* aParentFrame,
|
||||
nsIFrame** aContinuingFrame)
|
||||
{
|
||||
return mFrameConstructor->CreateContinuingFrame(aPresContext, aFrame, aParentFrame,
|
||||
aContinuingFrame);
|
||||
}
|
||||
|
||||
void StyleSetImpl::List(FILE* out, PRInt32 aIndent, nsISupportsArray* aSheets)
|
||||
{
|
||||
PRInt32 count = ((nsnull != aSheets) ? aSheets->Count() : 0);
|
||||
|
|
|
@ -44,6 +44,8 @@
|
|||
#include "nsIReflowCommand.h"
|
||||
#include "nsLayoutAtoms.h"
|
||||
#include "nsIDeviceContext.h"
|
||||
#include "nsIStyleSet.h"
|
||||
#include "nsIPresShell.h"
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
static PRBool gsDebug = PR_FALSE;
|
||||
|
@ -3586,13 +3588,15 @@ NS_METHOD nsTableFrame::ReflowMappedChildren(nsIPresContext& aPresContext,
|
|||
if (nsnull == kidNextInFlow) {
|
||||
// The child doesn't have a next-in-flow so create a continuing
|
||||
// frame. This hooks the child into the flow
|
||||
nsIFrame* continuingFrame;
|
||||
|
||||
nsIStyleContext* kidSC;
|
||||
kidFrame->GetStyleContext(&kidSC);
|
||||
kidFrame->CreateContinuingFrame(aPresContext, this, kidSC, continuingFrame);
|
||||
NS_RELEASE(kidSC);
|
||||
NS_ASSERTION(nsnull != continuingFrame, "frame creation failed");
|
||||
nsIFrame* continuingFrame;
|
||||
nsIPresShell* presShell;
|
||||
nsIStyleSet* styleSet;
|
||||
|
||||
aPresContext.GetShell(&presShell);
|
||||
presShell->GetStyleSet(&styleSet);
|
||||
NS_RELEASE(presShell);
|
||||
styleSet->CreateContinuingFrame(&aPresContext, kidFrame, this, &continuingFrame);
|
||||
NS_RELEASE(styleSet);
|
||||
|
||||
// Add the continuing frame to the sibling list
|
||||
nsIFrame* nextSib;
|
||||
|
@ -3738,13 +3742,14 @@ NS_METHOD nsTableFrame::PullUpChildren(nsIPresContext& aPresContext,
|
|||
// The child doesn't have a next-in-flow so create a
|
||||
// continuing frame. The creation appends it to the flow and
|
||||
// prepares it for reflow.
|
||||
nsIFrame* continuingFrame;
|
||||
|
||||
nsIStyleContext* kidSC;
|
||||
kidFrame->GetStyleContext(&kidSC);
|
||||
kidFrame->CreateContinuingFrame(aPresContext, this, kidSC, continuingFrame);
|
||||
NS_RELEASE(kidSC);
|
||||
NS_ASSERTION(nsnull != continuingFrame, "frame creation failed");
|
||||
nsIFrame* continuingFrame;
|
||||
nsIPresShell* presShell;
|
||||
nsIStyleSet* styleSet;
|
||||
aPresContext.GetShell(&presShell);
|
||||
presShell->GetStyleSet(&styleSet);
|
||||
NS_RELEASE(presShell);
|
||||
styleSet->CreateContinuingFrame(&aPresContext, kidFrame, this, &continuingFrame);
|
||||
NS_RELEASE(styleSet);
|
||||
|
||||
// Add the continuing frame to our sibling list and then push
|
||||
// it to the next-in-flow. This ensures the next-in-flow's
|
||||
|
|
|
@ -31,6 +31,8 @@
|
|||
#include "nsHTMLIIDs.h"
|
||||
#include "nsIDeviceContext.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsIStyleSet.h"
|
||||
#include "nsIPresShell.h"
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
static PRBool gsDebug = PR_FALSE;
|
||||
|
@ -773,11 +775,14 @@ nsTableRowGroupFrame::SplitRowGroup(nsIPresContext& aPresContext,
|
|||
// Create a continuing frame, add it to the child list, and then push it
|
||||
// and the frames that follow
|
||||
nsIFrame* contRowFrame;
|
||||
nsIStyleContext* rowStyle;
|
||||
|
||||
rowFrame->GetStyleContext(&rowStyle);
|
||||
rowFrame->CreateContinuingFrame(aPresContext, this, rowStyle, contRowFrame);
|
||||
NS_RELEASE(rowStyle);
|
||||
nsIPresShell* presShell;
|
||||
nsIStyleSet* styleSet;
|
||||
|
||||
aPresContext.GetShell(&presShell);
|
||||
presShell->GetStyleSet(&styleSet);
|
||||
NS_RELEASE(presShell);
|
||||
styleSet->CreateContinuingFrame(&aPresContext, rowFrame, this, &contRowFrame);
|
||||
NS_RELEASE(styleSet);
|
||||
|
||||
// Add it to the child list
|
||||
nsIFrame* nextRow;
|
||||
|
@ -830,13 +835,15 @@ nsTableRowGroupFrame::SplitRowGroup(nsIPresContext& aPresContext,
|
|||
aReflowState, cellFrame, lastRowOrigin.y - firstRowOrigin.y, status);
|
||||
|
||||
// Create the continuing cell frame
|
||||
nsIStyleContext* cellStyle;
|
||||
nsIFrame* contCellFrame;
|
||||
nsIPresShell* presShell;
|
||||
nsIStyleSet* styleSet;
|
||||
|
||||
cellFrame->GetStyleContext(&cellStyle);
|
||||
cellFrame->CreateContinuingFrame(aPresContext, rowFrame, cellStyle,
|
||||
contCellFrame);
|
||||
NS_RELEASE(cellStyle);
|
||||
aPresContext.GetShell(&presShell);
|
||||
presShell->GetStyleSet(&styleSet);
|
||||
NS_RELEASE(presShell);
|
||||
styleSet->CreateContinuingFrame(&aPresContext, cellFrame, rowFrame, &contCellFrame);
|
||||
NS_RELEASE(styleSet);
|
||||
|
||||
// Add it to the row's child list
|
||||
((nsTableRowFrame*)rowFrame)->InsertCellFrame((nsTableCellFrame*)contCellFrame,
|
||||
|
|
Загрузка…
Ссылка в новой задаче