Changed nsIFrame::Init() to take an additional parameter

This commit is contained in:
troy%netscape.com 1999-02-25 03:27:57 +00:00
Родитель f085f7a416
Коммит da4193eab6
72 изменённых файлов: 345 добавлений и 216 удалений

Просмотреть файл

@ -367,7 +367,7 @@ nsCSSFrameConstructor::ConstructTableFrame(nsIPresContext* aPresContext,
// Init the table outer frame and see if we need to create a view, e.g.
// the frame is absolutely positioned
aNewFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext);
aNewFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, nsnull);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, aNewFrame,
aStyleContext, PR_FALSE);
nsCOMPtr<nsIStyleContext> parentStyleContext;
@ -389,7 +389,7 @@ nsCSSFrameConstructor::ConstructTableFrame(nsIPresContext* aPresContext,
aNewFrame->SetInitialChildList(*aPresContext, nsnull, innerFrame);
childList = innerFrame;
innerFrame->Init(*aPresContext, aContent, aNewFrame, aStyleContext);
innerFrame->Init(*aPresContext, aContent, aNewFrame, aStyleContext, nsnull);
nsIFrame* lastChildFrame = nsnull;
PRInt32 count;
@ -502,7 +502,8 @@ nsCSSFrameConstructor::ConstructAnonymousTableFrame (nsIPresContext* aPresConte
getter_AddRefs(outerStyleContext));
result = NS_NewTableOuterFrame(aOuterFrame);
if (NS_SUCCEEDED(result)) {
aOuterFrame->Init(*aPresContext, aContent, aParentFrame, outerStyleContext);
aOuterFrame->Init(*aPresContext, aContent, aParentFrame, outerStyleContext,
nsnull);
// create the inner table frames
nsCOMPtr<nsIStyleContext> innerStyleContext;
@ -512,7 +513,8 @@ nsCSSFrameConstructor::ConstructAnonymousTableFrame (nsIPresContext* aPresConte
getter_AddRefs(innerStyleContext));
result = aTableCreator.CreateTableFrame(aInnerFrame);
if (NS_SUCCEEDED(result)) {
aInnerFrame->Init(*aPresContext, aContent, aOuterFrame, innerStyleContext);
aInnerFrame->Init(*aPresContext, aContent, aOuterFrame, innerStyleContext,
nsnull);
}
}
}
@ -541,20 +543,23 @@ nsCSSFrameConstructor::ConstructTableCaptionFrame(nsIPresContext* aPresContext,
if (NS_STYLE_DISPLAY_TABLE == parentDisplay->mDisplay) { // parent is an outer table
aParentFrame->FirstChild(nsnull, &innerFrame);
aNewCaptionFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext);
aNewCaptionFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext,
nsnull);
innerFrame->SetNextSibling(aNewCaptionFrame);
// the caller is responsible for calling SetInitialChildList on the outer, inner frames
aNewTopMostFrame = aNewCaptionFrame;
} else { // parent is not a table, need to create a new table
nsIFrame* outerFrame;
ConstructAnonymousTableFrame(aPresContext, aContent, aParentFrame, outerFrame, innerFrame, aFixedItems, aTableCreator);
ConstructAnonymousTableFrame(aPresContext, aContent, aParentFrame, outerFrame,
innerFrame, aFixedItems, aTableCreator);
nsCOMPtr<nsIStyleContext> outerStyleContext;
outerFrame->GetStyleContext(getter_AddRefs(outerStyleContext));
nsCOMPtr<nsIStyleContext> adjStyleContext;
aPresContext->ResolveStyleContextFor(aContent, outerStyleContext,
PR_FALSE,
getter_AddRefs(adjStyleContext));
aNewCaptionFrame->Init(*aPresContext, aContent, outerFrame, adjStyleContext);
aNewCaptionFrame->Init(*aPresContext, aContent, outerFrame, adjStyleContext,
nsnull);
innerFrame->SetNextSibling(aNewCaptionFrame);
outerFrame->SetInitialChildList(*aPresContext, nsnull, innerFrame);
innerFrame->SetInitialChildList(*aPresContext, nsnull, nsnull);
@ -663,7 +668,8 @@ nsCSSFrameConstructor::ConstructTableGroupFrameOnly(nsIPresContext* aPresContex
// Create a scroll frame and initialize it
rv = NS_NewScrollFrame(aNewTopMostFrame);
if (NS_SUCCEEDED(rv)) {
aNewTopMostFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext);
aNewTopMostFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext,
nsnull);
// The scroll frame gets the original style context, the scrolled frame gets
// a pseudo element style context that inherits the background properties
@ -679,7 +685,8 @@ nsCSSFrameConstructor::ConstructTableGroupFrameOnly(nsIPresContext* aPresContex
if (NS_SUCCEEDED(rv)) {
// Initialize the frame and force it to have a view
aNewGroupFrame->Init(*aPresContext, aContent, aNewTopMostFrame, scrolledPseudoStyle);
aNewGroupFrame->Init(*aPresContext, aContent, aNewTopMostFrame, scrolledPseudoStyle,
nsnull);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, aNewGroupFrame,
scrolledPseudoStyle, PR_TRUE);
aNewTopMostFrame->SetInitialChildList(*aPresContext, nsnull, aNewGroupFrame);
@ -689,7 +696,8 @@ nsCSSFrameConstructor::ConstructTableGroupFrameOnly(nsIPresContext* aPresContex
rv = (aIsRowGroup) ? aTableCreator.CreateTableRowGroupFrame(aNewTopMostFrame)
: aTableCreator.CreateTableColGroupFrame(aNewTopMostFrame);
if (NS_SUCCEEDED(rv)) {
aNewTopMostFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext);
aNewTopMostFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext,
nsnull);
aNewGroupFrame = aNewTopMostFrame;
}
}
@ -769,7 +777,8 @@ nsCSSFrameConstructor::ConstructTableRowFrame(nsIPresContext* aPresContext,
rv = ConstructTableRowFrameOnly(aPresContext, aContent, groupFrame, styleContext,
aAbsoluteItems, contentDisplayIsRow, aNewRowFrame, aFixedItems, aTableCreator);
if (NS_SUCCEEDED(rv)) {
aNewRowFrame->Init(*aPresContext, aContent, groupFrame, styleContext);
aNewRowFrame->Init(*aPresContext, aContent, groupFrame, styleContext,
nsnull);
if (aToDo) {
aToDo->Push(groupFrame);
aToDo->Push(aNewRowFrame);
@ -799,7 +808,8 @@ nsCSSFrameConstructor::ConstructTableRowFrameOnly(nsIPresContext* aPresContext,
{
nsresult rv = aTableCreator.CreateTableRowFrame(aNewRowFrame);
if (NS_SUCCEEDED(rv)) {
aNewRowFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext);
aNewRowFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext,
nsnull);
if (aProcessChildren) {
nsFrameItems childItems;
rv = TableProcessChildren(aPresContext, aContent, aNewRowFrame, aAbsoluteItems,
@ -829,7 +839,8 @@ nsCSSFrameConstructor::ConstructTableColFrame(nsIPresContext* aPresContext,
const nsStyleDisplay* parentDisplay = GetDisplay(aParentFrame);
if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == parentDisplay->mDisplay) {
rv = aTableCreator.CreateTableColFrame(aNewColFrame);
aNewColFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext);
aNewColFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext,
nsnull);
aNewTopMostFrame = aNewColFrame;
} else { // construct anonymous col group frame
nsIFrame* groupFrame;
@ -844,7 +855,7 @@ nsCSSFrameConstructor::ConstructTableColFrame(nsIPresContext* aPresContext,
PR_FALSE,
getter_AddRefs(styleContext));
rv = aTableCreator.CreateTableColFrame(aNewColFrame);
aNewColFrame->Init(*aPresContext, aContent, groupFrame, styleContext);
aNewColFrame->Init(*aPresContext, aContent, groupFrame, styleContext, nsnull);
if (NS_SUCCEEDED(rv)) {
groupFrame->SetInitialChildList(*aPresContext, nsnull, aNewColFrame);
}
@ -947,7 +958,7 @@ nsCSSFrameConstructor::ConstructTableCellFrameOnly(nsIPresContext* aPresContext
rv = aTableCreator.CreateTableCellFrame(aNewFrame);
if (NS_SUCCEEDED(rv)) {
// Initialize the table cell frame
aNewFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext);
aNewFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, nsnull);
// Create an area frame that will format the cell's content
nsIFrame* cellBodyFrame;
@ -964,7 +975,7 @@ nsCSSFrameConstructor::ConstructTableCellFrameOnly(nsIPresContext* aPresContext
aPresContext->ResolvePseudoStyleContextFor(aContent, nsHTMLAtoms::cellContentPseudo,
aStyleContext, PR_FALSE,
getter_AddRefs(bodyPseudoStyle));
cellBodyFrame->Init(*aPresContext, aContent, aNewFrame, bodyPseudoStyle);
cellBodyFrame->Init(*aPresContext, aContent, aNewFrame, bodyPseudoStyle, nsnull);
nsFrameItems childItems;
if (aWrapContent) {
@ -1233,7 +1244,7 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresContext* aPresContext,
nsIFrame* areaFrame;
NS_NewAreaFrame(areaFrame, 0);
areaFrame->Init(*aPresContext, aDocElement, aParentFrame, styleContext);
areaFrame->Init(*aPresContext, aDocElement, aParentFrame, styleContext, nsnull);
// The area frame is the "initial containing block"
mInitialContainingBlock = areaFrame;
@ -1265,7 +1276,8 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresContext* aPresContext,
if (IsScrollable(aPresContext, display)) {
NS_NewScrollFrame(scrollFrame);
scrollFrame->Init(*aPresContext, aDocElement, aParentFrame, styleContext);
scrollFrame->Init(*aPresContext, aDocElement, aParentFrame, styleContext,
nsnull);
// The scrolled frame gets a pseudo element style context
nsCOMPtr<nsIStyleContext> scrolledPseudoStyle;
@ -1285,7 +1297,7 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresContext* aPresContext,
// flag that says that this is the body...
NS_NewAreaFrame(areaFrame, NS_BLOCK_DOCUMENT_ROOT|NS_BLOCK_MARGIN_ROOT);
areaFrame->Init(*aPresContext, aDocElement, scrollFrame ? scrollFrame :
aParentFrame, styleContext);
aParentFrame, styleContext, nsnull);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, areaFrame,
styleContext, PR_FALSE);
@ -1343,7 +1355,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext,
getter_AddRefs(viewportPseudoStyle));
// Initialize the viewport frame. It has a NULL content object
viewportFrame->Init(*aPresContext, nsnull, nsnull, viewportPseudoStyle);
viewportFrame->Init(*aPresContext, nsnull, nsnull, viewportPseudoStyle, nsnull);
// Bind the viewport frame to the root view
nsCOMPtr<nsIPresShell> presShell;
@ -1384,7 +1396,8 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext,
if (isScrollable) {
NS_NewScrollFrame(scrollFrame);
// XXX should probably be a scrolled content pseudo style context
scrollFrame->Init(*aPresContext, nsnull, viewportFrame, viewportPseudoStyle);
scrollFrame->Init(*aPresContext, nsnull, viewportFrame, viewportPseudoStyle,
nsnull);
// Inform the view manager about the root scrollable view
nsIView* scrollFrameView;
@ -1405,7 +1418,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext,
NS_NewSimplePageSequenceFrame(pageSequenceFrame);
// XXX should probably be a page sequence pseudo style context
pageSequenceFrame->Init(*aPresContext, nsnull, isScrollable ? scrollFrame :
viewportFrame, viewportPseudoStyle);
viewportFrame, viewportPseudoStyle, nsnull);
if (isScrollable) {
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, pageSequenceFrame,
viewportPseudoStyle, PR_TRUE);
@ -1428,7 +1441,8 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext,
viewportPseudoStyle, PR_FALSE,
getter_AddRefs(pagePseudoStyle));
pageFrame->Init(*aPresContext, nsnull, pageSequenceFrame, pagePseudoStyle);
pageFrame->Init(*aPresContext, nsnull, pageSequenceFrame, pagePseudoStyle,
nsnull);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, pageFrame,
pagePseudoStyle, PR_TRUE);
@ -1461,7 +1475,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext,
// XXX this should be a root pseudo style context
rootFrame->Init(*aPresContext, nsnull, isScrollable ? scrollFrame :
viewportFrame, viewportPseudoStyle);
viewportFrame, viewportPseudoStyle, nsnull);
if (isScrollable) {
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, rootFrame,
viewportPseudoStyle, PR_TRUE);
@ -1504,7 +1518,7 @@ nsCSSFrameConstructor::CreatePlaceholderFrameFor(nsIPresContext* aPresContext,
PR_FALSE,
getter_AddRefs(placeholderPseudoStyle));
placeholderFrame->Init(*aPresContext, aContent, aParentFrame,
placeholderPseudoStyle);
placeholderPseudoStyle, nsnull);
// Add mapping from absolutely positioned frame to its placeholder frame
nsCOMPtr<nsIPresShell> presShell;
@ -1701,7 +1715,7 @@ nsCSSFrameConstructor::ConstructFrameByTag(nsIPresContext* aPresContext,
rv = NS_NewObjectFrame(newFrame);
nsIFrame *blockFrame;
NS_NewBlockFrame(blockFrame, 0);
blockFrame->Init(*aPresContext, aContent, newFrame, aStyleContext);
blockFrame->Init(*aPresContext, aContent, newFrame, aStyleContext, nsnull);
newFrame = blockFrame;
processChildren = PR_TRUE;
}
@ -1752,7 +1766,8 @@ nsCSSFrameConstructor::ConstructFrameByTag(nsIPresContext* aPresContext,
}
}
newFrame->Init(*aPresContext, aContent, geometricParent, aStyleContext);
newFrame->Init(*aPresContext, aContent, geometricParent, aStyleContext,
nsnull);
// See if we need to create a view, e.g. the frame is absolutely positioned
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
@ -1993,7 +2008,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresContext* aPresContext,
if (NS_SUCCEEDED(rv) && newFrame != nsnull) {
nsIFrame* geometricParent = isAbsolutelyPositioned ? aAbsoluteItems.containingBlock :
aParentFrame;
newFrame->Init(*aPresContext, aContent, geometricParent, aStyleContext);
newFrame->Init(*aPresContext, aContent, geometricParent, aStyleContext, nsnull);
// See if we need to create a view, e.g. the frame is absolutely positioned
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
@ -2056,7 +2071,8 @@ nsCSSFrameConstructor::InitializeScrollFrame(nsIFrame* scrollFrame,
} else if (aIsFixedPositioned) {
geometricParent = aFixedItems.containingBlock;
}
scrollFrame->Init(*aPresContext, aContent, geometricParent, aStyleContext);
scrollFrame->Init(*aPresContext, aContent, geometricParent, aStyleContext,
nsnull);
// The scroll frame gets the original style context, and the scrolled
// frame gets a SCROLLED-CONTENT pseudo element style context that
@ -2071,7 +2087,8 @@ nsCSSFrameConstructor::InitializeScrollFrame(nsIFrame* scrollFrame,
NS_NewAreaFrame(scrolledFrame, NS_BLOCK_SHRINK_WRAP);
// Initialize the frame and force it to have a view
scrolledFrame->Init(*aPresContext, aContent, scrollFrame, scrolledPseudoStyle);
scrolledFrame->Init(*aPresContext, aContent, scrollFrame, scrolledPseudoStyle,
nsnull);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, scrolledFrame,
scrolledPseudoStyle, PR_TRUE);
@ -2223,7 +2240,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresContext* aPresCo
NS_NewAreaFrame(newFrame, 0);
newFrame->Init(*aPresContext, aContent, isAbsolutelyPositioned ?
aAbsoluteItems.containingBlock : aFixedItems.containingBlock,
aStyleContext);
aStyleContext, nsnull);
// Create a view
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
@ -2254,7 +2271,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresContext* aPresCo
NS_NewAreaFrame(newFrame, NS_BLOCK_SHRINK_WRAP);
// Initialize the frame
newFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext);
newFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, nsnull);
// See if we need to create a view
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
@ -2274,7 +2291,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresContext* aPresCo
// Create an area frame. No space manager, though
NS_NewAreaFrame(newFrame, NS_AREA_NO_SPACE_MGR);
newFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext);
newFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, nsnull);
// Create a view
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
@ -2398,7 +2415,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresContext* aPresCo
// If we succeeded in creating a frame then initialize the frame and
// process children if requested
if (NS_SUCCEEDED(rv) && (nsnull != newFrame)) {
newFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext);
newFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, nsnull);
// See if we need to create a view, e.g. the frame is absolutely positioned
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
@ -3443,8 +3460,9 @@ nsCSSFrameConstructor::ConstructAlternateImageFrame(nsIPresContext* aPresContext
getter_AddRefs(textStyleContext));
// Initialize the frames
inlineFrame->Init(*aPresContext, aContent, aParentFrame, textStyleContext);
textFrame->Init(*aPresContext, altTextContent, inlineFrame, textStyleContext);
inlineFrame->Init(*aPresContext, aContent, aParentFrame, textStyleContext, nsnull);
textFrame->Init(*aPresContext, altTextContent, inlineFrame,
textStyleContext, nsnull);
inlineFrame->SetInitialChildList(*aPresContext, nsnull, textFrame);
// Return the inline frame

