зеркало из https://github.com/mozilla/gecko-dev.git
Removed nsIFrame::CreateContinuingFrame()
This commit is contained in:
Родитель
1b9bd80c19
Коммит
3bdf672129
|
@ -3575,100 +3575,164 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresContext* aPresContext,
|
|||
nsIFrame* aParentFrame,
|
||||
nsIFrame** aContinuingFrame)
|
||||
{
|
||||
#if 1
|
||||
nsresult rv;
|
||||
nsIFrame* continuingFrame;
|
||||
|
||||
nsIStyleContext* styleContext;
|
||||
aFrame->GetStyleContext(&styleContext);
|
||||
rv = aFrame->CreateContinuingFrame(*aPresContext, aParentFrame, styleContext,
|
||||
continuingFrame);
|
||||
NS_RELEASE(styleContext);
|
||||
*aContinuingFrame = continuingFrame;
|
||||
return rv;
|
||||
#else
|
||||
nsIAtom* frameType;
|
||||
nsIFrame* newFrame = nsnull;
|
||||
PRBool forceView = PR_FALSE;
|
||||
nsresult rv;
|
||||
nsIAtom* frameType;
|
||||
nsIContent* content;
|
||||
nsIStyleContext* styleContext;
|
||||
nsIFrame* newFrame = nsnull;
|
||||
nsresult rv;
|
||||
|
||||
// Use the frame type to determine what type of frame to create
|
||||
aFrame->GetFrameType(&frameType);
|
||||
aFrame->GetContent(&content);
|
||||
aFrame->GetStyleContext(&styleContext);
|
||||
|
||||
if (nsLayoutAtoms::textFrame == frameType) {
|
||||
rv = NS_NewTextFrame(newFrame);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
|
||||
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
|
||||
styleContext, PR_FALSE);
|
||||
}
|
||||
|
||||
} else if (nsHTMLAtoms::inlineFrame == frameType) {
|
||||
NS_NewInlineFrame(newFrame);
|
||||
rv = NS_NewInlineFrame(newFrame);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
|
||||
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
|
||||
styleContext, PR_FALSE);
|
||||
}
|
||||
|
||||
} else if (nsHTMLAtoms::blockFrame == frameType) {
|
||||
NS_NewBlockFrame(newFrame, 0);
|
||||
rv = NS_NewBlockFrame(newFrame, 0);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
|
||||
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
|
||||
styleContext, PR_FALSE);
|
||||
}
|
||||
|
||||
} else if (nsLayoutAtoms::areaFrame == frameType) {
|
||||
// XXX What should be used for the flags?
|
||||
NS_NewAreaFrame(newFrame, 0);
|
||||
rv = NS_NewAreaFrame(newFrame, 0);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
|
||||
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
|
||||
styleContext, PR_FALSE);
|
||||
}
|
||||
|
||||
} else if (nsLayoutAtoms::pageFrame == frameType) {
|
||||
NS_NewPageFrame(newFrame);
|
||||
forceView = PR_TRUE;
|
||||
rv = NS_NewPageFrame(newFrame);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
|
||||
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
|
||||
styleContext, PR_TRUE);
|
||||
}
|
||||
|
||||
} else if (nsLayoutAtoms::tableOuterFrame == frameType) {
|
||||
NS_NewTableOuterFrame(newFrame);
|
||||
rv = NS_NewTableOuterFrame(newFrame);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
|
||||
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
|
||||
styleContext, PR_FALSE);
|
||||
|
||||
// Create a continuing inner table frame
|
||||
nsIFrame* childFrame;
|
||||
nsFrameItems newChildFrames;
|
||||
|
||||
aFrame->FirstChild(nsnull, &childFrame);
|
||||
while (childFrame) {
|
||||
nsIAtom* tableType;
|
||||
|
||||
// See if it's the inner table frame
|
||||
childFrame->GetFrameType(&tableType);
|
||||
if (nsLayoutAtoms::tableFrame == tableType) {
|
||||
nsIFrame* continuingTableFrame;
|
||||
|
||||
// It's the inner table frame, so create a continuing frame
|
||||
CreateContinuingFrame(aPresContext, childFrame, newFrame, &continuingTableFrame);
|
||||
newChildFrames.AddChild(continuingTableFrame);
|
||||
}
|
||||
NS_IF_RELEASE(tableType);
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
}
|
||||
|
||||
// Set the outer table's initial child list
|
||||
newFrame->SetInitialChildList(*aPresContext, nsnull, newChildFrames.childList);
|
||||
}
|
||||
|
||||
} else if (nsLayoutAtoms::tableFrame == frameType) {
|
||||
NS_NewTableFrame(newFrame);
|
||||
rv = NS_NewTableFrame(newFrame);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
|
||||
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
|
||||
styleContext, PR_FALSE);
|
||||
}
|
||||
|
||||
} else if (nsLayoutAtoms::tableRowGroupFrame == frameType) {
|
||||
NS_NewTableRowGroupFrame(newFrame);
|
||||
rv = NS_NewTableRowGroupFrame(newFrame);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
|
||||
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
|
||||
styleContext, PR_FALSE);
|
||||
}
|
||||
|
||||
} else if (nsLayoutAtoms::tableRowFrame == frameType) {
|
||||
NS_NewTableRowFrame(newFrame);
|
||||
rv = NS_NewTableRowFrame(newFrame);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
|
||||
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
|
||||
styleContext, PR_FALSE);
|
||||
|
||||
// Create a continuing frame for each table cell frame
|
||||
nsIFrame* cellFrame;
|
||||
nsFrameItems newChildList;
|
||||
|
||||
aFrame->FirstChild(nsnull, &cellFrame);
|
||||
while (cellFrame) {
|
||||
nsIAtom* tableType;
|
||||
|
||||
// See if it's a table cell frame
|
||||
cellFrame->GetFrameType(&tableType);
|
||||
if (nsLayoutAtoms::tableCellFrame == tableType) {
|
||||
nsIFrame* continuingCellFrame;
|
||||
|
||||
CreateContinuingFrame(aPresContext, cellFrame, newFrame, &continuingCellFrame);
|
||||
newChildList.AddChild(continuingCellFrame);
|
||||
}
|
||||
|
||||
NS_IF_RELEASE(tableType);
|
||||
cellFrame->GetNextSibling(&cellFrame);
|
||||
}
|
||||
|
||||
// Set the table cell's initial child list
|
||||
newFrame->SetInitialChildList(*aPresContext, nsnull, newChildList.childList);
|
||||
}
|
||||
|
||||
} else if (nsLayoutAtoms::tableCellFrame == frameType) {
|
||||
NS_NewTableCellFrame(newFrame);
|
||||
rv = NS_NewTableCellFrame(newFrame);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
|
||||
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
|
||||
styleContext, PR_FALSE);
|
||||
|
||||
// Create a continuing area frame
|
||||
nsIFrame* areaFrame;
|
||||
nsIFrame* continuingAreaFrame;
|
||||
aFrame->FirstChild(nsnull, &areaFrame);
|
||||
CreateContinuingFrame(aPresContext, areaFrame, newFrame, &continuingAreaFrame);
|
||||
|
||||
// Set the table cell's initial child list
|
||||
newFrame->SetInitialChildList(*aPresContext, nsnull, continuingAreaFrame);
|
||||
}
|
||||
|
||||
} else {
|
||||
NS_ASSERTION(PR_FALSE, "unexpected frame type");
|
||||
rv = NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
if (NS_SUCCEEDED(rv) && newFrame) {
|
||||
nsIContent* content;
|
||||
nsIStyleContext* styleContext;
|
||||
|
||||
// Initialize the continuing frame, and create a view for it if appropriate
|
||||
aFrame->GetContent(&content);
|
||||
aFrame->GetStyleContext(&styleContext);
|
||||
newFrame->Init(*aPresContext, content, aParentFrame, styleContext);
|
||||
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
|
||||
styleContext, forceView);
|
||||
NS_RELEASE(styleContext);
|
||||
NS_RELEASE(content);
|
||||
|
||||
// Append it to the flow
|
||||
newFrame->AppendToFlow(aFrame);
|
||||
|
||||
// Make sure some of the flag bits are set
|
||||
// XXX Maybe it would be better if we passed the prev-in-flow into the Init()
|
||||
// call, and that way the frame can add itself to the flow and replicate any
|
||||
// state...
|
||||
nsFrameState state;
|
||||
nsFrameState newState;
|
||||
aFrame->GetFrameState(&state);
|
||||
newFrame->GetFrameState(&newState);
|
||||
|
||||
if (state & NS_FRAME_SYNC_FRAME_AND_VIEW) {
|
||||
newState |= NS_FRAME_SYNC_FRAME_AND_VIEW;
|
||||
}
|
||||
if (state & NS_FRAME_REPLACED_ELEMENT) {
|
||||
newState |= NS_FRAME_REPLACED_ELEMENT;
|
||||
}
|
||||
newFrame->SetFrameState(newState);
|
||||
}
|
||||
NS_RELEASE(frameType);
|
||||
|
||||
*aContinuingFrame = newFrame;
|
||||
NS_RELEASE(styleContext);
|
||||
NS_IF_RELEASE(content);
|
||||
NS_IF_RELEASE(frameType);
|
||||
return rv;
|
||||
#endif
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
|
@ -467,14 +467,8 @@ public:
|
|||
NS_IMETHOD IsSplittable(nsSplittableType& aIsSplittable) const = 0;
|
||||
|
||||
/**
|
||||
* Flow member functions. CreateContinuingFrame() is responsible for
|
||||
* appending the continuing frame to the flow.
|
||||
* Flow member functions
|
||||
*/
|
||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame) = 0;
|
||||
|
||||
NS_IMETHOD GetPrevInFlow(nsIFrame** aPrevInFlow) const = 0;
|
||||
NS_IMETHOD SetPrevInFlow(nsIFrame*) = 0;
|
||||
NS_IMETHOD GetNextInFlow(nsIFrame** aNextInFlow) const = 0;
|
||||
|
|
|
@ -80,13 +80,18 @@ nsAreaFrame::Init(nsIPresContext& aPresContext,
|
|||
nsIStyleContext* aContext,
|
||||
nsIFrame* aPrevInFlow)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
// Let the block frame do its initialization
|
||||
rv = nsBlockFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow);
|
||||
|
||||
// Create a space manager if requested
|
||||
if (0 == (mFlags & NS_AREA_NO_SPACE_MGR)) {
|
||||
mSpaceManager = new nsSpaceManager(this);
|
||||
NS_ADDREF(mSpaceManager);
|
||||
}
|
||||
|
||||
return nsBlockFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow);
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -583,22 +588,6 @@ nsAreaFrame::Reflow(nsIPresContext& aPresContext,
|
|||
return rv;
|
||||
}
|
||||
|
||||
NS_METHOD
|
||||
nsAreaFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsAreaFrame* cf = new nsAreaFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
|
||||
cf->SetFlags(mFlags);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Helper functions
|
||||
|
||||
|
|
|
@ -81,10 +81,6 @@ public:
|
|||
NS_IMETHOD DidReflow(nsIPresContext& aPresContext,
|
||||
nsDidReflowStatus aStatus);
|
||||
|
||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame);
|
||||
/**
|
||||
* Get the "type" of the frame
|
||||
*
|
||||
|
|
|
@ -4473,6 +4473,24 @@ nsBlockFrame::VerifyTree() const
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aContext,
|
||||
nsIFrame* aPrevInFlow)
|
||||
{
|
||||
if (aPrevInFlow) {
|
||||
// Copy over the block/area frame flags
|
||||
nsBlockFrame* blockFrame = (nsBlockFrame*)aPrevInFlow;
|
||||
|
||||
SetFlags(blockFrame->mFlags);
|
||||
}
|
||||
|
||||
return nsBlockFrameSuper::Init(aPresContext, aContent, aParent,
|
||||
aContext, aPrevInFlow);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
|
@ -4541,22 +4559,6 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsBlockFrame* cf = new nsBlockFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
|
||||
cf->SetFlags(mFlags);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsBlockFrame::RenumberLists()
|
||||
{
|
||||
|
|
|
@ -51,6 +51,11 @@ public:
|
|||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
|
||||
// nsIFrame
|
||||
NS_IMETHOD Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aContext,
|
||||
nsIFrame* aPrevInFlow);
|
||||
NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aChildList);
|
||||
|
@ -74,10 +79,6 @@ public:
|
|||
NS_IMETHOD IsSplittable(nsSplittableType& aIsSplittable) const;
|
||||
NS_IMETHOD ReResolveStyleContext(nsIPresContext* aPresContext,
|
||||
nsIStyleContext* aParentContext);
|
||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame);
|
||||
NS_IMETHOD IsPercentageBase(PRBool& aBase) const;
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
|
|
|
@ -4473,6 +4473,24 @@ nsBlockFrame::VerifyTree() const
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aContext,
|
||||
nsIFrame* aPrevInFlow)
|
||||
{
|
||||
if (aPrevInFlow) {
|
||||
// Copy over the block/area frame flags
|
||||
nsBlockFrame* blockFrame = (nsBlockFrame*)aPrevInFlow;
|
||||
|
||||
SetFlags(blockFrame->mFlags);
|
||||
}
|
||||
|
||||
return nsBlockFrameSuper::Init(aPresContext, aContent, aParent,
|
||||
aContext, aPrevInFlow);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
|
@ -4541,22 +4559,6 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsBlockFrame* cf = new nsBlockFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
|
||||
cf->SetFlags(mFlags);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsBlockFrame::RenumberLists()
|
||||
{
|
||||
|
|
|
@ -4473,6 +4473,24 @@ nsBlockFrame::VerifyTree() const
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aContext,
|
||||
nsIFrame* aPrevInFlow)
|
||||
{
|
||||
if (aPrevInFlow) {
|
||||
// Copy over the block/area frame flags
|
||||
nsBlockFrame* blockFrame = (nsBlockFrame*)aPrevInFlow;
|
||||
|
||||
SetFlags(blockFrame->mFlags);
|
||||
}
|
||||
|
||||
return nsBlockFrameSuper::Init(aPresContext, aContent, aParent,
|
||||
aContext, aPrevInFlow);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
|
@ -4541,22 +4559,6 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsBlockFrame* cf = new nsBlockFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
|
||||
cf->SetFlags(mFlags);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsBlockFrame::RenumberLists()
|
||||
{
|
||||
|
|
|
@ -1098,16 +1098,6 @@ NS_IMETHODIMP nsFrame::IsSplittable(nsSplittableType& aIsSplittable) const
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
NS_ERROR("not splittable");
|
||||
aContinuingFrame = nsnull;
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsFrame::GetPrevInFlow(nsIFrame** aPrevInFlow) const
|
||||
{
|
||||
*aPrevInFlow = nsnull;
|
||||
|
|
|
@ -183,10 +183,6 @@ public:
|
|||
nsIAtom* aAttribute,
|
||||
PRInt32 aHint);
|
||||
NS_IMETHOD IsSplittable(nsSplittableType& aIsSplittable) const;
|
||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame);
|
||||
NS_IMETHOD GetPrevInFlow(nsIFrame** aPrevInFlow) const;
|
||||
NS_IMETHOD SetPrevInFlow(nsIFrame*);
|
||||
NS_IMETHOD GetNextInFlow(nsIFrame** aNextInFlow) const;
|
||||
|
|
|
@ -467,14 +467,8 @@ public:
|
|||
NS_IMETHOD IsSplittable(nsSplittableType& aIsSplittable) const = 0;
|
||||
|
||||
/**
|
||||
* Flow member functions. CreateContinuingFrame() is responsible for
|
||||
* appending the continuing frame to the flow.
|
||||
* Flow member functions
|
||||
*/
|
||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame) = 0;
|
||||
|
||||
NS_IMETHOD GetPrevInFlow(nsIFrame** aPrevInFlow) const = 0;
|
||||
NS_IMETHOD SetPrevInFlow(nsIFrame*) = 0;
|
||||
NS_IMETHOD GetNextInFlow(nsIFrame** aNextInFlow) const = 0;
|
||||
|
|
|
@ -75,10 +75,6 @@ public:
|
|||
nsIAtom* aListName,
|
||||
nsIFrame* aOldFrame);
|
||||
NS_IMETHOD DeleteFrame(nsIPresContext& aPresContext);
|
||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext& aCX,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame);
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
|
||||
|
||||
|
@ -1763,23 +1759,6 @@ nsInlineFrame::ReflowBlockFrame(ReflowState& rs,
|
|||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsInlineFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsInlineFrame* cf = new nsInlineFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
PRIntn
|
||||
nsInlineFrame::GetSkipSides() const
|
||||
{
|
||||
|
|
|
@ -138,21 +138,6 @@ NS_METHOD nsPageFrame::Reflow(nsIPresContext& aPresContext,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD
|
||||
nsPageFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsPageFrame* cf = new nsPageFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPageFrame::GetFrameType(nsIAtom** aType) const
|
||||
{
|
||||
|
|
|
@ -30,11 +30,6 @@ public:
|
|||
const nsHTMLReflowState& aMaxSize,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext& aCX,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame);
|
||||
|
||||
/**
|
||||
* Get the "type" of the frame
|
||||
*
|
||||
|
|
|
@ -30,8 +30,6 @@ public:
|
|||
nsIStyleContext* aContext,
|
||||
nsIFrame* aPrevInFlow);
|
||||
|
||||
// CreateContinuingFrame() does the default behavior of using the
|
||||
// content delegate to create a new frame
|
||||
NS_IMETHOD IsSplittable(nsSplittableType& aIsSplittable) const;
|
||||
|
||||
// Flow member functions.
|
||||
|
|
|
@ -97,11 +97,6 @@ public:
|
|||
TextFrame();
|
||||
|
||||
// nsIFrame
|
||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame);
|
||||
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect,
|
||||
|
@ -493,21 +488,6 @@ TextFrame::GetCursor(nsIPresContext& aPresContext,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
TextFrame::CreateContinuingFrame(nsIPresContext& aCX,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
TextFrame* cf = new TextFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aCX, mContent, aParent, aStyleContext, this);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
TextFrame::ContentChanged(nsIPresContext* aPresContext,
|
||||
nsIContent* aChild,
|
||||
|
|
|
@ -80,13 +80,18 @@ nsAreaFrame::Init(nsIPresContext& aPresContext,
|
|||
nsIStyleContext* aContext,
|
||||
nsIFrame* aPrevInFlow)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
// Let the block frame do its initialization
|
||||
rv = nsBlockFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow);
|
||||
|
||||
// Create a space manager if requested
|
||||
if (0 == (mFlags & NS_AREA_NO_SPACE_MGR)) {
|
||||
mSpaceManager = new nsSpaceManager(this);
|
||||
NS_ADDREF(mSpaceManager);
|
||||
}
|
||||
|
||||
return nsBlockFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow);
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -583,22 +588,6 @@ nsAreaFrame::Reflow(nsIPresContext& aPresContext,
|
|||
return rv;
|
||||
}
|
||||
|
||||
NS_METHOD
|
||||
nsAreaFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsAreaFrame* cf = new nsAreaFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
|
||||
cf->SetFlags(mFlags);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Helper functions
|
||||
|
||||
|
|
|
@ -81,10 +81,6 @@ public:
|
|||
NS_IMETHOD DidReflow(nsIPresContext& aPresContext,
|
||||
nsDidReflowStatus aStatus);
|
||||
|
||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame);
|
||||
/**
|
||||
* Get the "type" of the frame
|
||||
*
|
||||
|
|
|
@ -4473,6 +4473,24 @@ nsBlockFrame::VerifyTree() const
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aContext,
|
||||
nsIFrame* aPrevInFlow)
|
||||
{
|
||||
if (aPrevInFlow) {
|
||||
// Copy over the block/area frame flags
|
||||
nsBlockFrame* blockFrame = (nsBlockFrame*)aPrevInFlow;
|
||||
|
||||
SetFlags(blockFrame->mFlags);
|
||||
}
|
||||
|
||||
return nsBlockFrameSuper::Init(aPresContext, aContent, aParent,
|
||||
aContext, aPrevInFlow);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
|
@ -4541,22 +4559,6 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsBlockFrame* cf = new nsBlockFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
|
||||
cf->SetFlags(mFlags);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsBlockFrame::RenumberLists()
|
||||
{
|
||||
|
|
|
@ -51,6 +51,11 @@ public:
|
|||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
|
||||
// nsIFrame
|
||||
NS_IMETHOD Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aContext,
|
||||
nsIFrame* aPrevInFlow);
|
||||
NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aChildList);
|
||||
|
@ -74,10 +79,6 @@ public:
|
|||
NS_IMETHOD IsSplittable(nsSplittableType& aIsSplittable) const;
|
||||
NS_IMETHOD ReResolveStyleContext(nsIPresContext* aPresContext,
|
||||
nsIStyleContext* aParentContext);
|
||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame);
|
||||
NS_IMETHOD IsPercentageBase(PRBool& aBase) const;
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
|
|
|
@ -4473,6 +4473,24 @@ nsBlockFrame::VerifyTree() const
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aContext,
|
||||
nsIFrame* aPrevInFlow)
|
||||
{
|
||||
if (aPrevInFlow) {
|
||||
// Copy over the block/area frame flags
|
||||
nsBlockFrame* blockFrame = (nsBlockFrame*)aPrevInFlow;
|
||||
|
||||
SetFlags(blockFrame->mFlags);
|
||||
}
|
||||
|
||||
return nsBlockFrameSuper::Init(aPresContext, aContent, aParent,
|
||||
aContext, aPrevInFlow);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
|
@ -4541,22 +4559,6 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsBlockFrame* cf = new nsBlockFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
|
||||
cf->SetFlags(mFlags);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsBlockFrame::RenumberLists()
|
||||
{
|
||||
|
|
|
@ -4473,6 +4473,24 @@ nsBlockFrame::VerifyTree() const
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aContext,
|
||||
nsIFrame* aPrevInFlow)
|
||||
{
|
||||
if (aPrevInFlow) {
|
||||
// Copy over the block/area frame flags
|
||||
nsBlockFrame* blockFrame = (nsBlockFrame*)aPrevInFlow;
|
||||
|
||||
SetFlags(blockFrame->mFlags);
|
||||
}
|
||||
|
||||
return nsBlockFrameSuper::Init(aPresContext, aContent, aParent,
|
||||
aContext, aPrevInFlow);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
|
@ -4541,22 +4559,6 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBlockFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsBlockFrame* cf = new nsBlockFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
|
||||
cf->SetFlags(mFlags);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsBlockFrame::RenumberLists()
|
||||
{
|
||||
|
|
|
@ -1098,16 +1098,6 @@ NS_IMETHODIMP nsFrame::IsSplittable(nsSplittableType& aIsSplittable) const
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
NS_ERROR("not splittable");
|
||||
aContinuingFrame = nsnull;
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsFrame::GetPrevInFlow(nsIFrame** aPrevInFlow) const
|
||||
{
|
||||
*aPrevInFlow = nsnull;
|
||||
|
|
|
@ -183,10 +183,6 @@ public:
|
|||
nsIAtom* aAttribute,
|
||||
PRInt32 aHint);
|
||||
NS_IMETHOD IsSplittable(nsSplittableType& aIsSplittable) const;
|
||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame);
|
||||
NS_IMETHOD GetPrevInFlow(nsIFrame** aPrevInFlow) const;
|
||||
NS_IMETHOD SetPrevInFlow(nsIFrame*);
|
||||
NS_IMETHOD GetNextInFlow(nsIFrame** aNextInFlow) const;
|
||||
|
|
|
@ -75,10 +75,6 @@ public:
|
|||
nsIAtom* aListName,
|
||||
nsIFrame* aOldFrame);
|
||||
NS_IMETHOD DeleteFrame(nsIPresContext& aPresContext);
|
||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext& aCX,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame);
|
||||
NS_IMETHOD GetFrameName(nsString& aResult) const;
|
||||
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
|
||||
|
||||
|
@ -1763,23 +1759,6 @@ nsInlineFrame::ReflowBlockFrame(ReflowState& rs,
|
|||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsInlineFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsInlineFrame* cf = new nsInlineFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
PRIntn
|
||||
nsInlineFrame::GetSkipSides() const
|
||||
{
|
||||
|
|
|
@ -138,21 +138,6 @@ NS_METHOD nsPageFrame::Reflow(nsIPresContext& aPresContext,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD
|
||||
nsPageFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsPageFrame* cf = new nsPageFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPageFrame::GetFrameType(nsIAtom** aType) const
|
||||
{
|
||||
|
|
|
@ -30,11 +30,6 @@ public:
|
|||
const nsHTMLReflowState& aMaxSize,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext& aCX,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame);
|
||||
|
||||
/**
|
||||
* Get the "type" of the frame
|
||||
*
|
||||
|
|
|
@ -30,8 +30,6 @@ public:
|
|||
nsIStyleContext* aContext,
|
||||
nsIFrame* aPrevInFlow);
|
||||
|
||||
// CreateContinuingFrame() does the default behavior of using the
|
||||
// content delegate to create a new frame
|
||||
NS_IMETHOD IsSplittable(nsSplittableType& aIsSplittable) const;
|
||||
|
||||
// Flow member functions.
|
||||
|
|
|
@ -97,11 +97,6 @@ public:
|
|||
TextFrame();
|
||||
|
||||
// nsIFrame
|
||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame);
|
||||
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect,
|
||||
|
@ -493,21 +488,6 @@ TextFrame::GetCursor(nsIPresContext& aPresContext,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
TextFrame::CreateContinuingFrame(nsIPresContext& aCX,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
TextFrame* cf = new TextFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aCX, mContent, aParent, aStyleContext, this);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
TextFrame::ContentChanged(nsIPresContext* aPresContext,
|
||||
nsIContent* aChild,
|
||||
|
|
|
@ -3575,100 +3575,164 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsIPresContext* aPresContext,
|
|||
nsIFrame* aParentFrame,
|
||||
nsIFrame** aContinuingFrame)
|
||||
{
|
||||
#if 1
|
||||
nsresult rv;
|
||||
nsIFrame* continuingFrame;
|
||||
|
||||
nsIStyleContext* styleContext;
|
||||
aFrame->GetStyleContext(&styleContext);
|
||||
rv = aFrame->CreateContinuingFrame(*aPresContext, aParentFrame, styleContext,
|
||||
continuingFrame);
|
||||
NS_RELEASE(styleContext);
|
||||
*aContinuingFrame = continuingFrame;
|
||||
return rv;
|
||||
#else
|
||||
nsIAtom* frameType;
|
||||
nsIFrame* newFrame = nsnull;
|
||||
PRBool forceView = PR_FALSE;
|
||||
nsresult rv;
|
||||
nsIAtom* frameType;
|
||||
nsIContent* content;
|
||||
nsIStyleContext* styleContext;
|
||||
nsIFrame* newFrame = nsnull;
|
||||
nsresult rv;
|
||||
|
||||
// Use the frame type to determine what type of frame to create
|
||||
aFrame->GetFrameType(&frameType);
|
||||
aFrame->GetContent(&content);
|
||||
aFrame->GetStyleContext(&styleContext);
|
||||
|
||||
if (nsLayoutAtoms::textFrame == frameType) {
|
||||
rv = NS_NewTextFrame(newFrame);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
|
||||
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
|
||||
styleContext, PR_FALSE);
|
||||
}
|
||||
|
||||
} else if (nsHTMLAtoms::inlineFrame == frameType) {
|
||||
NS_NewInlineFrame(newFrame);
|
||||
rv = NS_NewInlineFrame(newFrame);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
|
||||
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
|
||||
styleContext, PR_FALSE);
|
||||
}
|
||||
|
||||
} else if (nsHTMLAtoms::blockFrame == frameType) {
|
||||
NS_NewBlockFrame(newFrame, 0);
|
||||
rv = NS_NewBlockFrame(newFrame, 0);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
|
||||
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
|
||||
styleContext, PR_FALSE);
|
||||
}
|
||||
|
||||
} else if (nsLayoutAtoms::areaFrame == frameType) {
|
||||
// XXX What should be used for the flags?
|
||||
NS_NewAreaFrame(newFrame, 0);
|
||||
rv = NS_NewAreaFrame(newFrame, 0);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
|
||||
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
|
||||
styleContext, PR_FALSE);
|
||||
}
|
||||
|
||||
} else if (nsLayoutAtoms::pageFrame == frameType) {
|
||||
NS_NewPageFrame(newFrame);
|
||||
forceView = PR_TRUE;
|
||||
rv = NS_NewPageFrame(newFrame);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
|
||||
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
|
||||
styleContext, PR_TRUE);
|
||||
}
|
||||
|
||||
} else if (nsLayoutAtoms::tableOuterFrame == frameType) {
|
||||
NS_NewTableOuterFrame(newFrame);
|
||||
rv = NS_NewTableOuterFrame(newFrame);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
|
||||
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
|
||||
styleContext, PR_FALSE);
|
||||
|
||||
// Create a continuing inner table frame
|
||||
nsIFrame* childFrame;
|
||||
nsFrameItems newChildFrames;
|
||||
|
||||
aFrame->FirstChild(nsnull, &childFrame);
|
||||
while (childFrame) {
|
||||
nsIAtom* tableType;
|
||||
|
||||
// See if it's the inner table frame
|
||||
childFrame->GetFrameType(&tableType);
|
||||
if (nsLayoutAtoms::tableFrame == tableType) {
|
||||
nsIFrame* continuingTableFrame;
|
||||
|
||||
// It's the inner table frame, so create a continuing frame
|
||||
CreateContinuingFrame(aPresContext, childFrame, newFrame, &continuingTableFrame);
|
||||
newChildFrames.AddChild(continuingTableFrame);
|
||||
}
|
||||
NS_IF_RELEASE(tableType);
|
||||
childFrame->GetNextSibling(&childFrame);
|
||||
}
|
||||
|
||||
// Set the outer table's initial child list
|
||||
newFrame->SetInitialChildList(*aPresContext, nsnull, newChildFrames.childList);
|
||||
}
|
||||
|
||||
} else if (nsLayoutAtoms::tableFrame == frameType) {
|
||||
NS_NewTableFrame(newFrame);
|
||||
rv = NS_NewTableFrame(newFrame);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
|
||||
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
|
||||
styleContext, PR_FALSE);
|
||||
}
|
||||
|
||||
} else if (nsLayoutAtoms::tableRowGroupFrame == frameType) {
|
||||
NS_NewTableRowGroupFrame(newFrame);
|
||||
rv = NS_NewTableRowGroupFrame(newFrame);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
|
||||
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
|
||||
styleContext, PR_FALSE);
|
||||
}
|
||||
|
||||
} else if (nsLayoutAtoms::tableRowFrame == frameType) {
|
||||
NS_NewTableRowFrame(newFrame);
|
||||
rv = NS_NewTableRowFrame(newFrame);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
|
||||
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
|
||||
styleContext, PR_FALSE);
|
||||
|
||||
// Create a continuing frame for each table cell frame
|
||||
nsIFrame* cellFrame;
|
||||
nsFrameItems newChildList;
|
||||
|
||||
aFrame->FirstChild(nsnull, &cellFrame);
|
||||
while (cellFrame) {
|
||||
nsIAtom* tableType;
|
||||
|
||||
// See if it's a table cell frame
|
||||
cellFrame->GetFrameType(&tableType);
|
||||
if (nsLayoutAtoms::tableCellFrame == tableType) {
|
||||
nsIFrame* continuingCellFrame;
|
||||
|
||||
CreateContinuingFrame(aPresContext, cellFrame, newFrame, &continuingCellFrame);
|
||||
newChildList.AddChild(continuingCellFrame);
|
||||
}
|
||||
|
||||
NS_IF_RELEASE(tableType);
|
||||
cellFrame->GetNextSibling(&cellFrame);
|
||||
}
|
||||
|
||||
// Set the table cell's initial child list
|
||||
newFrame->SetInitialChildList(*aPresContext, nsnull, newChildList.childList);
|
||||
}
|
||||
|
||||
} else if (nsLayoutAtoms::tableCellFrame == frameType) {
|
||||
NS_NewTableCellFrame(newFrame);
|
||||
rv = NS_NewTableCellFrame(newFrame);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
newFrame->Init(*aPresContext, content, aParentFrame, styleContext, aFrame);
|
||||
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
|
||||
styleContext, PR_FALSE);
|
||||
|
||||
// Create a continuing area frame
|
||||
nsIFrame* areaFrame;
|
||||
nsIFrame* continuingAreaFrame;
|
||||
aFrame->FirstChild(nsnull, &areaFrame);
|
||||
CreateContinuingFrame(aPresContext, areaFrame, newFrame, &continuingAreaFrame);
|
||||
|
||||
// Set the table cell's initial child list
|
||||
newFrame->SetInitialChildList(*aPresContext, nsnull, continuingAreaFrame);
|
||||
}
|
||||
|
||||
} else {
|
||||
NS_ASSERTION(PR_FALSE, "unexpected frame type");
|
||||
rv = NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
if (NS_SUCCEEDED(rv) && newFrame) {
|
||||
nsIContent* content;
|
||||
nsIStyleContext* styleContext;
|
||||
|
||||
// Initialize the continuing frame, and create a view for it if appropriate
|
||||
aFrame->GetContent(&content);
|
||||
aFrame->GetStyleContext(&styleContext);
|
||||
newFrame->Init(*aPresContext, content, aParentFrame, styleContext);
|
||||
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
|
||||
styleContext, forceView);
|
||||
NS_RELEASE(styleContext);
|
||||
NS_RELEASE(content);
|
||||
|
||||
// Append it to the flow
|
||||
newFrame->AppendToFlow(aFrame);
|
||||
|
||||
// Make sure some of the flag bits are set
|
||||
// XXX Maybe it would be better if we passed the prev-in-flow into the Init()
|
||||
// call, and that way the frame can add itself to the flow and replicate any
|
||||
// state...
|
||||
nsFrameState state;
|
||||
nsFrameState newState;
|
||||
aFrame->GetFrameState(&state);
|
||||
newFrame->GetFrameState(&newState);
|
||||
|
||||
if (state & NS_FRAME_SYNC_FRAME_AND_VIEW) {
|
||||
newState |= NS_FRAME_SYNC_FRAME_AND_VIEW;
|
||||
}
|
||||
if (state & NS_FRAME_REPLACED_ELEMENT) {
|
||||
newState |= NS_FRAME_REPLACED_ELEMENT;
|
||||
}
|
||||
newFrame->SetFrameState(newState);
|
||||
}
|
||||
NS_RELEASE(frameType);
|
||||
|
||||
*aContinuingFrame = newFrame;
|
||||
NS_RELEASE(styleContext);
|
||||
NS_IF_RELEASE(content);
|
||||
NS_IF_RELEASE(frameType);
|
||||
return rv;
|
||||
#endif
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
|
@ -56,6 +56,31 @@ NS_IMPL_ADDREF(nsTableCellFrame)
|
|||
NS_IMPL_RELEASE(nsTableCellFrame)
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsTableCellFrame::Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aContext,
|
||||
nsIFrame* aPrevInFlow)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
// Let the base class do its initialization
|
||||
rv = nsHTMLContainerFrame::Init(aPresContext, aContent, aParent, aContext,
|
||||
aPrevInFlow);
|
||||
|
||||
if (aPrevInFlow) {
|
||||
// Set the column index
|
||||
nsTableCellFrame* cellFrame = (nsTableCellFrame*)aPrevInFlow;
|
||||
PRInt32 baseColIndex;
|
||||
|
||||
cellFrame->GetColIndex(baseColIndex);
|
||||
InitCellFrame(baseColIndex);
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
void nsTableCellFrame::InitCellFrame(PRInt32 aColIndex)
|
||||
{
|
||||
NS_PRECONDITION(0<=aColIndex, "bad col index arg");
|
||||
|
@ -586,35 +611,6 @@ NS_METHOD nsTableCellFrame::IR_StyleChanged(nsIPresContext& aPresContex
|
|||
return rv;
|
||||
}
|
||||
|
||||
NS_METHOD
|
||||
nsTableCellFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsTableCellFrame* cf = new nsTableCellFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
|
||||
PRInt32 baseColIndex;
|
||||
GetColIndex(baseColIndex);
|
||||
cf->InitCellFrame(baseColIndex);
|
||||
aContinuingFrame = cf;
|
||||
|
||||
// Create a continuing body frame
|
||||
nsIFrame* childList;
|
||||
nsIStyleContext* kidSC;
|
||||
|
||||
nsIFrame* firstKid = mFrames.FirstChild();
|
||||
firstKid->GetStyleContext(&kidSC);
|
||||
firstKid->CreateContinuingFrame(aPresContext, cf, kidSC, childList);
|
||||
NS_RELEASE(kidSC);
|
||||
cf->SetInitialChildList(aPresContext, nsnull, childList);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Update the border style to map to the HTML border style
|
||||
|
|
|
@ -48,6 +48,12 @@ public:
|
|||
|
||||
// default constructor supplied by the compiler
|
||||
|
||||
NS_IMETHOD Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aContext,
|
||||
nsIFrame* aPrevInFlow);
|
||||
|
||||
void InitCellFrame(PRInt32 aColIndex);
|
||||
|
||||
void SetBorderEdge(PRUint8 aSide,
|
||||
|
@ -79,14 +85,6 @@ public:
|
|||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
/**
|
||||
* @see nsContainerFrame
|
||||
*/
|
||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame);
|
||||
|
||||
/**
|
||||
* Get the "type" of the frame
|
||||
*
|
||||
|
|
|
@ -308,14 +308,27 @@ nsTableFrame::Init(nsIPresContext& aPresContext,
|
|||
nsIStyleContext* aContext,
|
||||
nsIFrame* aPrevInFlow)
|
||||
{
|
||||
float p2t;
|
||||
nsresult rv;
|
||||
float p2t;
|
||||
|
||||
aPresContext.GetPixelsToTwips(&p2t);
|
||||
mDefaultCellSpacingX = NSIntPixelsToTwips(2, p2t);
|
||||
mDefaultCellSpacingY = NSIntPixelsToTwips(2, p2t);
|
||||
mDefaultCellPadding = NSIntPixelsToTwips(1, p2t);
|
||||
|
||||
return nsHTMLContainerFrame::Init(aPresContext, aContent, aParent, aContext,
|
||||
aPrevInFlow);
|
||||
// Let the base class do its processing
|
||||
rv = nsHTMLContainerFrame::Init(aPresContext, aContent, aParent, aContext,
|
||||
aPrevInFlow);
|
||||
|
||||
if (aPrevInFlow) {
|
||||
// set my width, because all frames in a table flow are the same width and
|
||||
// code in nsTableOuterFrame depends on this being set
|
||||
nsSize size;
|
||||
aPrevInFlow->GetSize(size);
|
||||
mRect.width = size.width;
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
|
@ -4452,70 +4465,6 @@ void nsTableFrame::InvalidateCellMap()
|
|||
if (PR_TRUE==gsDebugIR) printf("TIF: CellMap invalidated.\n");
|
||||
}
|
||||
|
||||
NS_METHOD
|
||||
nsTableFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsTableFrame* cf = new nsTableFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
|
||||
if (PR_TRUE==gsDebug) printf("nsTableFrame::CCF parent = %p, this=%p, cf=%p\n", aParent, this, cf);
|
||||
// set my width, because all frames in a table flow are the same width
|
||||
// code in nsTableOuterFrame depends on this being set
|
||||
cf->SetRect(nsRect(0, 0, mRect.width, 0));
|
||||
// add headers and footers to cf
|
||||
nsTableFrame * firstInFlow = (nsTableFrame *)GetFirstInFlow();
|
||||
nsIFrame * rg = nsnull;
|
||||
firstInFlow->FirstChild(nsnull, &rg);
|
||||
NS_ASSERTION (nsnull!=rg, "previous frame has no children");
|
||||
PRInt32 index = 0;
|
||||
nsIFrame * bodyRowGroupFromOverflow = mOverflowFrames.FirstChild();
|
||||
nsIFrame * lastSib = nsnull;
|
||||
for ( ; nsnull!=rg; index++)
|
||||
{
|
||||
nsIContent *content = nsnull;
|
||||
rg->GetContent(&content); // content: REFCNT++
|
||||
NS_ASSERTION(nsnull!=content, "bad frame, returned null content.");
|
||||
const nsStyleDisplay* display;
|
||||
//XXX: TROY: this was just this->GetStyleData which can't be right
|
||||
rg->GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display);
|
||||
if ((display->mDisplay == NS_STYLE_DISPLAY_TABLE_HEADER_GROUP) ||
|
||||
(display->mDisplay == NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP))
|
||||
{
|
||||
printf("found a head or foot in continuing frame\n");
|
||||
// Resolve style for the child
|
||||
nsIStyleContext* kidStyleContext;
|
||||
aPresContext.ResolveStyleContextFor(content, aStyleContext,
|
||||
PR_FALSE, &kidStyleContext); // kidStyleContext: REFCNT++
|
||||
|
||||
nsIFrame* duplicateFrame;
|
||||
NS_NewTableRowGroupFrame(duplicateFrame);
|
||||
duplicateFrame->Init(aPresContext, content, cf, kidStyleContext, nsnull);
|
||||
NS_RELEASE(kidStyleContext); // kidStyleContenxt: REFCNT--
|
||||
|
||||
if (nsnull==lastSib)
|
||||
{
|
||||
mOverflowFrames.SetFrames(duplicateFrame);
|
||||
}
|
||||
else
|
||||
{
|
||||
lastSib->SetNextSibling(duplicateFrame);
|
||||
}
|
||||
duplicateFrame->SetNextSibling(bodyRowGroupFromOverflow);
|
||||
lastSib = duplicateFrame;
|
||||
}
|
||||
NS_RELEASE(content); // content: REFCNT--
|
||||
// get the next row group
|
||||
rg->GetNextSibling(&rg);
|
||||
}
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRInt32 nsTableFrame::GetColumnWidth(PRInt32 aColIndex)
|
||||
{
|
||||
nsTableFrame * firstInFlow = (nsTableFrame *)GetFirstInFlow();
|
||||
|
|
|
@ -182,12 +182,6 @@ public:
|
|||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
/** @see nsContainerFrame::CreateContinuingFrame */
|
||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame);
|
||||
|
||||
/** allow the cell and row attributes to effect the column frame
|
||||
* currently, the only reason this exists is to support the HTML "rule"
|
||||
* that a width attribute on a cell in the first column sets the column width.
|
||||
|
|
|
@ -1083,33 +1083,6 @@ void nsTableOuterFrame::PlaceChild( OuterTableReflowState& aReflowState,
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
NS_METHOD
|
||||
nsTableOuterFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsTableOuterFrame* cf = new nsTableOuterFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
|
||||
if (PR_TRUE==gsDebug)
|
||||
printf("nsTableOuterFrame::CCF parent = %p, this=%p, cf=%p\n", aParent, this, cf);
|
||||
aContinuingFrame = cf;
|
||||
|
||||
// Create a continuing inner table frame
|
||||
nsIFrame* childList;
|
||||
nsIStyleContext* kidSC;
|
||||
|
||||
mInnerTableFrame->GetStyleContext(&kidSC);
|
||||
mInnerTableFrame->CreateContinuingFrame(aPresContext, cf, kidSC, childList);
|
||||
NS_RELEASE(kidSC);
|
||||
cf->SetInitialChildList(aPresContext, nsnull, childList);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD nsTableOuterFrame::VerifyTree() const
|
||||
{
|
||||
#ifdef NS_DEBUG
|
||||
|
|
|
@ -69,12 +69,6 @@ public:
|
|||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
/** @see nsIFrame::CreateContinuingFrame */
|
||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame);
|
||||
|
||||
/**
|
||||
* Get the "type" of the frame
|
||||
*
|
||||
|
|
|
@ -92,6 +92,29 @@ nsTableRowFrame::nsTableRowFrame()
|
|||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsTableRowFrame::Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aContext,
|
||||
nsIFrame* aPrevInFlow)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
// Let the the base class do its initialization
|
||||
rv = nsHTMLContainerFrame::Init(aPresContext, aContent, aParent, aContext,
|
||||
aPrevInFlow);
|
||||
|
||||
if (aPrevInFlow) {
|
||||
// Set the row index
|
||||
nsTableRowFrame* rowFrame = (nsTableRowFrame*)aPrevInFlow;
|
||||
|
||||
SetRowIndex(rowFrame->GetRowIndex());
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsTableRowFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
|
@ -1430,50 +1453,6 @@ nsTableRowFrame::Reflow(nsIPresContext& aPresContext,
|
|||
return rv;
|
||||
}
|
||||
|
||||
NS_METHOD
|
||||
nsTableRowFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsTableRowFrame* cf = new nsTableRowFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
|
||||
cf->SetRowIndex(GetRowIndex());
|
||||
|
||||
// Create a continuing frame for each table cell frame
|
||||
nsIFrame* newChildList;
|
||||
for (nsIFrame* kidFrame = mFrames.FirstChild();
|
||||
nsnull != kidFrame;
|
||||
kidFrame->GetNextSibling(&kidFrame)) {
|
||||
|
||||
const nsStyleDisplay *kidDisplay;
|
||||
kidFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)kidDisplay));
|
||||
if (NS_STYLE_DISPLAY_TABLE_CELL == kidDisplay->mDisplay) {
|
||||
nsIFrame* contCellFrame;
|
||||
nsIStyleContext* kidSC;
|
||||
|
||||
// Create a continuing cell frame
|
||||
kidFrame->GetStyleContext(&kidSC);
|
||||
kidFrame->CreateContinuingFrame(aPresContext, cf, kidSC, contCellFrame);
|
||||
NS_RELEASE(kidSC);
|
||||
|
||||
// Link it into the list of child frames
|
||||
if (nsnull == cf->mFrames.FirstChild()) {
|
||||
cf->mFrames.SetFrames(contCellFrame);
|
||||
} else {
|
||||
newChildList->SetNextSibling(contCellFrame);
|
||||
}
|
||||
newChildList = contCellFrame;
|
||||
}
|
||||
}
|
||||
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* we overload this here because rows have children that can span outside of themselves.
|
||||
* so the default "get the child rect, see if it contains the event point" action isn't
|
||||
* sufficient. We have to ask the row if it has a child that contains the point.
|
||||
|
|
|
@ -38,6 +38,12 @@ struct RowReflowState;
|
|||
class nsTableRowFrame : public nsHTMLContainerFrame
|
||||
{
|
||||
public:
|
||||
NS_IMETHOD Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aContext,
|
||||
nsIFrame* aPrevInFlow);
|
||||
|
||||
/** Initialization of data */
|
||||
NS_IMETHOD InitChildren(PRInt32 aRowIndex=-1);
|
||||
|
||||
|
@ -93,12 +99,6 @@ public:
|
|||
virtual void DidResize(nsIPresContext& aPresContext,
|
||||
const nsHTMLReflowState& aReflowState);
|
||||
|
||||
/** @see nsContainerFrame::CreateContinuingFrame */
|
||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame);
|
||||
|
||||
/**
|
||||
* Get the "type" of the frame
|
||||
*
|
||||
|
|
|
@ -1296,23 +1296,6 @@ NS_METHOD nsTableRowGroupFrame::IR_StyleChanged(nsIPresContext& aPresContex
|
|||
return rv;
|
||||
}
|
||||
|
||||
// XXX this doesn't handle scrolling, it that is even possible in this context
|
||||
NS_METHOD
|
||||
nsTableRowGroupFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsTableRowGroupFrame* cf = new nsTableRowGroupFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
|
||||
if (PR_TRUE==gsDebug) printf("nsTableRowGroupFrame::CCF parent = %p, this=%p, cf=%p\n", aParent, this, cf);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsTableRowGroupFrame::GetFrameType(nsIAtom** aType) const
|
||||
{
|
||||
|
|
|
@ -184,12 +184,6 @@ protected:
|
|||
|
||||
PRBool NoRowsFollow();
|
||||
|
||||
/** @see nsContainerFrame::CreateContinuingFrame */
|
||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame);
|
||||
|
||||
nsresult AdjustSiblingsAfterReflow(nsIPresContext& aPresContext,
|
||||
RowGroupReflowState& aReflowState,
|
||||
nsIFrame* aKidFrame,
|
||||
|
|
|
@ -56,6 +56,31 @@ NS_IMPL_ADDREF(nsTableCellFrame)
|
|||
NS_IMPL_RELEASE(nsTableCellFrame)
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsTableCellFrame::Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aContext,
|
||||
nsIFrame* aPrevInFlow)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
// Let the base class do its initialization
|
||||
rv = nsHTMLContainerFrame::Init(aPresContext, aContent, aParent, aContext,
|
||||
aPrevInFlow);
|
||||
|
||||
if (aPrevInFlow) {
|
||||
// Set the column index
|
||||
nsTableCellFrame* cellFrame = (nsTableCellFrame*)aPrevInFlow;
|
||||
PRInt32 baseColIndex;
|
||||
|
||||
cellFrame->GetColIndex(baseColIndex);
|
||||
InitCellFrame(baseColIndex);
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
void nsTableCellFrame::InitCellFrame(PRInt32 aColIndex)
|
||||
{
|
||||
NS_PRECONDITION(0<=aColIndex, "bad col index arg");
|
||||
|
@ -586,35 +611,6 @@ NS_METHOD nsTableCellFrame::IR_StyleChanged(nsIPresContext& aPresContex
|
|||
return rv;
|
||||
}
|
||||
|
||||
NS_METHOD
|
||||
nsTableCellFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsTableCellFrame* cf = new nsTableCellFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
|
||||
PRInt32 baseColIndex;
|
||||
GetColIndex(baseColIndex);
|
||||
cf->InitCellFrame(baseColIndex);
|
||||
aContinuingFrame = cf;
|
||||
|
||||
// Create a continuing body frame
|
||||
nsIFrame* childList;
|
||||
nsIStyleContext* kidSC;
|
||||
|
||||
nsIFrame* firstKid = mFrames.FirstChild();
|
||||
firstKid->GetStyleContext(&kidSC);
|
||||
firstKid->CreateContinuingFrame(aPresContext, cf, kidSC, childList);
|
||||
NS_RELEASE(kidSC);
|
||||
cf->SetInitialChildList(aPresContext, nsnull, childList);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Update the border style to map to the HTML border style
|
||||
|
|
|
@ -48,6 +48,12 @@ public:
|
|||
|
||||
// default constructor supplied by the compiler
|
||||
|
||||
NS_IMETHOD Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aContext,
|
||||
nsIFrame* aPrevInFlow);
|
||||
|
||||
void InitCellFrame(PRInt32 aColIndex);
|
||||
|
||||
void SetBorderEdge(PRUint8 aSide,
|
||||
|
@ -79,14 +85,6 @@ public:
|
|||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
/**
|
||||
* @see nsContainerFrame
|
||||
*/
|
||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame);
|
||||
|
||||
/**
|
||||
* Get the "type" of the frame
|
||||
*
|
||||
|
|
|
@ -308,14 +308,27 @@ nsTableFrame::Init(nsIPresContext& aPresContext,
|
|||
nsIStyleContext* aContext,
|
||||
nsIFrame* aPrevInFlow)
|
||||
{
|
||||
float p2t;
|
||||
nsresult rv;
|
||||
float p2t;
|
||||
|
||||
aPresContext.GetPixelsToTwips(&p2t);
|
||||
mDefaultCellSpacingX = NSIntPixelsToTwips(2, p2t);
|
||||
mDefaultCellSpacingY = NSIntPixelsToTwips(2, p2t);
|
||||
mDefaultCellPadding = NSIntPixelsToTwips(1, p2t);
|
||||
|
||||
return nsHTMLContainerFrame::Init(aPresContext, aContent, aParent, aContext,
|
||||
aPrevInFlow);
|
||||
// Let the base class do its processing
|
||||
rv = nsHTMLContainerFrame::Init(aPresContext, aContent, aParent, aContext,
|
||||
aPrevInFlow);
|
||||
|
||||
if (aPrevInFlow) {
|
||||
// set my width, because all frames in a table flow are the same width and
|
||||
// code in nsTableOuterFrame depends on this being set
|
||||
nsSize size;
|
||||
aPrevInFlow->GetSize(size);
|
||||
mRect.width = size.width;
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
|
@ -4452,70 +4465,6 @@ void nsTableFrame::InvalidateCellMap()
|
|||
if (PR_TRUE==gsDebugIR) printf("TIF: CellMap invalidated.\n");
|
||||
}
|
||||
|
||||
NS_METHOD
|
||||
nsTableFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsTableFrame* cf = new nsTableFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
|
||||
if (PR_TRUE==gsDebug) printf("nsTableFrame::CCF parent = %p, this=%p, cf=%p\n", aParent, this, cf);
|
||||
// set my width, because all frames in a table flow are the same width
|
||||
// code in nsTableOuterFrame depends on this being set
|
||||
cf->SetRect(nsRect(0, 0, mRect.width, 0));
|
||||
// add headers and footers to cf
|
||||
nsTableFrame * firstInFlow = (nsTableFrame *)GetFirstInFlow();
|
||||
nsIFrame * rg = nsnull;
|
||||
firstInFlow->FirstChild(nsnull, &rg);
|
||||
NS_ASSERTION (nsnull!=rg, "previous frame has no children");
|
||||
PRInt32 index = 0;
|
||||
nsIFrame * bodyRowGroupFromOverflow = mOverflowFrames.FirstChild();
|
||||
nsIFrame * lastSib = nsnull;
|
||||
for ( ; nsnull!=rg; index++)
|
||||
{
|
||||
nsIContent *content = nsnull;
|
||||
rg->GetContent(&content); // content: REFCNT++
|
||||
NS_ASSERTION(nsnull!=content, "bad frame, returned null content.");
|
||||
const nsStyleDisplay* display;
|
||||
//XXX: TROY: this was just this->GetStyleData which can't be right
|
||||
rg->GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display);
|
||||
if ((display->mDisplay == NS_STYLE_DISPLAY_TABLE_HEADER_GROUP) ||
|
||||
(display->mDisplay == NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP))
|
||||
{
|
||||
printf("found a head or foot in continuing frame\n");
|
||||
// Resolve style for the child
|
||||
nsIStyleContext* kidStyleContext;
|
||||
aPresContext.ResolveStyleContextFor(content, aStyleContext,
|
||||
PR_FALSE, &kidStyleContext); // kidStyleContext: REFCNT++
|
||||
|
||||
nsIFrame* duplicateFrame;
|
||||
NS_NewTableRowGroupFrame(duplicateFrame);
|
||||
duplicateFrame->Init(aPresContext, content, cf, kidStyleContext, nsnull);
|
||||
NS_RELEASE(kidStyleContext); // kidStyleContenxt: REFCNT--
|
||||
|
||||
if (nsnull==lastSib)
|
||||
{
|
||||
mOverflowFrames.SetFrames(duplicateFrame);
|
||||
}
|
||||
else
|
||||
{
|
||||
lastSib->SetNextSibling(duplicateFrame);
|
||||
}
|
||||
duplicateFrame->SetNextSibling(bodyRowGroupFromOverflow);
|
||||
lastSib = duplicateFrame;
|
||||
}
|
||||
NS_RELEASE(content); // content: REFCNT--
|
||||
// get the next row group
|
||||
rg->GetNextSibling(&rg);
|
||||
}
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRInt32 nsTableFrame::GetColumnWidth(PRInt32 aColIndex)
|
||||
{
|
||||
nsTableFrame * firstInFlow = (nsTableFrame *)GetFirstInFlow();
|
||||
|
|
|
@ -182,12 +182,6 @@ public:
|
|||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
/** @see nsContainerFrame::CreateContinuingFrame */
|
||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame);
|
||||
|
||||
/** allow the cell and row attributes to effect the column frame
|
||||
* currently, the only reason this exists is to support the HTML "rule"
|
||||
* that a width attribute on a cell in the first column sets the column width.
|
||||
|
|
|
@ -1083,33 +1083,6 @@ void nsTableOuterFrame::PlaceChild( OuterTableReflowState& aReflowState,
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
NS_METHOD
|
||||
nsTableOuterFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsTableOuterFrame* cf = new nsTableOuterFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
|
||||
if (PR_TRUE==gsDebug)
|
||||
printf("nsTableOuterFrame::CCF parent = %p, this=%p, cf=%p\n", aParent, this, cf);
|
||||
aContinuingFrame = cf;
|
||||
|
||||
// Create a continuing inner table frame
|
||||
nsIFrame* childList;
|
||||
nsIStyleContext* kidSC;
|
||||
|
||||
mInnerTableFrame->GetStyleContext(&kidSC);
|
||||
mInnerTableFrame->CreateContinuingFrame(aPresContext, cf, kidSC, childList);
|
||||
NS_RELEASE(kidSC);
|
||||
cf->SetInitialChildList(aPresContext, nsnull, childList);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD nsTableOuterFrame::VerifyTree() const
|
||||
{
|
||||
#ifdef NS_DEBUG
|
||||
|
|
|
@ -69,12 +69,6 @@ public:
|
|||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
/** @see nsIFrame::CreateContinuingFrame */
|
||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame);
|
||||
|
||||
/**
|
||||
* Get the "type" of the frame
|
||||
*
|
||||
|
|
|
@ -92,6 +92,29 @@ nsTableRowFrame::nsTableRowFrame()
|
|||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsTableRowFrame::Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aContext,
|
||||
nsIFrame* aPrevInFlow)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
// Let the the base class do its initialization
|
||||
rv = nsHTMLContainerFrame::Init(aPresContext, aContent, aParent, aContext,
|
||||
aPrevInFlow);
|
||||
|
||||
if (aPrevInFlow) {
|
||||
// Set the row index
|
||||
nsTableRowFrame* rowFrame = (nsTableRowFrame*)aPrevInFlow;
|
||||
|
||||
SetRowIndex(rowFrame->GetRowIndex());
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsTableRowFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
||||
nsIAtom* aListName,
|
||||
|
@ -1430,50 +1453,6 @@ nsTableRowFrame::Reflow(nsIPresContext& aPresContext,
|
|||
return rv;
|
||||
}
|
||||
|
||||
NS_METHOD
|
||||
nsTableRowFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsTableRowFrame* cf = new nsTableRowFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
|
||||
cf->SetRowIndex(GetRowIndex());
|
||||
|
||||
// Create a continuing frame for each table cell frame
|
||||
nsIFrame* newChildList;
|
||||
for (nsIFrame* kidFrame = mFrames.FirstChild();
|
||||
nsnull != kidFrame;
|
||||
kidFrame->GetNextSibling(&kidFrame)) {
|
||||
|
||||
const nsStyleDisplay *kidDisplay;
|
||||
kidFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)kidDisplay));
|
||||
if (NS_STYLE_DISPLAY_TABLE_CELL == kidDisplay->mDisplay) {
|
||||
nsIFrame* contCellFrame;
|
||||
nsIStyleContext* kidSC;
|
||||
|
||||
// Create a continuing cell frame
|
||||
kidFrame->GetStyleContext(&kidSC);
|
||||
kidFrame->CreateContinuingFrame(aPresContext, cf, kidSC, contCellFrame);
|
||||
NS_RELEASE(kidSC);
|
||||
|
||||
// Link it into the list of child frames
|
||||
if (nsnull == cf->mFrames.FirstChild()) {
|
||||
cf->mFrames.SetFrames(contCellFrame);
|
||||
} else {
|
||||
newChildList->SetNextSibling(contCellFrame);
|
||||
}
|
||||
newChildList = contCellFrame;
|
||||
}
|
||||
}
|
||||
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* we overload this here because rows have children that can span outside of themselves.
|
||||
* so the default "get the child rect, see if it contains the event point" action isn't
|
||||
* sufficient. We have to ask the row if it has a child that contains the point.
|
||||
|
|
|
@ -38,6 +38,12 @@ struct RowReflowState;
|
|||
class nsTableRowFrame : public nsHTMLContainerFrame
|
||||
{
|
||||
public:
|
||||
NS_IMETHOD Init(nsIPresContext& aPresContext,
|
||||
nsIContent* aContent,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aContext,
|
||||
nsIFrame* aPrevInFlow);
|
||||
|
||||
/** Initialization of data */
|
||||
NS_IMETHOD InitChildren(PRInt32 aRowIndex=-1);
|
||||
|
||||
|
@ -93,12 +99,6 @@ public:
|
|||
virtual void DidResize(nsIPresContext& aPresContext,
|
||||
const nsHTMLReflowState& aReflowState);
|
||||
|
||||
/** @see nsContainerFrame::CreateContinuingFrame */
|
||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame);
|
||||
|
||||
/**
|
||||
* Get the "type" of the frame
|
||||
*
|
||||
|
|
|
@ -1296,23 +1296,6 @@ NS_METHOD nsTableRowGroupFrame::IR_StyleChanged(nsIPresContext& aPresContex
|
|||
return rv;
|
||||
}
|
||||
|
||||
// XXX this doesn't handle scrolling, it that is even possible in this context
|
||||
NS_METHOD
|
||||
nsTableRowGroupFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsTableRowGroupFrame* cf = new nsTableRowGroupFrame;
|
||||
if (nsnull == cf) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
|
||||
if (PR_TRUE==gsDebug) printf("nsTableRowGroupFrame::CCF parent = %p, this=%p, cf=%p\n", aParent, this, cf);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsTableRowGroupFrame::GetFrameType(nsIAtom** aType) const
|
||||
{
|
||||
|
|
|
@ -184,12 +184,6 @@ protected:
|
|||
|
||||
PRBool NoRowsFollow();
|
||||
|
||||
/** @see nsContainerFrame::CreateContinuingFrame */
|
||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext& aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame);
|
||||
|
||||
nsresult AdjustSiblingsAfterReflow(nsIPresContext& aPresContext,
|
||||
RowGroupReflowState& aReflowState,
|
||||
nsIFrame* aKidFrame,
|
||||
|
|
Загрузка…
Ссылка в новой задаче