Просмотреть файл

@ -163,18 +163,25 @@ public:
* Called to initialize the frame. This is called immediately after creating
* the frame.
*
* If you want a view associated with your frame you should create the view
* If the frame is a continuing frame, then aPrevInFlow indicates the previous
* frame (the frame that was split). You should connect the continuing frame to
* its prev-in-flow, e.g. by using the AppendToFlow() function
*
* If you want a view associated with your frame, you should create the view
* now.
*
* @param aContent the content object associated with the frame
* @param aGeometricParent the geometric parent frame
* @param aContentParent the content parent frame
* @param aContext the style context associated with the frame
* @param aPrevInFlow the prev-in-flow frame
* @see #AppendToFlow()
*/
NS_IMETHOD Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext) = 0;
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow) = 0;
/**
* Called to set the initial list of frames. This happens after the frame

Просмотреть файл

@ -132,7 +132,7 @@ nsFieldSetFrame::SetInitialChildList(nsIPresContext& aPresContext,
nsHTMLAtoms::fieldsetContentPseudo,
mStyleContext, PR_FALSE,
&styleContext);
mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext);
mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext, nsnull);
NS_RELEASE(styleContext);
nsIFrame* newChildList = aChildList;

Просмотреть файл

@ -209,10 +209,10 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext,
if (NS_SUCCEEDED(rv)) {
// Found the pseudo style for the text field
childFrame->Init(aPresContext, text, this, textFieldStyleContext);
childFrame->Init(aPresContext, text, this, textFieldStyleContext, nsnull);
} else {
// Can't find pseduo style so use the style set for the file updload element
childFrame->Init(aPresContext, mContent, this, mStyleContext);
childFrame->Init(aPresContext, mContent, this, mStyleContext, nsnull);
}
mTextFrame = (nsTextControlFrame*)childFrame;
mFrames.SetFrames(childFrame);
@ -236,10 +236,10 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext,
getter_AddRefs(buttonStyleContext));
if (NS_SUCCEEDED(rv)) {
// Found pseduo style for the button
childFrame->Init(aPresContext, browse, this, buttonStyleContext);
childFrame->Init(aPresContext, browse, this, buttonStyleContext, nsnull);
} else {
// Can't find pseudo style for the button so use the style set for the file upload element
childFrame->Init(aPresContext, mContent, this, mStyleContext);
childFrame->Init(aPresContext, mContent, this, mStyleContext, nsnull);
}
mFrames.FirstChild()->SetNextSibling(childFrame);

Просмотреть файл

@ -549,7 +549,7 @@ nsHTMLButtonControlFrame::SetInitialChildList(nsIPresContext& aPresContext,
aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::buttonContentPseudo,
mStyleContext, PR_FALSE,
&styleContext);
mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext);
mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext, nsnull);
NS_RELEASE(styleContext);
// Set the parent for each of the child frames

Просмотреть файл

@ -99,7 +99,7 @@ nsLegendFrame::SetInitialChildList(nsIPresContext& aPresContext,
aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::legendContentPseudo,
mStyleContext, PR_FALSE,
&styleContext);
mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext);
mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext, nsnull);
NS_RELEASE(styleContext);
// Set the parent for each of the child frames

Просмотреть файл

@ -769,11 +769,13 @@ nsListControlFrame::DoRemoveFrame(nsBlockReflowState& aState,
//----------------------------------------------------------------------
NS_IMETHODIMP
nsListControlFrame::Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext)
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult result = nsScrollFrame::Init(aPresContext, aContent, aParent, aContext);
nsresult result = nsScrollFrame::Init(aPresContext, aContent, aParent, aContext,
aPrevInFlow);
/*if (NS_OK == result) {
nsIDOMNode* node;
if (mContent && (NS_OK == mContent->QueryInterface(kIDOMNodeIID, (void**) &node))) {

Просмотреть файл

@ -119,7 +119,8 @@ public:
NS_IMETHOD Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext);
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD Deselect();

Просмотреть файл

@ -77,7 +77,8 @@ NS_IMETHODIMP
nsAreaFrame::Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext)
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
// Create a space manager if requested
if (0 == (mFlags & NS_AREA_NO_SPACE_MGR)) {
@ -85,7 +86,7 @@ nsAreaFrame::Init(nsIPresContext& aPresContext,
NS_ADDREF(mSpaceManager);
}
return nsBlockFrame::Init(aPresContext, aContent, aParent, aContext);
return nsBlockFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow);
}
NS_IMETHODIMP
@ -592,9 +593,8 @@ nsAreaFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
if (nsnull == cf) {
return NS_ERROR_OUT_OF_MEMORY;
}
cf->Init(aPresContext, mContent, aParent, aStyleContext);
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
cf->SetFlags(mFlags);
cf->AppendToFlow(this);
aContinuingFrame = cf;
return NS_OK;
}

Просмотреть файл

@ -52,7 +52,8 @@ public:
NS_IMETHOD Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext);
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD DeleteFrame(nsIPresContext& aPresContext);

Просмотреть файл

@ -4503,7 +4503,7 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
NS_RELEASE(kidSC);
return NS_ERROR_OUT_OF_MEMORY;
}
mBullet->Init(aPresContext, mContent, this, kidSC);
mBullet->Init(aPresContext, mContent, this, kidSC, nsnull);
NS_RELEASE(kidSC);
// If the list bullet frame should be positioned inside then add
@ -4551,9 +4551,8 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
if (nsnull == cf) {
return NS_ERROR_OUT_OF_MEMORY;
}
cf->Init(aPresContext, mContent, aParent, aStyleContext);
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
cf->SetFlags(mFlags);
cf->AppendToFlow(this);
aContinuingFrame = cf;
return NS_OK;
}

Просмотреть файл

@ -4503,7 +4503,7 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
NS_RELEASE(kidSC);
return NS_ERROR_OUT_OF_MEMORY;
}
mBullet->Init(aPresContext, mContent, this, kidSC);
mBullet->Init(aPresContext, mContent, this, kidSC, nsnull);
NS_RELEASE(kidSC);
// If the list bullet frame should be positioned inside then add
@ -4551,9 +4551,8 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
if (nsnull == cf) {
return NS_ERROR_OUT_OF_MEMORY;
}
cf->Init(aPresContext, mContent, aParent, aStyleContext);
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
cf->SetFlags(mFlags);
cf->AppendToFlow(this);
aContinuingFrame = cf;
return NS_OK;
}

Просмотреть файл

@ -4503,7 +4503,7 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
NS_RELEASE(kidSC);
return NS_ERROR_OUT_OF_MEMORY;
}
mBullet->Init(aPresContext, mContent, this, kidSC);
mBullet->Init(aPresContext, mContent, this, kidSC, nsnull);
NS_RELEASE(kidSC);
// If the list bullet frame should be positioned inside then add
@ -4551,9 +4551,8 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
if (nsnull == cf) {
return NS_ERROR_OUT_OF_MEMORY;
}
cf->Init(aPresContext, mContent, aParent, aStyleContext);
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
cf->SetFlags(mFlags);
cf->AppendToFlow(this);
aContinuingFrame = cf;
return NS_OK;
}

Просмотреть файл

@ -221,7 +221,8 @@ NS_IMETHODIMP
nsFrame::Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext)
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
mContent = aContent;
NS_IF_ADDREF(mContent);

Просмотреть файл

@ -113,7 +113,8 @@ public:
NS_IMETHOD Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext);
nsIStyleContext* aContext,
nsIFrame* asPrevInFlow);
NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList);

Просмотреть файл

@ -325,7 +325,7 @@ nsHTMLFrameOuterFrame::Reflow(nsIPresContext& aPresContext,
firstChild = new nsHTMLFrameInnerFrame;
mFrames.SetFrames(firstChild);
// XXX temporary! use style system to get correct style!
firstChild->Init(aPresContext, mContent, this, mStyleContext);
firstChild->Init(aPresContext, mContent, this, mStyleContext, nsnull);
}
// nsContainerFrame::PaintBorder has some problems, kludge it here

Просмотреть файл

@ -941,7 +941,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
PR_FALSE, &kidSC);
if (nsHTMLAtoms::frameset == tag) {
result = NS_NewHTMLFramesetFrame(frame);
frame->Init(aPresContext, child, this, kidSC);
frame->Init(aPresContext, child, this, kidSC, nsnull);
childTypes[mChildCount] = FRAMESET;
nsHTMLFramesetFrame* childFrame = (nsHTMLFramesetFrame*)frame;
@ -951,7 +951,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
childBorderColors[mChildCount].Set(childFrame->GetBorderColor());
} else { // frame
result = NS_NewHTMLFrameOuterFrame(frame);
frame->Init(aPresContext, child, this, kidSC);
frame->Init(aPresContext, child, this, kidSC, nsnull);
childTypes[mChildCount] = FRAME;
//
@ -988,7 +988,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
mStyleContext,
PR_FALSE,
&pseudoStyleContext);
blankFrame->Init(aPresContext, mContent, this, pseudoStyleContext);
blankFrame->Init(aPresContext, mContent, this, pseudoStyleContext, nsnull);
NS_RELEASE(pseudoStyleContext);
if (nsnull == lastChild) {
@ -1028,7 +1028,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::horizontalFramesetBorderPseudo,
mStyleContext, PR_FALSE,
&pseudoStyleContext);
borderFrame->Init(aPresContext, mContent, this, pseudoStyleContext);
borderFrame->Init(aPresContext, mContent, this, pseudoStyleContext, nsnull);
NS_RELEASE(pseudoStyleContext);
mChildCount++;
@ -1056,7 +1056,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
mStyleContext,
PR_FALSE,
&pseudoStyleContext);
borderFrame->Init(aPresContext, mContent, this, pseudoStyleContext);
borderFrame->Init(aPresContext, mContent, this, pseudoStyleContext, nsnull);
NS_RELEASE(pseudoStyleContext);
mChildCount++;

Просмотреть файл

@ -98,7 +98,7 @@ nsHTMLContainerFrame::CreatePlaceholderFrame(nsIPresContext& aPresContext,
kidSC, PR_FALSE,
&placeholderPseudoStyle);
NS_RELEASE(kidSC);
placeholder->Init(aPresContext, content, this, placeholderPseudoStyle);
placeholder->Init(aPresContext, content, this, placeholderPseudoStyle, nsnull);
NS_RELEASE(placeholderPseudoStyle);
NS_IF_RELEASE(content);

Просмотреть файл

@ -163,18 +163,25 @@ public:
* Called to initialize the frame. This is called immediately after creating
* the frame.
*
* If you want a view associated with your frame you should create the view
* If the frame is a continuing frame, then aPrevInFlow indicates the previous
* frame (the frame that was split). You should connect the continuing frame to
* its prev-in-flow, e.g. by using the AppendToFlow() function
*
* If you want a view associated with your frame, you should create the view
* now.
*
* @param aContent the content object associated with the frame
* @param aGeometricParent the geometric parent frame
* @param aContentParent the content parent frame
* @param aContext the style context associated with the frame
* @param aPrevInFlow the prev-in-flow frame
* @see #AppendToFlow()
*/
NS_IMETHOD Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext) = 0;
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow) = 0;
/**
* Called to set the initial list of frames. This happens after the frame

Просмотреть файл

@ -336,9 +336,10 @@ NS_IMETHODIMP
nsImageFrame::Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext)
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult rv = nsLeafFrame::Init(aPresContext, aContent, aParent, aContext);
nsresult rv = nsLeafFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow);
// Set the image loader's source URL and base URL
nsAutoString src;

Просмотреть файл

@ -413,7 +413,7 @@ nsInlineFrame::CreateAnonymousBlock(nsIPresContext& aPresContext,
mStyleContext,
PR_FALSE,
getter_AddRefs(newSC));
rv = bf->Init(aPresContext, mContent, this, newSC);
rv = bf->Init(aPresContext, mContent, this, newSC, nsnull);
if (NS_FAILED(rv)) {
bf->DeleteFrame(aPresContext);
delete bf;
@ -1773,8 +1773,7 @@ nsInlineFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
if (nsnull == cf) {
return NS_ERROR_OUT_OF_MEMORY;
}
cf->Init(aPresContext, mContent, aParent, aStyleContext);
cf->AppendToFlow(this);
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
aContinuingFrame = cf;
return NS_OK;
}

Просмотреть файл

@ -148,8 +148,7 @@ nsPageFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
if (nsnull == cf) {
return NS_ERROR_OUT_OF_MEMORY;
}
cf->Init(aPresContext, mContent, aParent, aStyleContext);
cf->AppendToFlow(this);
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
aContinuingFrame = cf;
return NS_OK;
}

Просмотреть файл

@ -21,6 +21,35 @@
#include "nsIStyleContext.h"
#include "nsISizeOfHandler.h"
NS_IMETHODIMP
nsSplittableFrame::Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult rv;
rv = nsFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow);
if (aPrevInFlow) {
// Hook the frame into the flow
AppendToFlow(aPrevInFlow);
// Make sure the general flags bits are the same
nsFrameState state;
aPrevInFlow->GetFrameState(&state);
if (state & NS_FRAME_SYNC_FRAME_AND_VIEW) {
mState |= NS_FRAME_SYNC_FRAME_AND_VIEW;
}
if (state & NS_FRAME_REPLACED_ELEMENT) {
mState |= NS_FRAME_REPLACED_ELEMENT;
}
}
return rv;
}
NS_IMETHODIMP
nsSplittableFrame::IsSplittable(nsSplittableType& aIsSplittable) const
{

Просмотреть файл

@ -24,6 +24,12 @@
class nsSplittableFrame : public nsFrame
{
public:
NS_IMETHOD Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
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;

Просмотреть файл

@ -503,9 +503,7 @@ TextFrame::CreateContinuingFrame(nsIPresContext& aCX,
if (nsnull == cf) {
return NS_ERROR_OUT_OF_MEMORY;
}
cf->Init(aCX, mContent, aParent, aStyleContext);
cf->AppendToFlow(this);
cf->mState |= NS_FRAME_REPLACED_ELEMENT;/* XXX kipp: hack for inline reflow */
cf->Init(aCX, mContent, aParent, aStyleContext, this);
aContinuingFrame = cf;
return NS_OK;
}

Просмотреть файл

@ -77,7 +77,8 @@ NS_IMETHODIMP
nsAreaFrame::Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext)
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
// Create a space manager if requested
if (0 == (mFlags & NS_AREA_NO_SPACE_MGR)) {
@ -85,7 +86,7 @@ nsAreaFrame::Init(nsIPresContext& aPresContext,
NS_ADDREF(mSpaceManager);
}
return nsBlockFrame::Init(aPresContext, aContent, aParent, aContext);
return nsBlockFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow);
}
NS_IMETHODIMP
@ -592,9 +593,8 @@ nsAreaFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
if (nsnull == cf) {
return NS_ERROR_OUT_OF_MEMORY;
}
cf->Init(aPresContext, mContent, aParent, aStyleContext);
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
cf->SetFlags(mFlags);
cf->AppendToFlow(this);
aContinuingFrame = cf;
return NS_OK;
}

Просмотреть файл

@ -52,7 +52,8 @@ public:
NS_IMETHOD Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext);
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD DeleteFrame(nsIPresContext& aPresContext);

Просмотреть файл

@ -4503,7 +4503,7 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
NS_RELEASE(kidSC);
return NS_ERROR_OUT_OF_MEMORY;
}
mBullet->Init(aPresContext, mContent, this, kidSC);
mBullet->Init(aPresContext, mContent, this, kidSC, nsnull);
NS_RELEASE(kidSC);
// If the list bullet frame should be positioned inside then add
@ -4551,9 +4551,8 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
if (nsnull == cf) {
return NS_ERROR_OUT_OF_MEMORY;
}
cf->Init(aPresContext, mContent, aParent, aStyleContext);
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
cf->SetFlags(mFlags);
cf->AppendToFlow(this);
aContinuingFrame = cf;
return NS_OK;
}

Просмотреть файл

@ -4503,7 +4503,7 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
NS_RELEASE(kidSC);
return NS_ERROR_OUT_OF_MEMORY;
}
mBullet->Init(aPresContext, mContent, this, kidSC);
mBullet->Init(aPresContext, mContent, this, kidSC, nsnull);
NS_RELEASE(kidSC);
// If the list bullet frame should be positioned inside then add
@ -4551,9 +4551,8 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
if (nsnull == cf) {
return NS_ERROR_OUT_OF_MEMORY;
}
cf->Init(aPresContext, mContent, aParent, aStyleContext);
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
cf->SetFlags(mFlags);
cf->AppendToFlow(this);
aContinuingFrame = cf;
return NS_OK;
}

Просмотреть файл

@ -4503,7 +4503,7 @@ nsBlockFrame::SetInitialChildList(nsIPresContext& aPresContext,
NS_RELEASE(kidSC);
return NS_ERROR_OUT_OF_MEMORY;
}
mBullet->Init(aPresContext, mContent, this, kidSC);
mBullet->Init(aPresContext, mContent, this, kidSC, nsnull);
NS_RELEASE(kidSC);
// If the list bullet frame should be positioned inside then add
@ -4551,9 +4551,8 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
if (nsnull == cf) {
return NS_ERROR_OUT_OF_MEMORY;
}
cf->Init(aPresContext, mContent, aParent, aStyleContext);
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
cf->SetFlags(mFlags);
cf->AppendToFlow(this);
aContinuingFrame = cf;
return NS_OK;
}

Просмотреть файл

@ -221,7 +221,8 @@ NS_IMETHODIMP
nsFrame::Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext)
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
mContent = aContent;
NS_IF_ADDREF(mContent);

Просмотреть файл

@ -113,7 +113,8 @@ public:
NS_IMETHOD Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext);
nsIStyleContext* aContext,
nsIFrame* asPrevInFlow);
NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList);

Просмотреть файл

@ -98,7 +98,7 @@ nsHTMLContainerFrame::CreatePlaceholderFrame(nsIPresContext& aPresContext,
kidSC, PR_FALSE,
&placeholderPseudoStyle);
NS_RELEASE(kidSC);
placeholder->Init(aPresContext, content, this, placeholderPseudoStyle);
placeholder->Init(aPresContext, content, this, placeholderPseudoStyle, nsnull);
NS_RELEASE(placeholderPseudoStyle);
NS_IF_RELEASE(content);

Просмотреть файл

@ -99,7 +99,8 @@ public:
NS_IMETHOD Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext);
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,

Просмотреть файл

@ -336,9 +336,10 @@ NS_IMETHODIMP
nsImageFrame::Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext)
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult rv = nsLeafFrame::Init(aPresContext, aContent, aParent, aContext);
nsresult rv = nsLeafFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow);
// Set the image loader's source URL and base URL
nsAutoString src;

Просмотреть файл

@ -413,7 +413,7 @@ nsInlineFrame::CreateAnonymousBlock(nsIPresContext& aPresContext,
mStyleContext,
PR_FALSE,
getter_AddRefs(newSC));
rv = bf->Init(aPresContext, mContent, this, newSC);
rv = bf->Init(aPresContext, mContent, this, newSC, nsnull);
if (NS_FAILED(rv)) {
bf->DeleteFrame(aPresContext);
delete bf;
@ -1773,8 +1773,7 @@ nsInlineFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
if (nsnull == cf) {
return NS_ERROR_OUT_OF_MEMORY;
}
cf->Init(aPresContext, mContent, aParent, aStyleContext);
cf->AppendToFlow(this);
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
aContinuingFrame = cf;
return NS_OK;
}

Просмотреть файл

@ -148,8 +148,7 @@ nsPageFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
if (nsnull == cf) {
return NS_ERROR_OUT_OF_MEMORY;
}
cf->Init(aPresContext, mContent, aParent, aStyleContext);
cf->AppendToFlow(this);
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
aContinuingFrame = cf;
return NS_OK;
}

Просмотреть файл

@ -48,10 +48,12 @@ NS_IMETHODIMP
nsScrollFrame::Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aStyleContext)
nsIStyleContext* aStyleContext,
nsIFrame* aPrevInFlow)
{
nsresult rv = nsHTMLContainerFrame::Init(aPresContext, aContent,
aParent, aStyleContext);
aParent, aStyleContext,
aPrevInFlow);
// Create the scrolling view
CreateScrollingView();

Просмотреть файл

@ -32,7 +32,8 @@ public:
NS_IMETHOD Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext);
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD SetInitialChildList(nsIPresContext& aPresContext,
nsIAtom* aListName,

Просмотреть файл

@ -21,6 +21,35 @@
#include "nsIStyleContext.h"
#include "nsISizeOfHandler.h"
NS_IMETHODIMP
nsSplittableFrame::Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult rv;
rv = nsFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow);
if (aPrevInFlow) {
// Hook the frame into the flow
AppendToFlow(aPrevInFlow);
// Make sure the general flags bits are the same
nsFrameState state;
aPrevInFlow->GetFrameState(&state);
if (state & NS_FRAME_SYNC_FRAME_AND_VIEW) {
mState |= NS_FRAME_SYNC_FRAME_AND_VIEW;
}
if (state & NS_FRAME_REPLACED_ELEMENT) {
mState |= NS_FRAME_REPLACED_ELEMENT;
}
}
return rv;
}
NS_IMETHODIMP
nsSplittableFrame::IsSplittable(nsSplittableType& aIsSplittable) const
{

Просмотреть файл

@ -24,6 +24,12 @@
class nsSplittableFrame : public nsFrame
{
public:
NS_IMETHOD Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
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;

Просмотреть файл

@ -503,9 +503,7 @@ TextFrame::CreateContinuingFrame(nsIPresContext& aCX,
if (nsnull == cf) {
return NS_ERROR_OUT_OF_MEMORY;
}
cf->Init(aCX, mContent, aParent, aStyleContext);
cf->AppendToFlow(this);
cf->mState |= NS_FRAME_REPLACED_ELEMENT;/* XXX kipp: hack for inline reflow */
cf->Init(aCX, mContent, aParent, aStyleContext, this);
aContinuingFrame = cf;
return NS_OK;
}

Просмотреть файл

@ -325,7 +325,7 @@ nsHTMLFrameOuterFrame::Reflow(nsIPresContext& aPresContext,
firstChild = new nsHTMLFrameInnerFrame;
mFrames.SetFrames(firstChild);
// XXX temporary! use style system to get correct style!
firstChild->Init(aPresContext, mContent, this, mStyleContext);
firstChild->Init(aPresContext, mContent, this, mStyleContext, nsnull);
}
// nsContainerFrame::PaintBorder has some problems, kludge it here

Просмотреть файл

@ -941,7 +941,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
PR_FALSE, &kidSC);
if (nsHTMLAtoms::frameset == tag) {
result = NS_NewHTMLFramesetFrame(frame);
frame->Init(aPresContext, child, this, kidSC);
frame->Init(aPresContext, child, this, kidSC, nsnull);
childTypes[mChildCount] = FRAMESET;
nsHTMLFramesetFrame* childFrame = (nsHTMLFramesetFrame*)frame;
@ -951,7 +951,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
childBorderColors[mChildCount].Set(childFrame->GetBorderColor());
} else { // frame
result = NS_NewHTMLFrameOuterFrame(frame);
frame->Init(aPresContext, child, this, kidSC);
frame->Init(aPresContext, child, this, kidSC, nsnull);
childTypes[mChildCount] = FRAME;
//
@ -988,7 +988,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
mStyleContext,
PR_FALSE,
&pseudoStyleContext);
blankFrame->Init(aPresContext, mContent, this, pseudoStyleContext);
blankFrame->Init(aPresContext, mContent, this, pseudoStyleContext, nsnull);
NS_RELEASE(pseudoStyleContext);
if (nsnull == lastChild) {
@ -1028,7 +1028,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::horizontalFramesetBorderPseudo,
mStyleContext, PR_FALSE,
&pseudoStyleContext);
borderFrame->Init(aPresContext, mContent, this, pseudoStyleContext);
borderFrame->Init(aPresContext, mContent, this, pseudoStyleContext, nsnull);
NS_RELEASE(pseudoStyleContext);
mChildCount++;
@ -1056,7 +1056,7 @@ nsHTMLFramesetFrame::Reflow(nsIPresContext& aPresContext,
mStyleContext,
PR_FALSE,
&pseudoStyleContext);
borderFrame->Init(aPresContext, mContent, this, pseudoStyleContext);
borderFrame->Init(aPresContext, mContent, this, pseudoStyleContext, nsnull);
NS_RELEASE(pseudoStyleContext);
mChildCount++;

Просмотреть файл

@ -132,7 +132,7 @@ nsFieldSetFrame::SetInitialChildList(nsIPresContext& aPresContext,
nsHTMLAtoms::fieldsetContentPseudo,
mStyleContext, PR_FALSE,
&styleContext);
mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext);
mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext, nsnull);
NS_RELEASE(styleContext);
nsIFrame* newChildList = aChildList;

Просмотреть файл

@ -209,10 +209,10 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext,
if (NS_SUCCEEDED(rv)) {
// Found the pseudo style for the text field
childFrame->Init(aPresContext, text, this, textFieldStyleContext);
childFrame->Init(aPresContext, text, this, textFieldStyleContext, nsnull);
} else {
// Can't find pseduo style so use the style set for the file updload element
childFrame->Init(aPresContext, mContent, this, mStyleContext);
childFrame->Init(aPresContext, mContent, this, mStyleContext, nsnull);
}
mTextFrame = (nsTextControlFrame*)childFrame;
mFrames.SetFrames(childFrame);
@ -236,10 +236,10 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsIPresContext& aPresContext,
getter_AddRefs(buttonStyleContext));
if (NS_SUCCEEDED(rv)) {
// Found pseduo style for the button
childFrame->Init(aPresContext, browse, this, buttonStyleContext);
childFrame->Init(aPresContext, browse, this, buttonStyleContext, nsnull);
} else {
// Can't find pseudo style for the button so use the style set for the file upload element
childFrame->Init(aPresContext, mContent, this, mStyleContext);
childFrame->Init(aPresContext, mContent, this, mStyleContext, nsnull);
}
mFrames.FirstChild()->SetNextSibling(childFrame);

Просмотреть файл

@ -549,7 +549,7 @@ nsHTMLButtonControlFrame::SetInitialChildList(nsIPresContext& aPresContext,
aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::buttonContentPseudo,
mStyleContext, PR_FALSE,
&styleContext);
mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext);
mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext, nsnull);
NS_RELEASE(styleContext);
// Set the parent for each of the child frames

Просмотреть файл

@ -362,7 +362,7 @@ nsLabelFrame::SetInitialChildList(nsIPresContext& aPresContext,
aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::labelContentPseudo,
mStyleContext, PR_FALSE,
&styleContext);
mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext);
mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext, nsnull);
NS_RELEASE(styleContext);
// Set the geometric and content parent for each of the child frames

Просмотреть файл

@ -99,7 +99,7 @@ nsLegendFrame::SetInitialChildList(nsIPresContext& aPresContext,
aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::legendContentPseudo,
mStyleContext, PR_FALSE,
&styleContext);
mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext);
mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext, nsnull);
NS_RELEASE(styleContext);
// Set the parent for each of the child frames

Просмотреть файл

@ -769,11 +769,13 @@ nsListControlFrame::DoRemoveFrame(nsBlockReflowState& aState,
//----------------------------------------------------------------------
NS_IMETHODIMP
nsListControlFrame::Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext)
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult result = nsScrollFrame::Init(aPresContext, aContent, aParent, aContext);
nsresult result = nsScrollFrame::Init(aPresContext, aContent, aParent, aContext,
aPrevInFlow);
/*if (NS_OK == result) {
nsIDOMNode* node;
if (mContent && (NS_OK == mContent->QueryInterface(kIDOMNodeIID, (void**) &node))) {

Просмотреть файл

@ -119,7 +119,8 @@ public:
NS_IMETHOD Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext);
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD Deselect();

Просмотреть файл

@ -367,7 +367,7 @@ nsCSSFrameConstructor::ConstructTableFrame(nsIPresContext* aPresContext,
// Init the table outer frame and see if we need to create a view, e.g.
// the frame is absolutely positioned
aNewFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext);
aNewFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, nsnull);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, aNewFrame,
aStyleContext, PR_FALSE);
nsCOMPtr<nsIStyleContext> parentStyleContext;
@ -389,7 +389,7 @@ nsCSSFrameConstructor::ConstructTableFrame(nsIPresContext* aPresContext,
aNewFrame->SetInitialChildList(*aPresContext, nsnull, innerFrame);
childList = innerFrame;
innerFrame->Init(*aPresContext, aContent, aNewFrame, aStyleContext);
innerFrame->Init(*aPresContext, aContent, aNewFrame, aStyleContext, nsnull);
nsIFrame* lastChildFrame = nsnull;
PRInt32 count;
@ -502,7 +502,8 @@ nsCSSFrameConstructor::ConstructAnonymousTableFrame (nsIPresContext* aPresConte
getter_AddRefs(outerStyleContext));
result = NS_NewTableOuterFrame(aOuterFrame);
if (NS_SUCCEEDED(result)) {
aOuterFrame->Init(*aPresContext, aContent, aParentFrame, outerStyleContext);
aOuterFrame->Init(*aPresContext, aContent, aParentFrame, outerStyleContext,
nsnull);
// create the inner table frames
nsCOMPtr<nsIStyleContext> innerStyleContext;
@ -512,7 +513,8 @@ nsCSSFrameConstructor::ConstructAnonymousTableFrame (nsIPresContext* aPresConte
getter_AddRefs(innerStyleContext));
result = aTableCreator.CreateTableFrame(aInnerFrame);
if (NS_SUCCEEDED(result)) {
aInnerFrame->Init(*aPresContext, aContent, aOuterFrame, innerStyleContext);
aInnerFrame->Init(*aPresContext, aContent, aOuterFrame, innerStyleContext,
nsnull);
}
}
}
@ -541,20 +543,23 @@ nsCSSFrameConstructor::ConstructTableCaptionFrame(nsIPresContext* aPresContext,
if (NS_STYLE_DISPLAY_TABLE == parentDisplay->mDisplay) { // parent is an outer table
aParentFrame->FirstChild(nsnull, &innerFrame);
aNewCaptionFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext);
aNewCaptionFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext,
nsnull);
innerFrame->SetNextSibling(aNewCaptionFrame);
// the caller is responsible for calling SetInitialChildList on the outer, inner frames
aNewTopMostFrame = aNewCaptionFrame;
} else { // parent is not a table, need to create a new table
nsIFrame* outerFrame;
ConstructAnonymousTableFrame(aPresContext, aContent, aParentFrame, outerFrame, innerFrame, aFixedItems, aTableCreator);
ConstructAnonymousTableFrame(aPresContext, aContent, aParentFrame, outerFrame,
innerFrame, aFixedItems, aTableCreator);
nsCOMPtr<nsIStyleContext> outerStyleContext;
outerFrame->GetStyleContext(getter_AddRefs(outerStyleContext));
nsCOMPtr<nsIStyleContext> adjStyleContext;
aPresContext->ResolveStyleContextFor(aContent, outerStyleContext,
PR_FALSE,
getter_AddRefs(adjStyleContext));
aNewCaptionFrame->Init(*aPresContext, aContent, outerFrame, adjStyleContext);
aNewCaptionFrame->Init(*aPresContext, aContent, outerFrame, adjStyleContext,
nsnull);
innerFrame->SetNextSibling(aNewCaptionFrame);
outerFrame->SetInitialChildList(*aPresContext, nsnull, innerFrame);
innerFrame->SetInitialChildList(*aPresContext, nsnull, nsnull);
@ -663,7 +668,8 @@ nsCSSFrameConstructor::ConstructTableGroupFrameOnly(nsIPresContext* aPresContex
// Create a scroll frame and initialize it
rv = NS_NewScrollFrame(aNewTopMostFrame);
if (NS_SUCCEEDED(rv)) {
aNewTopMostFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext);
aNewTopMostFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext,
nsnull);
// The scroll frame gets the original style context, the scrolled frame gets
// a pseudo element style context that inherits the background properties
@ -679,7 +685,8 @@ nsCSSFrameConstructor::ConstructTableGroupFrameOnly(nsIPresContext* aPresContex
if (NS_SUCCEEDED(rv)) {
// Initialize the frame and force it to have a view
aNewGroupFrame->Init(*aPresContext, aContent, aNewTopMostFrame, scrolledPseudoStyle);
aNewGroupFrame->Init(*aPresContext, aContent, aNewTopMostFrame, scrolledPseudoStyle,
nsnull);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, aNewGroupFrame,
scrolledPseudoStyle, PR_TRUE);
aNewTopMostFrame->SetInitialChildList(*aPresContext, nsnull, aNewGroupFrame);
@ -689,7 +696,8 @@ nsCSSFrameConstructor::ConstructTableGroupFrameOnly(nsIPresContext* aPresContex
rv = (aIsRowGroup) ? aTableCreator.CreateTableRowGroupFrame(aNewTopMostFrame)
: aTableCreator.CreateTableColGroupFrame(aNewTopMostFrame);
if (NS_SUCCEEDED(rv)) {
aNewTopMostFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext);
aNewTopMostFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext,
nsnull);
aNewGroupFrame = aNewTopMostFrame;
}
}
@ -769,7 +777,8 @@ nsCSSFrameConstructor::ConstructTableRowFrame(nsIPresContext* aPresContext,
rv = ConstructTableRowFrameOnly(aPresContext, aContent, groupFrame, styleContext,
aAbsoluteItems, contentDisplayIsRow, aNewRowFrame, aFixedItems, aTableCreator);
if (NS_SUCCEEDED(rv)) {
aNewRowFrame->Init(*aPresContext, aContent, groupFrame, styleContext);
aNewRowFrame->Init(*aPresContext, aContent, groupFrame, styleContext,
nsnull);
if (aToDo) {
aToDo->Push(groupFrame);
aToDo->Push(aNewRowFrame);
@ -799,7 +808,8 @@ nsCSSFrameConstructor::ConstructTableRowFrameOnly(nsIPresContext* aPresContext,
{
nsresult rv = aTableCreator.CreateTableRowFrame(aNewRowFrame);
if (NS_SUCCEEDED(rv)) {
aNewRowFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext);
aNewRowFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext,
nsnull);
if (aProcessChildren) {
nsFrameItems childItems;
rv = TableProcessChildren(aPresContext, aContent, aNewRowFrame, aAbsoluteItems,
@ -829,7 +839,8 @@ nsCSSFrameConstructor::ConstructTableColFrame(nsIPresContext* aPresContext,
const nsStyleDisplay* parentDisplay = GetDisplay(aParentFrame);
if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == parentDisplay->mDisplay) {
rv = aTableCreator.CreateTableColFrame(aNewColFrame);
aNewColFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext);
aNewColFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext,
nsnull);
aNewTopMostFrame = aNewColFrame;
} else { // construct anonymous col group frame
nsIFrame* groupFrame;
@ -844,7 +855,7 @@ nsCSSFrameConstructor::ConstructTableColFrame(nsIPresContext* aPresContext,
PR_FALSE,
getter_AddRefs(styleContext));
rv = aTableCreator.CreateTableColFrame(aNewColFrame);
aNewColFrame->Init(*aPresContext, aContent, groupFrame, styleContext);
aNewColFrame->Init(*aPresContext, aContent, groupFrame, styleContext, nsnull);
if (NS_SUCCEEDED(rv)) {
groupFrame->SetInitialChildList(*aPresContext, nsnull, aNewColFrame);
}
@ -947,7 +958,7 @@ nsCSSFrameConstructor::ConstructTableCellFrameOnly(nsIPresContext* aPresContext
rv = aTableCreator.CreateTableCellFrame(aNewFrame);
if (NS_SUCCEEDED(rv)) {
// Initialize the table cell frame
aNewFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext);
aNewFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, nsnull);
// Create an area frame that will format the cell's content
nsIFrame* cellBodyFrame;
@ -964,7 +975,7 @@ nsCSSFrameConstructor::ConstructTableCellFrameOnly(nsIPresContext* aPresContext
aPresContext->ResolvePseudoStyleContextFor(aContent, nsHTMLAtoms::cellContentPseudo,
aStyleContext, PR_FALSE,
getter_AddRefs(bodyPseudoStyle));
cellBodyFrame->Init(*aPresContext, aContent, aNewFrame, bodyPseudoStyle);
cellBodyFrame->Init(*aPresContext, aContent, aNewFrame, bodyPseudoStyle, nsnull);
nsFrameItems childItems;
if (aWrapContent) {
@ -1233,7 +1244,7 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresContext* aPresContext,
nsIFrame* areaFrame;
NS_NewAreaFrame(areaFrame, 0);
areaFrame->Init(*aPresContext, aDocElement, aParentFrame, styleContext);
areaFrame->Init(*aPresContext, aDocElement, aParentFrame, styleContext, nsnull);
// The area frame is the "initial containing block"
mInitialContainingBlock = areaFrame;
@ -1265,7 +1276,8 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresContext* aPresContext,
if (IsScrollable(aPresContext, display)) {
NS_NewScrollFrame(scrollFrame);
scrollFrame->Init(*aPresContext, aDocElement, aParentFrame, styleContext);
scrollFrame->Init(*aPresContext, aDocElement, aParentFrame, styleContext,
nsnull);
// The scrolled frame gets a pseudo element style context
nsCOMPtr<nsIStyleContext> scrolledPseudoStyle;
@ -1285,7 +1297,7 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsIPresContext* aPresContext,
// flag that says that this is the body...
NS_NewAreaFrame(areaFrame, NS_BLOCK_DOCUMENT_ROOT|NS_BLOCK_MARGIN_ROOT);
areaFrame->Init(*aPresContext, aDocElement, scrollFrame ? scrollFrame :
aParentFrame, styleContext);
aParentFrame, styleContext, nsnull);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, areaFrame,
styleContext, PR_FALSE);
@ -1343,7 +1355,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext,
getter_AddRefs(viewportPseudoStyle));
// Initialize the viewport frame. It has a NULL content object
viewportFrame->Init(*aPresContext, nsnull, nsnull, viewportPseudoStyle);
viewportFrame->Init(*aPresContext, nsnull, nsnull, viewportPseudoStyle, nsnull);
// Bind the viewport frame to the root view
nsCOMPtr<nsIPresShell> presShell;
@ -1384,7 +1396,8 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext,
if (isScrollable) {
NS_NewScrollFrame(scrollFrame);
// XXX should probably be a scrolled content pseudo style context
scrollFrame->Init(*aPresContext, nsnull, viewportFrame, viewportPseudoStyle);
scrollFrame->Init(*aPresContext, nsnull, viewportFrame, viewportPseudoStyle,
nsnull);
// Inform the view manager about the root scrollable view
nsIView* scrollFrameView;
@ -1405,7 +1418,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext,
NS_NewSimplePageSequenceFrame(pageSequenceFrame);
// XXX should probably be a page sequence pseudo style context
pageSequenceFrame->Init(*aPresContext, nsnull, isScrollable ? scrollFrame :
viewportFrame, viewportPseudoStyle);
viewportFrame, viewportPseudoStyle, nsnull);
if (isScrollable) {
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, pageSequenceFrame,
viewportPseudoStyle, PR_TRUE);
@ -1428,7 +1441,8 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext,
viewportPseudoStyle, PR_FALSE,
getter_AddRefs(pagePseudoStyle));
pageFrame->Init(*aPresContext, nsnull, pageSequenceFrame, pagePseudoStyle);
pageFrame->Init(*aPresContext, nsnull, pageSequenceFrame, pagePseudoStyle,
nsnull);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, pageFrame,
pagePseudoStyle, PR_TRUE);
@ -1461,7 +1475,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext,
// XXX this should be a root pseudo style context
rootFrame->Init(*aPresContext, nsnull, isScrollable ? scrollFrame :
viewportFrame, viewportPseudoStyle);
viewportFrame, viewportPseudoStyle, nsnull);
if (isScrollable) {
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, rootFrame,
viewportPseudoStyle, PR_TRUE);
@ -1504,7 +1518,7 @@ nsCSSFrameConstructor::CreatePlaceholderFrameFor(nsIPresContext* aPresContext,
PR_FALSE,
getter_AddRefs(placeholderPseudoStyle));
placeholderFrame->Init(*aPresContext, aContent, aParentFrame,
placeholderPseudoStyle);
placeholderPseudoStyle, nsnull);
// Add mapping from absolutely positioned frame to its placeholder frame
nsCOMPtr<nsIPresShell> presShell;
@ -1701,7 +1715,7 @@ nsCSSFrameConstructor::ConstructFrameByTag(nsIPresContext* aPresContext,
rv = NS_NewObjectFrame(newFrame);
nsIFrame *blockFrame;
NS_NewBlockFrame(blockFrame, 0);
blockFrame->Init(*aPresContext, aContent, newFrame, aStyleContext);
blockFrame->Init(*aPresContext, aContent, newFrame, aStyleContext, nsnull);
newFrame = blockFrame;
processChildren = PR_TRUE;
}
@ -1752,7 +1766,8 @@ nsCSSFrameConstructor::ConstructFrameByTag(nsIPresContext* aPresContext,
}
}
newFrame->Init(*aPresContext, aContent, geometricParent, aStyleContext);
newFrame->Init(*aPresContext, aContent, geometricParent, aStyleContext,
nsnull);
// See if we need to create a view, e.g. the frame is absolutely positioned
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
@ -1993,7 +2008,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresContext* aPresContext,
if (NS_SUCCEEDED(rv) && newFrame != nsnull) {
nsIFrame* geometricParent = isAbsolutelyPositioned ? aAbsoluteItems.containingBlock :
aParentFrame;
newFrame->Init(*aPresContext, aContent, geometricParent, aStyleContext);
newFrame->Init(*aPresContext, aContent, geometricParent, aStyleContext, nsnull);
// See if we need to create a view, e.g. the frame is absolutely positioned
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
@ -2056,7 +2071,8 @@ nsCSSFrameConstructor::InitializeScrollFrame(nsIFrame* scrollFrame,
} else if (aIsFixedPositioned) {
geometricParent = aFixedItems.containingBlock;
}
scrollFrame->Init(*aPresContext, aContent, geometricParent, aStyleContext);
scrollFrame->Init(*aPresContext, aContent, geometricParent, aStyleContext,
nsnull);
// The scroll frame gets the original style context, and the scrolled
// frame gets a SCROLLED-CONTENT pseudo element style context that
@ -2071,7 +2087,8 @@ nsCSSFrameConstructor::InitializeScrollFrame(nsIFrame* scrollFrame,
NS_NewAreaFrame(scrolledFrame, NS_BLOCK_SHRINK_WRAP);
// Initialize the frame and force it to have a view
scrolledFrame->Init(*aPresContext, aContent, scrollFrame, scrolledPseudoStyle);
scrolledFrame->Init(*aPresContext, aContent, scrollFrame, scrolledPseudoStyle,
nsnull);
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, scrolledFrame,
scrolledPseudoStyle, PR_TRUE);
@ -2223,7 +2240,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresContext* aPresCo
NS_NewAreaFrame(newFrame, 0);
newFrame->Init(*aPresContext, aContent, isAbsolutelyPositioned ?
aAbsoluteItems.containingBlock : aFixedItems.containingBlock,
aStyleContext);
aStyleContext, nsnull);
// Create a view
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
@ -2254,7 +2271,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresContext* aPresCo
NS_NewAreaFrame(newFrame, NS_BLOCK_SHRINK_WRAP);
// Initialize the frame
newFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext);
newFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, nsnull);
// See if we need to create a view
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
@ -2274,7 +2291,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresContext* aPresCo
// Create an area frame. No space manager, though
NS_NewAreaFrame(newFrame, NS_AREA_NO_SPACE_MGR);
newFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext);
newFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, nsnull);
// Create a view
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
@ -2398,7 +2415,7 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresContext* aPresCo
// If we succeeded in creating a frame then initialize the frame and
// process children if requested
if (NS_SUCCEEDED(rv) && (nsnull != newFrame)) {
newFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext);
newFrame->Init(*aPresContext, aContent, aParentFrame, aStyleContext, nsnull);
// See if we need to create a view, e.g. the frame is absolutely positioned
nsHTMLContainerFrame::CreateViewForFrame(*aPresContext, newFrame,
@ -3443,8 +3460,9 @@ nsCSSFrameConstructor::ConstructAlternateImageFrame(nsIPresContext* aPresContext
getter_AddRefs(textStyleContext));
// Initialize the frames
inlineFrame->Init(*aPresContext, aContent, aParentFrame, textStyleContext);
textFrame->Init(*aPresContext, altTextContent, inlineFrame, textStyleContext);
inlineFrame->Init(*aPresContext, aContent, aParentFrame, textStyleContext, nsnull);
textFrame->Init(*aPresContext, altTextContent, inlineFrame,
textStyleContext, nsnull);
inlineFrame->SetInitialChildList(*aPresContext, nsnull, textFrame);
// Return the inline frame

Просмотреть файл

@ -596,8 +596,7 @@ nsTableCellFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
if (nsnull == cf) {
return NS_ERROR_OUT_OF_MEMORY;
}
cf->Init(aPresContext, mContent, aParent, aStyleContext);
cf->AppendToFlow(this);
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
PRInt32 baseColIndex;
GetColIndex(baseColIndex);
cf->InitCellFrame(baseColIndex);

Просмотреть файл

@ -92,7 +92,7 @@ nsTableColGroupFrame::InitNewFrames(nsIPresContext& aPresContext, nsIFrame* aChi
aPresContext.ResolveStyleContextFor(col, mStyleContext,
PR_TRUE,
getter_AddRefs(colStyleContext));
colFrame->Init(aPresContext, col, this, colStyleContext);
colFrame->Init(aPresContext, col, this, colStyleContext, nsnull);
colFrame->SetInitialChildList(aPresContext, nsnull, nsnull);
// Set nsColFrame-specific information

Просмотреть файл

@ -305,7 +305,8 @@ NS_IMETHODIMP
nsTableFrame::Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext)
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
float p2t;
aPresContext.GetPixelsToTwips(&p2t);
@ -313,7 +314,8 @@ nsTableFrame::Init(nsIPresContext& aPresContext,
mDefaultCellSpacingY = NSIntPixelsToTwips(2, p2t);
mDefaultCellPadding = NSIntPixelsToTwips(1, p2t);
return nsHTMLContainerFrame::Init(aPresContext, aContent, aParent, aContext);
return nsHTMLContainerFrame::Init(aPresContext, aContent, aParent, aContext,
aPrevInFlow);
}
@ -768,7 +770,8 @@ void nsTableFrame::EnsureColumns(nsIPresContext& aPresContext)
// Create a col group frame
nsIFrame* newFrame;
NS_NewTableColGroupFrame(newFrame);
newFrame->Init(aPresContext, lastColGroupElement, this, colGroupStyleContext);
newFrame->Init(aPresContext, lastColGroupElement, this, colGroupStyleContext,
nsnull);
lastColGroupFrame = (nsTableColGroupFrame*)newFrame;
NS_RELEASE(colGroupStyleContext); // kidStyleContenxt: REFCNT--
@ -802,7 +805,7 @@ void nsTableFrame::EnsureColumns(nsIPresContext& aPresContext)
&colStyleContext); // colStyleContext: REFCNT++
NS_NewTableColFrame(colFrame);
colFrame->Init(aPresContext, lastColGroupElement, lastColGroupFrame,
colStyleContext);
colStyleContext, nsnull);
NS_RELEASE(colStyleContext);
colFrame->SetInitialChildList(aPresContext, nsnull, nsnull);
@ -4459,8 +4462,7 @@ nsTableFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
if (nsnull == cf) {
return NS_ERROR_OUT_OF_MEMORY;
}
cf->Init(aPresContext, mContent, aParent, aStyleContext);
cf->AppendToFlow(this);
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
@ -4492,7 +4494,7 @@ nsTableFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
nsIFrame* duplicateFrame;
NS_NewTableRowGroupFrame(duplicateFrame);
duplicateFrame->Init(aPresContext, content, cf, kidStyleContext);
duplicateFrame->Init(aPresContext, content, cf, kidStyleContext, nsnull);
NS_RELEASE(kidStyleContext); // kidStyleContenxt: REFCNT--
if (nsnull==lastSib)

Просмотреть файл

@ -84,7 +84,8 @@ public:
NS_IMETHOD Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext);
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow);
/** @see nsIFrame::DeleteFrame */

Просмотреть файл

@ -1094,8 +1094,7 @@ nsTableOuterFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
if (nsnull == cf) {
return NS_ERROR_OUT_OF_MEMORY;
}
cf->Init(aPresContext, mContent, aParent, aStyleContext);
cf->AppendToFlow(this);
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;

Просмотреть файл

@ -1440,8 +1440,7 @@ nsTableRowFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
if (nsnull == cf) {
return NS_ERROR_OUT_OF_MEMORY;
}
cf->Init(aPresContext, mContent, aParent, aStyleContext);
cf->AppendToFlow(this);
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
cf->SetRowIndex(GetRowIndex());
// Create a continuing frame for each table cell frame

Просмотреть файл

@ -1307,8 +1307,7 @@ nsTableRowGroupFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
if (nsnull == cf) {
return NS_ERROR_OUT_OF_MEMORY;
}
cf->Init(aPresContext, mContent, aParent, aStyleContext);
cf->AppendToFlow(this);
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;

Просмотреть файл

@ -596,8 +596,7 @@ nsTableCellFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
if (nsnull == cf) {
return NS_ERROR_OUT_OF_MEMORY;
}
cf->Init(aPresContext, mContent, aParent, aStyleContext);
cf->AppendToFlow(this);
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
PRInt32 baseColIndex;
GetColIndex(baseColIndex);
cf->InitCellFrame(baseColIndex);

Просмотреть файл

@ -92,7 +92,7 @@ nsTableColGroupFrame::InitNewFrames(nsIPresContext& aPresContext, nsIFrame* aChi
aPresContext.ResolveStyleContextFor(col, mStyleContext,
PR_TRUE,
getter_AddRefs(colStyleContext));
colFrame->Init(aPresContext, col, this, colStyleContext);
colFrame->Init(aPresContext, col, this, colStyleContext, nsnull);
colFrame->SetInitialChildList(aPresContext, nsnull, nsnull);
// Set nsColFrame-specific information

Просмотреть файл

@ -305,7 +305,8 @@ NS_IMETHODIMP
nsTableFrame::Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext)
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
float p2t;
aPresContext.GetPixelsToTwips(&p2t);
@ -313,7 +314,8 @@ nsTableFrame::Init(nsIPresContext& aPresContext,
mDefaultCellSpacingY = NSIntPixelsToTwips(2, p2t);
mDefaultCellPadding = NSIntPixelsToTwips(1, p2t);
return nsHTMLContainerFrame::Init(aPresContext, aContent, aParent, aContext);
return nsHTMLContainerFrame::Init(aPresContext, aContent, aParent, aContext,
aPrevInFlow);
}
@ -768,7 +770,8 @@ void nsTableFrame::EnsureColumns(nsIPresContext& aPresContext)
// Create a col group frame
nsIFrame* newFrame;
NS_NewTableColGroupFrame(newFrame);
newFrame->Init(aPresContext, lastColGroupElement, this, colGroupStyleContext);
newFrame->Init(aPresContext, lastColGroupElement, this, colGroupStyleContext,
nsnull);
lastColGroupFrame = (nsTableColGroupFrame*)newFrame;
NS_RELEASE(colGroupStyleContext); // kidStyleContenxt: REFCNT--
@ -802,7 +805,7 @@ void nsTableFrame::EnsureColumns(nsIPresContext& aPresContext)
&colStyleContext); // colStyleContext: REFCNT++
NS_NewTableColFrame(colFrame);
colFrame->Init(aPresContext, lastColGroupElement, lastColGroupFrame,
colStyleContext);
colStyleContext, nsnull);
NS_RELEASE(colStyleContext);
colFrame->SetInitialChildList(aPresContext, nsnull, nsnull);
@ -4459,8 +4462,7 @@ nsTableFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
if (nsnull == cf) {
return NS_ERROR_OUT_OF_MEMORY;
}
cf->Init(aPresContext, mContent, aParent, aStyleContext);
cf->AppendToFlow(this);
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
@ -4492,7 +4494,7 @@ nsTableFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
nsIFrame* duplicateFrame;
NS_NewTableRowGroupFrame(duplicateFrame);
duplicateFrame->Init(aPresContext, content, cf, kidStyleContext);
duplicateFrame->Init(aPresContext, content, cf, kidStyleContext, nsnull);
NS_RELEASE(kidStyleContext); // kidStyleContenxt: REFCNT--
if (nsnull==lastSib)

Просмотреть файл

@ -84,7 +84,8 @@ public:
NS_IMETHOD Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext);
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow);
/** @see nsIFrame::DeleteFrame */

Просмотреть файл

@ -1094,8 +1094,7 @@ nsTableOuterFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
if (nsnull == cf) {
return NS_ERROR_OUT_OF_MEMORY;
}
cf->Init(aPresContext, mContent, aParent, aStyleContext);
cf->AppendToFlow(this);
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;

Просмотреть файл

@ -1440,8 +1440,7 @@ nsTableRowFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
if (nsnull == cf) {
return NS_ERROR_OUT_OF_MEMORY;
}
cf->Init(aPresContext, mContent, aParent, aStyleContext);
cf->AppendToFlow(this);
cf->Init(aPresContext, mContent, aParent, aStyleContext, this);
cf->SetRowIndex(GetRowIndex());
// Create a continuing frame for each table cell frame

Просмотреть файл

@ -1307,8 +1307,7 @@ nsTableRowGroupFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
if (nsnull == cf) {
return NS_ERROR_OUT_OF_MEMORY;
}
cf->Init(aPresContext, mContent, aParent, aStyleContext);
cf->AppendToFlow(this);
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;

Просмотреть файл

@ -201,10 +201,12 @@ NS_IMETHODIMP
nsProgressMeterFrame::Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext)
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult rv = nsLeafFrame::Init(aPresContext, aContent, aParent, aContext);
nsresult rv = nsLeafFrame::Init(aPresContext, aContent, aParent, aContext,
aPrevInFlow);
// get the value
nsAutoString value;

Просмотреть файл

@ -59,7 +59,8 @@ public:
NS_IMETHOD Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext);
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow);
// nsIHTMLReflow overrides
NS_IMETHOD Reflow(nsIPresContext& aPresContext,

Просмотреть файл

@ -195,9 +195,11 @@ NS_IMETHODIMP
nsTitledButtonFrame::Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext)
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
nsresult rv = nsLeafFrame::Init(aPresContext, aContent, aParent, aContext);
nsresult rv = nsLeafFrame::Init(aPresContext, aContent, aParent, aContext,
aPrevInFlow);
mRenderer.UpdateButtonStyles(this,aPresContext);

Просмотреть файл

@ -47,7 +47,8 @@ public:
NS_IMETHOD Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext);
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD DeleteFrame(nsIPresContext& aPresContext);

Просмотреть файл

@ -93,7 +93,8 @@ NS_IMETHODIMP
nsTreeCellFrame::Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext)
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
// Determine if we're a column header or not.
@ -120,9 +121,8 @@ nsTreeCellFrame::Init(nsIPresContext& aPresContext,
}
}
nsresult rv = nsTableCellFrame::Init(aPresContext, aContent, aParent, aContext);
return rv;
return nsTableCellFrame::Init(aPresContext, aContent, aParent, aContext,
aPrevInFlow);
}
nsTableFrame* nsTreeCellFrame::GetTreeFrame()

Просмотреть файл

@ -36,7 +36,8 @@ public:
NS_IMETHOD Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext); // Overridden to set whether we're a column header
nsIStyleContext* aContext,
nsIFrame* aPrevInFlow); // Overridden to set whether we're a column header
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,