Bug 328926. Remove aPresContext parameter from nsIFrame::Destroy, nsIFrame::SetInitialChildList and nsIFrame::RemovedAsPrimaryFrame. patch by Marc Liddell, r+sr=roc
git-svn-id: svn://10.0.0.236/trunk@193976 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -412,8 +412,7 @@ static PRInt32 FFWC_slowSearchForText=0;
|
||||
#endif
|
||||
|
||||
static nsresult
|
||||
DeletingFrameSubtree(nsPresContext* aPresContext,
|
||||
nsFrameManager* aFrameManager,
|
||||
DeletingFrameSubtree(nsFrameManager* aFrameManager,
|
||||
nsIFrame* aFrame);
|
||||
|
||||
#ifdef MOZ_SVG
|
||||
@@ -679,8 +678,7 @@ MarkIBSpecialPrevSibling(nsPresContext* aPresContext,
|
||||
// added to the frame hierarchy.
|
||||
// XXXbz it would really help if we merged the two methods somehow... :(
|
||||
static void
|
||||
DoCleanupFrameReferences(nsPresContext* aPresContext,
|
||||
nsFrameManager* aFrameManager,
|
||||
DoCleanupFrameReferences(nsFrameManager* aFrameManager,
|
||||
nsIFrame* aFrameIn)
|
||||
{
|
||||
nsIContent* content = aFrameIn->GetContent();
|
||||
@@ -700,7 +698,7 @@ DoCleanupFrameReferences(nsPresContext* aPresContext,
|
||||
|
||||
// Remove the mapping from the content object to its frame
|
||||
aFrameManager->SetPrimaryFrameFor(content, nsnull);
|
||||
aFrameIn->RemovedAsPrimaryFrame(aPresContext);
|
||||
aFrameIn->RemovedAsPrimaryFrame();
|
||||
aFrameManager->ClearAllUndisplayedContentIn(content);
|
||||
|
||||
// Recursively walk the child frames.
|
||||
@@ -709,7 +707,7 @@ DoCleanupFrameReferences(nsPresContext* aPresContext,
|
||||
do {
|
||||
nsIFrame* childFrame = aFrameIn->GetFirstChild(childListName);
|
||||
while (childFrame) {
|
||||
DoCleanupFrameReferences(aPresContext, aFrameManager, childFrame);
|
||||
DoCleanupFrameReferences(aFrameManager, childFrame);
|
||||
|
||||
// Get the next sibling child frame
|
||||
childFrame = childFrame->GetNextSibling();
|
||||
@@ -721,12 +719,11 @@ DoCleanupFrameReferences(nsPresContext* aPresContext,
|
||||
|
||||
// Helper function that walks a frame list and calls DoCleanupFrameReference()
|
||||
static void
|
||||
CleanupFrameReferences(nsPresContext* aPresContext,
|
||||
nsFrameManager* aFrameManager,
|
||||
CleanupFrameReferences(nsFrameManager* aFrameManager,
|
||||
nsIFrame* aFrameList)
|
||||
{
|
||||
while (aFrameList) {
|
||||
DoCleanupFrameReferences(aPresContext, aFrameManager, aFrameList);
|
||||
DoCleanupFrameReferences(aFrameManager, aFrameList);
|
||||
|
||||
// Get the sibling frame
|
||||
aFrameList = aFrameList->GetNextSibling();
|
||||
@@ -1428,9 +1425,8 @@ nsFrameConstructorState::AddChild(nsIFrame* aNewFrame,
|
||||
// hence already set as the primary frame. So we have to clean up here.
|
||||
// But it shouldn't have any out-of-flow kids.
|
||||
// XXXbz Maybe add a utility function to assert that?
|
||||
CleanupFrameReferences(mPresContext, mFrameManager,
|
||||
aNewFrame);
|
||||
aNewFrame->Destroy(mPresContext);
|
||||
CleanupFrameReferences(mFrameManager, aNewFrame);
|
||||
aNewFrame->Destroy();
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -1506,9 +1502,7 @@ nsFrameConstructorState::ProcessFrameInsertions(nsAbsoluteItems& aFrameItems,
|
||||
nsIFrame* firstChild = containingBlock->GetFirstChild(aChildListName);
|
||||
nsresult rv = NS_OK;
|
||||
if (!firstChild && (containingBlock->GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
|
||||
rv = containingBlock->SetInitialChildList(mPresContext,
|
||||
aChildListName,
|
||||
firstNewFrame);
|
||||
rv = containingBlock->SetInitialChildList(aChildListName, firstNewFrame);
|
||||
} else {
|
||||
// Note that whether the frame construction context is doing an append or
|
||||
// not is not helpful here, since it could be appending to some frame in
|
||||
@@ -2057,7 +2051,7 @@ nsCSSFrameConstructor::CreateAttributeContent(nsIContent* aParentContent,
|
||||
rv = textFrame->Init(content, aParentFrame, nsnull);
|
||||
if (NS_FAILED(rv)) {
|
||||
content->UnbindFromTree();
|
||||
textFrame->Destroy(mPresShell->GetPresContext());
|
||||
textFrame->Destroy();
|
||||
textFrame = nsnull;
|
||||
content = nsnull;
|
||||
}
|
||||
@@ -2085,7 +2079,6 @@ nsCSSFrameConstructor::CreateGeneratedFrameFor(nsIFrame* aParentFram
|
||||
nsStyleContentType type = data.mType;
|
||||
|
||||
nsCOMPtr<nsIContent> content;
|
||||
nsPresContext* presContext = mPresShell->GetPresContext();
|
||||
|
||||
if (eStyleContentType_Image == type) {
|
||||
if (!data.mContent.mImage) {
|
||||
@@ -2128,7 +2121,7 @@ nsCSSFrameConstructor::CreateGeneratedFrameFor(nsIFrame* aParentFram
|
||||
|
||||
rv = imageFrame->Init(content, aParentFrame, nsnull);
|
||||
if (NS_FAILED(rv)) {
|
||||
imageFrame->Destroy(presContext);
|
||||
imageFrame->Destroy();
|
||||
return rv == NS_ERROR_FRAME_REPLACED ? NS_OK : rv;
|
||||
}
|
||||
|
||||
@@ -2402,7 +2395,7 @@ nsCSSFrameConstructor::CreateGeneratedContentFrame(nsFrameConstructorState& aSta
|
||||
}
|
||||
|
||||
if (childFrames.childList) {
|
||||
containerFrame->SetInitialChildList(aState.mPresContext, nsnull, childFrames.childList);
|
||||
containerFrame->SetInitialChildList(nsnull, childFrames.childList);
|
||||
}
|
||||
*aResult = containerFrame;
|
||||
return PR_TRUE;
|
||||
@@ -2606,17 +2599,15 @@ GetCaptionAdjustedParent(nsIFrame* aParentFrame,
|
||||
}
|
||||
|
||||
static nsresult
|
||||
ProcessPseudoFrame(nsPresContext* aPresContext,
|
||||
nsPseudoFrameData& aPseudoData,
|
||||
ProcessPseudoFrame(nsPseudoFrameData& aPseudoData,
|
||||
nsIFrame*& aParent)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
if (!aPresContext) return rv;
|
||||
|
||||
aParent = aPseudoData.mFrame;
|
||||
nsFrameItems* items = &aPseudoData.mChildList;
|
||||
if (items && items->childList) {
|
||||
rv = aParent->SetInitialChildList(aPresContext, nsnull, items->childList);
|
||||
rv = aParent->SetInitialChildList(nsnull, items->childList);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
}
|
||||
aPseudoData.Reset();
|
||||
@@ -2624,47 +2615,43 @@ ProcessPseudoFrame(nsPresContext* aPresContext,
|
||||
}
|
||||
|
||||
static nsresult
|
||||
ProcessPseudoTableFrame(nsPresContext* aPresContext,
|
||||
nsPseudoFrames& aPseudoFrames,
|
||||
ProcessPseudoTableFrame(nsPseudoFrames& aPseudoFrames,
|
||||
nsIFrame*& aParent)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
if (!aPresContext) return rv;
|
||||
|
||||
// process the col group frame, if it exists
|
||||
if (aPseudoFrames.mColGroup.mFrame) {
|
||||
rv = ProcessPseudoFrame(aPresContext, aPseudoFrames.mColGroup, aParent);
|
||||
rv = ProcessPseudoFrame(aPseudoFrames.mColGroup, aParent);
|
||||
}
|
||||
|
||||
// process the inner table frame
|
||||
rv = ProcessPseudoFrame(aPresContext, aPseudoFrames.mTableInner, aParent);
|
||||
rv = ProcessPseudoFrame(aPseudoFrames.mTableInner, aParent);
|
||||
|
||||
// process the outer table frame
|
||||
aParent = aPseudoFrames.mTableOuter.mFrame;
|
||||
nsFrameItems* items = &aPseudoFrames.mTableOuter.mChildList;
|
||||
if (items && items->childList) {
|
||||
rv = aParent->SetInitialChildList(aPresContext, nsnull, items->childList);
|
||||
rv = aParent->SetInitialChildList(nsnull, items->childList);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
}
|
||||
nsFrameItems* captions = &aPseudoFrames.mTableOuter.mChildList2;
|
||||
if (captions && captions->childList) {
|
||||
rv = aParent->SetInitialChildList(aPresContext, nsLayoutAtoms::captionList, captions->childList);
|
||||
rv = aParent->SetInitialChildList(nsLayoutAtoms::captionList, captions->childList);
|
||||
}
|
||||
aPseudoFrames.mTableOuter.Reset();
|
||||
return rv;
|
||||
}
|
||||
|
||||
static nsresult
|
||||
ProcessPseudoCellFrame(nsPresContext* aPresContext,
|
||||
nsPseudoFrames& aPseudoFrames,
|
||||
ProcessPseudoCellFrame(nsPseudoFrames& aPseudoFrames,
|
||||
nsIFrame*& aParent)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
if (!aPresContext) return rv;
|
||||
|
||||
rv = ProcessPseudoFrame(aPresContext, aPseudoFrames.mCellInner, aParent);
|
||||
rv = ProcessPseudoFrame(aPseudoFrames.mCellInner, aParent);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = ProcessPseudoFrame(aPresContext, aPseudoFrames.mCellOuter, aParent);
|
||||
rv = ProcessPseudoFrame(aPseudoFrames.mCellOuter, aParent);
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -2687,37 +2674,34 @@ ProcessPseudoFrames(nsFrameConstructorState& aState,
|
||||
#endif
|
||||
|
||||
nsPseudoFrames& pseudoFrames = aState.mPseudoFrames;
|
||||
nsPresContext* presContext = aState.mPresContext;
|
||||
|
||||
if (nsLayoutAtoms::tableFrame == pseudoFrames.mLowestType) {
|
||||
if (pseudoFrames.mColGroup.mFrame) {
|
||||
rv = ProcessPseudoFrame(presContext, pseudoFrames.mColGroup,
|
||||
aHighestFrame);
|
||||
rv = ProcessPseudoFrame(pseudoFrames.mColGroup, aHighestFrame);
|
||||
if (nsLayoutAtoms::tableColGroupFrame == aHighestType) return rv;
|
||||
}
|
||||
rv = ProcessPseudoTableFrame(presContext, pseudoFrames, aHighestFrame);
|
||||
rv = ProcessPseudoTableFrame(pseudoFrames, aHighestFrame);
|
||||
if (nsLayoutAtoms::tableOuterFrame == aHighestType) return rv;
|
||||
|
||||
if (pseudoFrames.mCellOuter.mFrame) {
|
||||
rv = ProcessPseudoCellFrame(presContext, pseudoFrames, aHighestFrame);
|
||||
rv = ProcessPseudoCellFrame(pseudoFrames, aHighestFrame);
|
||||
if (IS_TABLE_CELL(aHighestType)) return rv;
|
||||
}
|
||||
if (pseudoFrames.mRow.mFrame) {
|
||||
rv = ProcessPseudoFrame(presContext, pseudoFrames.mRow, aHighestFrame);
|
||||
rv = ProcessPseudoFrame(pseudoFrames.mRow, aHighestFrame);
|
||||
if (nsLayoutAtoms::tableRowFrame == aHighestType) return rv;
|
||||
}
|
||||
if (pseudoFrames.mRowGroup.mFrame) {
|
||||
rv = ProcessPseudoFrame(presContext, pseudoFrames.mRowGroup, aHighestFrame);
|
||||
rv = ProcessPseudoFrame(pseudoFrames.mRowGroup, aHighestFrame);
|
||||
if (nsLayoutAtoms::tableRowGroupFrame == aHighestType) return rv;
|
||||
}
|
||||
}
|
||||
else if (nsLayoutAtoms::tableRowGroupFrame == pseudoFrames.mLowestType) {
|
||||
rv = ProcessPseudoFrame(presContext, pseudoFrames.mRowGroup, aHighestFrame);
|
||||
rv = ProcessPseudoFrame(pseudoFrames.mRowGroup, aHighestFrame);
|
||||
if (nsLayoutAtoms::tableRowGroupFrame == aHighestType) return rv;
|
||||
if (pseudoFrames.mColGroup.mFrame) {
|
||||
nsIFrame* colGroupHigh;
|
||||
rv = ProcessPseudoFrame(presContext, pseudoFrames.mColGroup,
|
||||
colGroupHigh);
|
||||
rv = ProcessPseudoFrame(pseudoFrames.mColGroup, colGroupHigh);
|
||||
if (aHighestFrame) {
|
||||
// table frames are special they can have two types of pseudo frames
|
||||
// that need to be processed in one pass, we suffer here from having
|
||||
@@ -2729,30 +2713,29 @@ ProcessPseudoFrames(nsFrameConstructorState& aState,
|
||||
if (nsLayoutAtoms::tableColGroupFrame == aHighestType) return rv;
|
||||
}
|
||||
if (pseudoFrames.mTableOuter.mFrame) {
|
||||
rv = ProcessPseudoTableFrame(presContext, pseudoFrames, aHighestFrame);
|
||||
rv = ProcessPseudoTableFrame(pseudoFrames, aHighestFrame);
|
||||
if (nsLayoutAtoms::tableOuterFrame == aHighestType) return rv;
|
||||
}
|
||||
if (pseudoFrames.mCellOuter.mFrame) {
|
||||
rv = ProcessPseudoCellFrame(presContext, pseudoFrames, aHighestFrame);
|
||||
rv = ProcessPseudoCellFrame(pseudoFrames, aHighestFrame);
|
||||
if (IS_TABLE_CELL(aHighestType)) return rv;
|
||||
}
|
||||
if (pseudoFrames.mRow.mFrame) {
|
||||
rv = ProcessPseudoFrame(presContext, pseudoFrames.mRow, aHighestFrame);
|
||||
rv = ProcessPseudoFrame(pseudoFrames.mRow, aHighestFrame);
|
||||
if (nsLayoutAtoms::tableRowFrame == aHighestType) return rv;
|
||||
}
|
||||
}
|
||||
else if (nsLayoutAtoms::tableRowFrame == pseudoFrames.mLowestType) {
|
||||
rv = ProcessPseudoFrame(presContext, pseudoFrames.mRow, aHighestFrame);
|
||||
rv = ProcessPseudoFrame(pseudoFrames.mRow, aHighestFrame);
|
||||
if (nsLayoutAtoms::tableRowFrame == aHighestType) return rv;
|
||||
|
||||
if (pseudoFrames.mRowGroup.mFrame) {
|
||||
rv = ProcessPseudoFrame(presContext, pseudoFrames.mRowGroup, aHighestFrame);
|
||||
rv = ProcessPseudoFrame(pseudoFrames.mRowGroup, aHighestFrame);
|
||||
if (nsLayoutAtoms::tableRowGroupFrame == aHighestType) return rv;
|
||||
}
|
||||
if (pseudoFrames.mColGroup.mFrame) {
|
||||
nsIFrame* colGroupHigh;
|
||||
rv = ProcessPseudoFrame(presContext, pseudoFrames.mColGroup,
|
||||
colGroupHigh);
|
||||
rv = ProcessPseudoFrame(pseudoFrames.mColGroup, colGroupHigh);
|
||||
if (aHighestFrame &&
|
||||
nsLayoutAtoms::tableRowGroupFrame == aHighestFrame->GetType() ) {
|
||||
// table frames are special they can have two types of pseudo frames
|
||||
@@ -2765,30 +2748,29 @@ ProcessPseudoFrames(nsFrameConstructorState& aState,
|
||||
if (nsLayoutAtoms::tableColGroupFrame == aHighestType) return rv;
|
||||
}
|
||||
if (pseudoFrames.mTableOuter.mFrame) {
|
||||
rv = ProcessPseudoTableFrame(presContext, pseudoFrames, aHighestFrame);
|
||||
rv = ProcessPseudoTableFrame(pseudoFrames, aHighestFrame);
|
||||
if (nsLayoutAtoms::tableOuterFrame == aHighestType) return rv;
|
||||
}
|
||||
if (pseudoFrames.mCellOuter.mFrame) {
|
||||
rv = ProcessPseudoCellFrame(presContext, pseudoFrames, aHighestFrame);
|
||||
rv = ProcessPseudoCellFrame(pseudoFrames, aHighestFrame);
|
||||
if (IS_TABLE_CELL(aHighestType)) return rv;
|
||||
}
|
||||
}
|
||||
else if (IS_TABLE_CELL(pseudoFrames.mLowestType)) {
|
||||
rv = ProcessPseudoCellFrame(presContext, pseudoFrames, aHighestFrame);
|
||||
rv = ProcessPseudoCellFrame(pseudoFrames, aHighestFrame);
|
||||
if (IS_TABLE_CELL(aHighestType)) return rv;
|
||||
|
||||
if (pseudoFrames.mRow.mFrame) {
|
||||
rv = ProcessPseudoFrame(presContext, pseudoFrames.mRow, aHighestFrame);
|
||||
rv = ProcessPseudoFrame(pseudoFrames.mRow, aHighestFrame);
|
||||
if (nsLayoutAtoms::tableRowFrame == aHighestType) return rv;
|
||||
}
|
||||
if (pseudoFrames.mRowGroup.mFrame) {
|
||||
rv = ProcessPseudoFrame(presContext, pseudoFrames.mRowGroup, aHighestFrame);
|
||||
rv = ProcessPseudoFrame(pseudoFrames.mRowGroup, aHighestFrame);
|
||||
if (nsLayoutAtoms::tableRowGroupFrame == aHighestType) return rv;
|
||||
}
|
||||
if (pseudoFrames.mColGroup.mFrame) {
|
||||
nsIFrame* colGroupHigh;
|
||||
rv = ProcessPseudoFrame(presContext, pseudoFrames.mColGroup,
|
||||
colGroupHigh);
|
||||
rv = ProcessPseudoFrame(pseudoFrames.mColGroup, colGroupHigh);
|
||||
if (aHighestFrame && nsLayoutAtoms::tableRowGroupFrame == aHighestFrame->GetType() ) {
|
||||
// table frames are special they can have two types of pseudo frames
|
||||
// that need to be processed in one pass, we suffer here from having
|
||||
@@ -2800,12 +2782,12 @@ ProcessPseudoFrames(nsFrameConstructorState& aState,
|
||||
if (nsLayoutAtoms::tableColGroupFrame == aHighestType) return rv;
|
||||
}
|
||||
if (pseudoFrames.mTableOuter.mFrame) {
|
||||
rv = ProcessPseudoTableFrame(presContext, pseudoFrames, aHighestFrame);
|
||||
rv = ProcessPseudoTableFrame(pseudoFrames, aHighestFrame);
|
||||
}
|
||||
}
|
||||
else if (pseudoFrames.mColGroup.mFrame) {
|
||||
// process the col group frame
|
||||
rv = ProcessPseudoFrame(presContext, pseudoFrames.mColGroup, aHighestFrame);
|
||||
rv = ProcessPseudoFrame(pseudoFrames.mColGroup, aHighestFrame);
|
||||
}
|
||||
|
||||
return rv;
|
||||
@@ -3662,8 +3644,7 @@ nsCSSFrameConstructor::ConstructTableFrame(nsFrameConstructorState& aState,
|
||||
|
||||
if (!aIsPseudo) {
|
||||
// Put the newly created frames into the right child list
|
||||
aNewOuterFrame->SetInitialChildList(aState.mPresContext, nsnull,
|
||||
aNewInnerFrame);
|
||||
aNewOuterFrame->SetInitialChildList(nsnull, aNewInnerFrame);
|
||||
rv = aState.AddChild(aNewOuterFrame, *frameItems, disp, aContent,
|
||||
outerStyleContext, parentFrame);
|
||||
if (NS_FAILED(rv)) {
|
||||
@@ -3682,13 +3663,11 @@ nsCSSFrameConstructor::ConstructTableFrame(nsFrameConstructorState& aState,
|
||||
PR_FALSE, childItems);
|
||||
|
||||
// Set the inner table frame's initial primary list
|
||||
aNewInnerFrame->SetInitialChildList(aState.mPresContext, nsnull,
|
||||
childItems.childList);
|
||||
aNewInnerFrame->SetInitialChildList(nsnull, childItems.childList);
|
||||
|
||||
// Set the outer table frame's primary and option lists
|
||||
if (captionFrame) {
|
||||
aNewOuterFrame->SetInitialChildList(aState.mPresContext,
|
||||
nsLayoutAtoms::captionList,
|
||||
aNewOuterFrame->SetInitialChildList(nsLayoutAtoms::captionList,
|
||||
captionFrame);
|
||||
}
|
||||
}
|
||||
@@ -3741,8 +3720,7 @@ nsCSSFrameConstructor::ConstructTableCaptionFrame(nsFrameConstructorState& aStat
|
||||
rv = ProcessChildren(aState, aContent, aNewFrame,
|
||||
PR_TRUE, childItems, PR_TRUE, nsnull);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
aNewFrame->SetInitialChildList(aState.mPresContext, nsnull,
|
||||
childItems.childList);
|
||||
aNewFrame->SetInitialChildList(nsnull, childItems.childList);
|
||||
if (aIsPseudoParent) {
|
||||
aState.mPseudoFrames.mTableOuter.mChildList2.AddChild(aNewFrame);
|
||||
}
|
||||
@@ -3812,8 +3790,7 @@ nsCSSFrameConstructor::ConstructTableRowGroupFrame(nsFrameConstructorState& aSta
|
||||
CreateAnonymousFrames(nsnull, aState, aContent, aNewFrame,
|
||||
PR_FALSE, childItems);
|
||||
|
||||
aNewFrame->SetInitialChildList(aState.mPresContext, nsnull,
|
||||
childItems.childList);
|
||||
aNewFrame->SetInitialChildList(nsnull, childItems.childList);
|
||||
if (aIsPseudoParent) {
|
||||
nsIFrame* child = (scrollFrame) ? scrollFrame : aNewFrame;
|
||||
aState.mPseudoFrames.mTableInner.mChildList.AddChild(child);
|
||||
@@ -3869,8 +3846,7 @@ nsCSSFrameConstructor::ConstructTableColGroupFrame(nsFrameConstructorState& aSta
|
||||
rv = TableProcessChildren(aState, aContent, aNewFrame, aTableCreator,
|
||||
childItems, captionFrame);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
aNewFrame->SetInitialChildList(aState.mPresContext, nsnull,
|
||||
childItems.childList);
|
||||
aNewFrame->SetInitialChildList(nsnull, childItems.childList);
|
||||
if (aIsPseudoParent) {
|
||||
aState.mPseudoFrames.mTableInner.mChildList.AddChild(aNewFrame);
|
||||
}
|
||||
@@ -3925,8 +3901,7 @@ nsCSSFrameConstructor::ConstructTableRowFrame(nsFrameConstructorState& aState,
|
||||
CreateAnonymousFrames(nsnull, aState, aContent, aNewFrame,
|
||||
PR_FALSE, childItems);
|
||||
|
||||
aNewFrame->SetInitialChildList(aState.mPresContext, nsnull,
|
||||
childItems.childList);
|
||||
aNewFrame->SetInitialChildList(nsnull, childItems.childList);
|
||||
if (aIsPseudoParent) {
|
||||
aState.mPseudoFrames.mRowGroup.mChildList.AddChild(aNewFrame);
|
||||
}
|
||||
@@ -4047,7 +4022,7 @@ nsCSSFrameConstructor::ConstructTableCellFrame(nsFrameConstructorState& aState,
|
||||
aNewCellInnerFrame = aTableCreator.CreateTableCellInnerFrame(innerPseudoStyle);
|
||||
|
||||
if (NS_UNLIKELY(!aNewCellInnerFrame)) {
|
||||
aNewCellOuterFrame->Destroy(aState.mPresContext);
|
||||
aNewCellOuterFrame->Destroy();
|
||||
aNewCellOuterFrame = nsnull;
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@@ -4073,18 +4048,15 @@ nsCSSFrameConstructor::ConstructTableCellFrame(nsFrameConstructorState& aState,
|
||||
if (NS_FAILED(rv)) {
|
||||
// Clean up
|
||||
// XXXbz kids of this stuff need to be cleaned up too!
|
||||
aNewCellInnerFrame->Destroy(aState.mPresContext);
|
||||
aNewCellInnerFrame->Destroy();
|
||||
aNewCellInnerFrame = nsnull;
|
||||
aNewCellOuterFrame->Destroy(aState.mPresContext);
|
||||
aNewCellOuterFrame->Destroy();
|
||||
aNewCellOuterFrame = nsnull;
|
||||
return rv;
|
||||
}
|
||||
|
||||
aNewCellInnerFrame->SetInitialChildList(aState.mPresContext, nsnull,
|
||||
childItems.childList);
|
||||
|
||||
aNewCellOuterFrame->SetInitialChildList(aState.mPresContext, nsnull,
|
||||
aNewCellInnerFrame);
|
||||
aNewCellInnerFrame->SetInitialChildList(nsnull, childItems.childList);
|
||||
aNewCellOuterFrame->SetInitialChildList(nsnull, aNewCellInnerFrame);
|
||||
if (aIsPseudoParent) {
|
||||
aState.mPseudoFrames.mRow.mChildList.AddChild(aNewCellOuterFrame);
|
||||
}
|
||||
@@ -4710,8 +4682,7 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsFrameConstructorState& aState,
|
||||
isBlockFrame);
|
||||
|
||||
// Set the initial child lists
|
||||
contentFrame->SetInitialChildList(aState.mPresContext, nsnull,
|
||||
childItems.childList);
|
||||
contentFrame->SetInitialChildList(nsnull, childItems.childList);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
@@ -4959,14 +4930,14 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIContent* aDocElement,
|
||||
nsIFrame *pageFrame, *pageContentFrame;
|
||||
ConstructPageFrame(mPresShell, presContext, rootFrame, nsnull,
|
||||
pageFrame, pageContentFrame);
|
||||
rootFrame->SetInitialChildList(presContext, nsnull, pageFrame);
|
||||
rootFrame->SetInitialChildList(nsnull, pageFrame);
|
||||
|
||||
// The eventual parent of the document element frame.
|
||||
// XXX should this be set for every new page (in ConstructPageFrame)?
|
||||
mDocElementContainingBlock = pageContentFrame;
|
||||
}
|
||||
|
||||
viewportFrame->SetInitialChildList(presContext, nsnull, newFrame);
|
||||
viewportFrame->SetInitialChildList(nsnull, newFrame);
|
||||
|
||||
*aNewFrame = viewportFrame;
|
||||
|
||||
@@ -5019,7 +4990,7 @@ nsCSSFrameConstructor::ConstructPageFrame(nsIPresShell* aPresShell,
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
mFixedContainingBlock = aPageContentFrame;
|
||||
|
||||
aPageFrame->SetInitialChildList(aPresContext, nsnull, aPageContentFrame);
|
||||
aPageFrame->SetInitialChildList(nsnull, aPageContentFrame);
|
||||
|
||||
// Fixed pos kids are taken care of directly in CreateContinuingFrame()
|
||||
|
||||
@@ -5133,7 +5104,7 @@ nsCSSFrameConstructor::ConstructButtonFrame(nsFrameConstructorState& aState,
|
||||
aState.GetGeometricParent(aStyleDisplay, aParentFrame),
|
||||
nsnull, buttonFrame);
|
||||
if (NS_FAILED(rv)) {
|
||||
buttonFrame->Destroy(aState.mPresContext);
|
||||
buttonFrame->Destroy();
|
||||
return rv;
|
||||
}
|
||||
// See if we need to create a view, e.g. the frame is absolutely positioned
|
||||
@@ -5150,21 +5121,21 @@ nsCSSFrameConstructor::ConstructButtonFrame(nsFrameConstructorState& aState,
|
||||
NS_BLOCK_SPACE_MGR | NS_BLOCK_SHRINK_WRAP);
|
||||
|
||||
if (NS_UNLIKELY(!areaFrame)) {
|
||||
buttonFrame->Destroy(aState.mPresContext);
|
||||
buttonFrame->Destroy();
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
rv = InitAndRestoreFrame(aState, aContent, buttonFrame, nsnull, areaFrame);
|
||||
if (NS_FAILED(rv)) {
|
||||
areaFrame->Destroy(aState.mPresContext);
|
||||
buttonFrame->Destroy(aState.mPresContext);
|
||||
areaFrame->Destroy();
|
||||
buttonFrame->Destroy();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = aState.AddChild(buttonFrame, aFrameItems, aStyleDisplay, aContent,
|
||||
aStyleContext, aParentFrame);
|
||||
if (NS_FAILED(rv)) {
|
||||
areaFrame->Destroy(aState.mPresContext);
|
||||
buttonFrame->Destroy(aState.mPresContext);
|
||||
areaFrame->Destroy();
|
||||
buttonFrame->Destroy();
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -5195,11 +5166,10 @@ nsCSSFrameConstructor::ConstructButtonFrame(nsFrameConstructorState& aState,
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// Set the areas frame's initial child lists
|
||||
areaFrame->SetInitialChildList(aState.mPresContext, nsnull,
|
||||
childItems.childList);
|
||||
areaFrame->SetInitialChildList(nsnull, childItems.childList);
|
||||
}
|
||||
|
||||
buttonFrame->SetInitialChildList(aState.mPresContext, nsnull, areaFrame);
|
||||
buttonFrame->SetInitialChildList(nsnull, areaFrame);
|
||||
|
||||
nsFrameItems anonymousChildItems;
|
||||
// if there are any anonymous children create frames for them
|
||||
@@ -5320,15 +5290,13 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsFrameConstructorState& aState,
|
||||
CreateAnonymousFrames(nsHTMLAtoms::combobox, aState, aContent,
|
||||
comboboxFrame, PR_TRUE, childItems);
|
||||
|
||||
comboboxFrame->SetInitialChildList(aState.mPresContext, nsnull,
|
||||
childItems.childList);
|
||||
comboboxFrame->SetInitialChildList(nsnull, childItems.childList);
|
||||
|
||||
// Initialize the additional popup child list which contains the
|
||||
// dropdown list frame.
|
||||
nsFrameItems popupItems;
|
||||
popupItems.AddChild(listFrame);
|
||||
comboboxFrame->SetInitialChildList(aState.mPresContext,
|
||||
nsLayoutAtoms::popupList,
|
||||
comboboxFrame->SetInitialChildList(nsLayoutAtoms::popupList,
|
||||
popupItems.childList);
|
||||
|
||||
aNewFrame = comboboxFrame;
|
||||
@@ -5459,8 +5427,7 @@ nsCSSFrameConstructor::InitializeSelectFrame(nsFrameConstructorState& aState,
|
||||
childItems, PR_TRUE);
|
||||
|
||||
// Set the scrolled frame's initial child lists
|
||||
scrolledFrame->SetInitialChildList(aState.mPresContext, nsnull,
|
||||
childItems.childList);
|
||||
scrolledFrame->SetInitialChildList(nsnull, childItems.childList);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@@ -5554,12 +5521,10 @@ nsCSSFrameConstructor::ConstructFieldSetFrame(nsFrameConstructorState& aState,
|
||||
}
|
||||
|
||||
// Set the scrolled frame's initial child lists
|
||||
areaFrame->SetInitialChildList(aState.mPresContext, nsnull,
|
||||
childItems.childList);
|
||||
areaFrame->SetInitialChildList(nsnull, childItems.childList);
|
||||
|
||||
// Set the scroll frame's initial child list
|
||||
newFrame->SetInitialChildList(aState.mPresContext, nsnull,
|
||||
legendFrame ? legendFrame : areaFrame);
|
||||
newFrame->SetInitialChildList(nsnull, legendFrame ? legendFrame : areaFrame);
|
||||
|
||||
// our new frame retured is the top frame which is the list frame.
|
||||
aNewFrame = newFrame;
|
||||
@@ -5611,14 +5576,14 @@ nsCSSFrameConstructor::ConstructTextFrame(nsFrameConstructorState& aState,
|
||||
nsnull, newFrame);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
newFrame->Destroy(aState.mPresContext);
|
||||
newFrame->Destroy();
|
||||
return rv;
|
||||
}
|
||||
|
||||
// We never need to create a view for a text frame.
|
||||
|
||||
// Set the frame's initial child list to null.
|
||||
newFrame->SetInitialChildList(aState.mPresContext, nsnull, nsnull);
|
||||
newFrame->SetInitialChildList(nsnull, nsnull);
|
||||
|
||||
// Add the newly constructed frame to the flow
|
||||
aFrameItems.AddChild(newFrame);
|
||||
@@ -5929,8 +5894,7 @@ nsCSSFrameConstructor::ConstructHTMLFrame(nsFrameConstructorState& aState,
|
||||
|
||||
// Set the frame's initial child list
|
||||
if (childItems.childList) {
|
||||
newFrame->SetInitialChildList(aState.mPresContext, nsnull,
|
||||
childItems.childList);
|
||||
newFrame->SetInitialChildList(nsnull, childItems.childList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6552,7 +6516,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
|
||||
rv = InitAndRestoreFrame(aState, aContent, geometricParent, nsnull, newFrame);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
newFrame->Destroy(aState.mPresContext);
|
||||
newFrame->Destroy();
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -6615,8 +6579,8 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
|
||||
// Didn't add the popup set frame... Need to clean up and
|
||||
// just not construct a frame here.
|
||||
aState.mFrameManager->UnregisterPlaceholderFrame(NS_STATIC_CAST(nsPlaceholderFrame*, placeholderFrame));
|
||||
newFrame->Destroy(aState.mPresContext);
|
||||
placeholderFrame->Destroy(aState.mPresContext);
|
||||
newFrame->Destroy();
|
||||
placeholderFrame->Destroy();
|
||||
*aHaltProcessing = PR_TRUE;
|
||||
return NS_OK;
|
||||
}
|
||||
@@ -6650,8 +6614,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
|
||||
childItems);
|
||||
|
||||
// Set the frame's initial child list
|
||||
newFrame->SetInitialChildList(aState.mPresContext, nsnull,
|
||||
childItems.childList);
|
||||
newFrame->SetInitialChildList(nsnull, childItems.childList);
|
||||
}
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
@@ -6755,8 +6718,7 @@ nsCSSFrameConstructor::BeginBuildingScrollFrame(nsFrameConstructorState& aState,
|
||||
contentStyle).get();
|
||||
|
||||
if (gfxScrollFrame) {
|
||||
gfxScrollFrame->SetInitialChildList(aState.mPresContext, nsnull,
|
||||
anonymousItems.childList);
|
||||
gfxScrollFrame->SetInitialChildList(nsnull, anonymousItems.childList);
|
||||
}
|
||||
|
||||
if (isPrintPreview && noScalingOfTwips) {
|
||||
@@ -7354,10 +7316,10 @@ nsCSSFrameConstructor::ConstructMathMLFrame(nsFrameConstructorState& aState,
|
||||
// processing children, and setting the initial child list
|
||||
|
||||
// set the outerTable as the initial child of the anonymous block
|
||||
blockFrame->SetInitialChildList(aState.mPresContext, nsnull, outerTable);
|
||||
blockFrame->SetInitialChildList(nsnull, outerTable);
|
||||
|
||||
// set the block frame as the initial child of the mrow frame
|
||||
newFrame->SetInitialChildList(aState.mPresContext, nsnull, blockFrame);
|
||||
newFrame->SetInitialChildList(nsnull, blockFrame);
|
||||
|
||||
// add the new frame to the flow
|
||||
// XXXbz this is wrong. What if it's out-of-flow? For that matter, this
|
||||
@@ -7419,8 +7381,7 @@ nsCSSFrameConstructor::ConstructMathMLFrame(nsFrameConstructorState& aState,
|
||||
childItems);
|
||||
|
||||
// Set the frame's initial child list
|
||||
newFrame->SetInitialChildList(aState.mPresContext, nsnull,
|
||||
childItems.childList);
|
||||
newFrame->SetInitialChildList(nsnull, childItems.childList);
|
||||
|
||||
|
||||
if (!newFrame->IsLeaf()) {
|
||||
@@ -7533,8 +7494,7 @@ nsCSSFrameConstructor::ConstructXTFFrame(nsFrameConstructorState& aState,
|
||||
newFrame, insertionNode, isBlock);
|
||||
|
||||
// Set the frame's initial child list
|
||||
newFrame->SetInitialChildList(aState.mPresContext, nsnull,
|
||||
childItems.childList);
|
||||
newFrame->SetInitialChildList(nsnull, childItems.childList);
|
||||
|
||||
// Note: we don't worry about insertionFrame here because we know
|
||||
// that XTF elements always insert into the primary frame of their
|
||||
@@ -7942,8 +7902,7 @@ nsCSSFrameConstructor::ConstructSVGFrame(nsFrameConstructorState& aState,
|
||||
PR_FALSE, childItems);
|
||||
|
||||
// Set the frame's initial child list
|
||||
newFrame->SetInitialChildList(aState.mPresContext, nsnull,
|
||||
childItems.childList);
|
||||
newFrame->SetInitialChildList(nsnull, childItems.childList);
|
||||
}
|
||||
|
||||
if (!newFrame->IsLeaf())
|
||||
@@ -9410,8 +9369,7 @@ nsCSSFrameConstructor::ContentInserted(nsIContent* aContainer,
|
||||
if (mDocElementContainingBlock->GetStateBits() & NS_FRAME_FIRST_REFLOW) {
|
||||
// Set the initial child list for the parent and wait on the initial
|
||||
// reflow.
|
||||
mDocElementContainingBlock->SetInitialChildList(state.mPresContext,
|
||||
nsnull,
|
||||
mDocElementContainingBlock->SetInitialChildList(nsnull,
|
||||
docElementFrame);
|
||||
} else {
|
||||
// Whoops, we've already received our initial reflow! Insert the doc.
|
||||
@@ -9793,8 +9751,7 @@ nsCSSFrameConstructor::ReinsertContent(nsIContent* aContainer,
|
||||
* this changes
|
||||
*/
|
||||
static nsresult
|
||||
DoDeletingFrameSubtree(nsPresContext* aPresContext,
|
||||
nsFrameManager* aFrameManager,
|
||||
DoDeletingFrameSubtree(nsFrameManager* aFrameManager,
|
||||
nsVoidArray& aDestroyQueue,
|
||||
nsIFrame* aRemovedFrame,
|
||||
nsIFrame* aFrame)
|
||||
@@ -9803,7 +9760,7 @@ DoDeletingFrameSubtree(nsPresContext* aPresContext,
|
||||
nsIContent* content = aFrame->GetContent();
|
||||
if (content) {
|
||||
aFrameManager->SetPrimaryFrameFor(content, nsnull);
|
||||
aFrame->RemovedAsPrimaryFrame(aPresContext);
|
||||
aFrame->RemovedAsPrimaryFrame();
|
||||
aFrameManager->ClearAllUndisplayedContentIn(content);
|
||||
}
|
||||
|
||||
@@ -9815,7 +9772,7 @@ DoDeletingFrameSubtree(nsPresContext* aPresContext,
|
||||
nsIFrame* childFrame = aFrame->GetFirstChild(childListName);
|
||||
for (; childFrame; childFrame = childFrame->GetNextSibling()) {
|
||||
if (NS_LIKELY(nsLayoutAtoms::placeholderFrame != childFrame->GetType())) {
|
||||
DoDeletingFrameSubtree(aPresContext, aFrameManager, aDestroyQueue,
|
||||
DoDeletingFrameSubtree(aFrameManager, aDestroyQueue,
|
||||
aRemovedFrame, childFrame);
|
||||
|
||||
} else {
|
||||
@@ -9836,13 +9793,13 @@ DoDeletingFrameSubtree(nsPresContext* aPresContext,
|
||||
"out-of-flow is already in the destroy queue");
|
||||
aDestroyQueue.AppendElement(outOfFlowFrame);
|
||||
// Recurse into the out-of-flow, it is now the aRemovedFrame.
|
||||
DoDeletingFrameSubtree(aPresContext, aFrameManager, aDestroyQueue,
|
||||
DoDeletingFrameSubtree(aFrameManager, aDestroyQueue,
|
||||
outOfFlowFrame, outOfFlowFrame);
|
||||
}
|
||||
else {
|
||||
// Also recurse into the out-of-flow when it's a descendant of aRemovedFrame
|
||||
// since we don't walk those lists, see |childListName| increment below.
|
||||
DoDeletingFrameSubtree(aPresContext, aFrameManager, aDestroyQueue,
|
||||
DoDeletingFrameSubtree(aFrameManager, aDestroyQueue,
|
||||
aRemovedFrame, outOfFlowFrame);
|
||||
}
|
||||
}
|
||||
@@ -9865,8 +9822,7 @@ DoDeletingFrameSubtree(nsPresContext* aPresContext,
|
||||
* for aFrame and each of its continuing frames
|
||||
*/
|
||||
static nsresult
|
||||
DeletingFrameSubtree(nsPresContext* aPresContext,
|
||||
nsFrameManager* aFrameManager,
|
||||
DeletingFrameSubtree(nsFrameManager* aFrameManager,
|
||||
nsIFrame* aFrame)
|
||||
{
|
||||
NS_ENSURE_TRUE(aFrame, NS_OK); // XXXldb Remove this sometime in the future.
|
||||
@@ -9885,8 +9841,7 @@ DeletingFrameSubtree(nsPresContext* aPresContext,
|
||||
"DeletingFrameSubtree on a special frame. Prepare to crash.");
|
||||
|
||||
do {
|
||||
DoDeletingFrameSubtree(aPresContext, aFrameManager, destroyQueue,
|
||||
aFrame, aFrame);
|
||||
DoDeletingFrameSubtree(aFrameManager, destroyQueue, aFrame, aFrame);
|
||||
|
||||
// If it's split, then get the continuing frame. Note that we only do
|
||||
// this for the top-most frame being deleted. Don't do it if we're
|
||||
@@ -9941,8 +9896,7 @@ nsCSSFrameConstructor::RemoveMappingsForFrameSubtree(nsIFrame* aRemovedFrame)
|
||||
// Save the frame tree's state before deleting it
|
||||
CaptureStateFor(aRemovedFrame, mTempFrameTreeState);
|
||||
|
||||
return ::DeletingFrameSubtree(mPresShell->GetPresContext(),
|
||||
mPresShell->FrameManager(), aRemovedFrame);
|
||||
return ::DeletingFrameSubtree(mPresShell->FrameManager(), aRemovedFrame);
|
||||
}
|
||||
|
||||
nsresult
|
||||
@@ -10079,7 +10033,7 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
|
||||
|
||||
// Walk the frame subtree deleting any out-of-flow frames, and
|
||||
// remove the mapping from content objects to frames
|
||||
::DeletingFrameSubtree(presContext, frameManager, childFrame);
|
||||
::DeletingFrameSubtree(frameManager, childFrame);
|
||||
|
||||
// See if the child frame is an out-of-flow
|
||||
if (childFrame->GetStateBits() & NS_FRAME_OUT_OF_FLOW) {
|
||||
@@ -10128,7 +10082,7 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
|
||||
// Remove the placeholder frame first (XXX second for now) (so
|
||||
// that it doesn't retain a dangling pointer to memory)
|
||||
parentFrame = placeholderFrame->GetParent();
|
||||
::DeletingFrameSubtree(presContext, frameManager, placeholderFrame);
|
||||
::DeletingFrameSubtree(frameManager, placeholderFrame);
|
||||
rv |= frameManager->RemoveFrame(parentFrame,
|
||||
nsnull, placeholderFrame);
|
||||
} else {
|
||||
@@ -10935,7 +10889,7 @@ nsCSSFrameConstructor::CreateContinuingOuterTableFrame(nsIPresShell* aPresShe
|
||||
}
|
||||
|
||||
// Set the outer table's initial child list
|
||||
newFrame->SetInitialChildList(aPresContext, nsnull, newChildFrames.childList);
|
||||
newFrame->SetInitialChildList(nsnull, newChildFrames.childList);
|
||||
|
||||
*aContinuingFrame = newFrame;
|
||||
return NS_OK;
|
||||
@@ -10992,7 +10946,7 @@ nsCSSFrameConstructor::CreateContinuingTableFrame(nsIPresShell* aPresShell,
|
||||
ProcessChildren(state, headerFooter, headerFooterFrame,
|
||||
PR_FALSE, childItems, PR_FALSE, &tableCreator);
|
||||
NS_ASSERTION(!state.mFloatedItems.childList, "unexpected floated element");
|
||||
headerFooterFrame->SetInitialChildList(aPresContext, nsnull, childItems.childList);
|
||||
headerFooterFrame->SetInitialChildList(nsnull, childItems.childList);
|
||||
((nsTableRowGroupFrame*)headerFooterFrame)->SetRepeatable(PR_TRUE);
|
||||
|
||||
// Table specific initialization
|
||||
@@ -11009,7 +10963,7 @@ nsCSSFrameConstructor::CreateContinuingTableFrame(nsIPresShell* aPresShell,
|
||||
}
|
||||
|
||||
// Set the table frame's initial child list
|
||||
newFrame->SetInitialChildList(aPresContext, nsnull, childFrames.childList);
|
||||
newFrame->SetInitialChildList(nsnull, childFrames.childList);
|
||||
|
||||
*aContinuingFrame = newFrame;
|
||||
return NS_OK;
|
||||
@@ -11136,7 +11090,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
|
||||
}
|
||||
|
||||
// Set the table cell's initial child list
|
||||
newFrame->SetInitialChildList(aPresContext, nsnull, newChildList.childList);
|
||||
newFrame->SetInitialChildList(nsnull, newChildList.childList);
|
||||
}
|
||||
|
||||
} else if (IS_TABLE_CELL(frameType)) {
|
||||
@@ -11153,7 +11107,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
|
||||
CreateContinuingFrame(aPresContext, areaFrame, newFrame, &continuingAreaFrame);
|
||||
|
||||
// Set the table cell's initial child list
|
||||
newFrame->SetInitialChildList(aPresContext, nsnull, continuingAreaFrame);
|
||||
newFrame->SetInitialChildList(nsnull, continuingAreaFrame);
|
||||
}
|
||||
|
||||
} else if (nsLayoutAtoms::lineFrame == frameType) {
|
||||
@@ -11210,7 +11164,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
|
||||
CreateContinuingFrame(aPresContext, areaFrame, newFrame, &continuingAreaFrame);
|
||||
|
||||
// Set the fieldset's initial child list
|
||||
newFrame->SetInitialChildList(aPresContext, nsnull, continuingAreaFrame);
|
||||
newFrame->SetInitialChildList(nsnull, continuingAreaFrame);
|
||||
}
|
||||
} else {
|
||||
NS_ASSERTION(PR_FALSE, "unexpected frame type");
|
||||
@@ -11295,7 +11249,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
|
||||
// Add the placeholders to our primary child list.
|
||||
// XXXbz this is a little screwed up, since the fixed frames will have the
|
||||
// wrong parent block and hence auto-positioning will be broken. Oh, well.
|
||||
newFrame->SetInitialChildList(aPresContext, nsnull, fixedPlaceholders.childList);
|
||||
newFrame->SetInitialChildList(nsnull, fixedPlaceholders.childList);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@@ -11972,8 +11926,7 @@ nsCSSFrameConstructor::WrapFramesInFirstLineFrame(
|
||||
ReparentFrame(aState.mFrameManager, lineFrame, kid);
|
||||
kid = kid->GetNextSibling();
|
||||
}
|
||||
lineFrame->SetInitialChildList(aState.mPresContext, nsnull,
|
||||
firstInlineFrame);
|
||||
lineFrame->SetInitialChildList(nsnull, firstInlineFrame);
|
||||
}
|
||||
else {
|
||||
rv = NS_ERROR_OUT_OF_MEMORY;
|
||||
@@ -12129,8 +12082,7 @@ nsCSSFrameConstructor::InsertFirstLineFrames(
|
||||
NS_ASSERTION(lineFrame->GetStyleContext() == firstLineStyle,
|
||||
"Bogus style context on line frame");
|
||||
ReparentFrame(aPresContext, lineFrame, newFrame);
|
||||
lineFrame->SetInitialChildList(aState.mPresContext, nsnull,
|
||||
newFrame);
|
||||
lineFrame->SetInitialChildList(nsnull, newFrame);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -12309,7 +12261,7 @@ nsCSSFrameConstructor::CreateFloatingLetterFrame(
|
||||
InitAndRestoreFrame(aState, aTextContent, letterFrame, nsnull, aTextFrame);
|
||||
|
||||
// And then give the text frame to the letter frame
|
||||
letterFrame->SetInitialChildList(aState.mPresContext, nsnull, aTextFrame);
|
||||
letterFrame->SetInitialChildList(nsnull, aTextFrame);
|
||||
|
||||
// See if we will need to continue the text frame (does it contain
|
||||
// more than just the first-letter text or not?) If it does, then we
|
||||
@@ -12341,7 +12293,7 @@ nsCSSFrameConstructor::CreateFloatingLetterFrame(
|
||||
|
||||
if (nextTextFrame) {
|
||||
if (NS_FAILED(rv)) {
|
||||
nextTextFrame->Destroy(aState.mPresContext);
|
||||
nextTextFrame->Destroy();
|
||||
} else {
|
||||
aResult.AddChild(nextTextFrame);
|
||||
}
|
||||
@@ -12397,8 +12349,7 @@ nsCSSFrameConstructor::CreateLetterFrame(nsFrameConstructorState& aState,
|
||||
|
||||
InitAndRestoreFrame(aState, aTextContent, letterFrame, nsnull, textFrame);
|
||||
|
||||
letterFrame->SetInitialChildList(aState.mPresContext, nsnull,
|
||||
textFrame);
|
||||
letterFrame->SetInitialChildList(nsnull, textFrame);
|
||||
aResult.childList = aResult.lastChild = letterFrame;
|
||||
}
|
||||
}
|
||||
@@ -12444,7 +12395,7 @@ nsCSSFrameConstructor::WrapFramesInFirstLetterFrame(
|
||||
letterFrames.lastChild->SetNextSibling(nextSibling);
|
||||
|
||||
// Destroy the old textFrame
|
||||
textFrame->Destroy(aState.mPresContext);
|
||||
textFrame->Destroy();
|
||||
|
||||
// Repair lastChild; the only time this needs to happen is when
|
||||
// the block had one child (the text frame).
|
||||
@@ -12454,8 +12405,7 @@ nsCSSFrameConstructor::WrapFramesInFirstLetterFrame(
|
||||
}
|
||||
else {
|
||||
// Take the old textFrame out of the inline parents child list
|
||||
::DeletingFrameSubtree(aState.mPresContext, aState.mFrameManager,
|
||||
textFrame);
|
||||
::DeletingFrameSubtree(aState.mFrameManager, textFrame);
|
||||
parentFrame->RemoveFrame(nsnull, textFrame);
|
||||
|
||||
// Insert in the letter frame(s)
|
||||
@@ -12607,7 +12557,7 @@ nsCSSFrameConstructor::RemoveFloatingFirstLetterFrames(
|
||||
nsIFrame* nextTextParent = nextTextFrame->GetParent();
|
||||
if (nextTextParent) {
|
||||
nsSplittableFrame::BreakFromPrevFlow(nextTextFrame);
|
||||
::DeletingFrameSubtree(aPresContext, aFrameManager, nextTextFrame);
|
||||
::DeletingFrameSubtree(aFrameManager, nextTextFrame);
|
||||
aFrameManager->RemoveFrame(nextTextParent, nsnull, nextTextFrame);
|
||||
}
|
||||
}
|
||||
@@ -12635,7 +12585,7 @@ nsCSSFrameConstructor::RemoveFloatingFirstLetterFrames(
|
||||
aFrameManager->UnregisterPlaceholderFrame(placeholderFrame);
|
||||
|
||||
// Remove the float frame
|
||||
::DeletingFrameSubtree(aPresContext, aFrameManager, floatFrame);
|
||||
::DeletingFrameSubtree(aFrameManager, floatFrame);
|
||||
aFrameManager->RemoveFrame(aBlockFrame, nsLayoutAtoms::floatList,
|
||||
floatFrame);
|
||||
|
||||
@@ -12686,7 +12636,7 @@ nsCSSFrameConstructor::RemoveFirstLetterFrames(nsPresContext* aPresContext,
|
||||
textFrame->Init(textContent, aFrame, nsnull);
|
||||
|
||||
// Next rip out the kid and replace it with the text frame
|
||||
::DeletingFrameSubtree(aPresContext, aFrameManager, kid);
|
||||
::DeletingFrameSubtree(aFrameManager, kid);
|
||||
aFrameManager->RemoveFrame(aFrame, nsnull, kid);
|
||||
|
||||
// Insert text frame in its place
|
||||
@@ -12750,8 +12700,7 @@ nsCSSFrameConstructor::RecoverLetterFrames(nsFrameConstructorState& aState,
|
||||
}
|
||||
if (parentFrame) {
|
||||
// Take the old textFrame out of the parents child list
|
||||
::DeletingFrameSubtree(aState.mPresContext, aState.mFrameManager,
|
||||
textFrame);
|
||||
::DeletingFrameSubtree(aState.mFrameManager, textFrame);
|
||||
parentFrame->RemoveFrame(nsnull, textFrame);
|
||||
|
||||
// Insert in the letter frame(s)
|
||||
@@ -12861,8 +12810,7 @@ nsCSSFrameConstructor::ConstructBlock(nsFrameConstructorState& aState,
|
||||
parent = columnSetFrame;
|
||||
*aNewFrame = columnSetFrame;
|
||||
|
||||
columnSetFrame->SetInitialChildList(aState.mPresContext, nsnull,
|
||||
blockFrame);
|
||||
columnSetFrame->SetInitialChildList(nsnull, blockFrame);
|
||||
|
||||
blockFrame->AddStateBits(NS_BLOCK_SPACE_MGR);
|
||||
}
|
||||
@@ -12919,8 +12867,7 @@ nsCSSFrameConstructor::ConstructBlock(nsFrameConstructorState& aState,
|
||||
PR_FALSE, childItems);
|
||||
|
||||
// Set the frame's initial child list
|
||||
blockFrame->SetInitialChildList(aState.mPresContext, nsnull,
|
||||
childItems.childList);
|
||||
blockFrame->SetInitialChildList(nsnull, childItems.childList);
|
||||
|
||||
return rv;
|
||||
}
|
||||
@@ -12974,8 +12921,7 @@ nsCSSFrameConstructor::ConstructInline(nsFrameConstructorState& aState,
|
||||
CreateAnonymousFrames(aContent->Tag(), aState, aContent, aNewFrame,
|
||||
PR_FALSE, childItems);
|
||||
|
||||
aNewFrame->SetInitialChildList(aState.mPresContext, nsnull,
|
||||
childItems.childList);
|
||||
aNewFrame->SetInitialChildList(nsnull, childItems.childList);
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -13011,7 +12957,7 @@ nsCSSFrameConstructor::ConstructInline(nsFrameConstructorState& aState,
|
||||
lastBlock->SetNextSibling(nsnull);
|
||||
|
||||
// list1's frames belong to this inline frame so go ahead and take them
|
||||
aNewFrame->SetInitialChildList(aState.mPresContext, nsnull, list1);
|
||||
aNewFrame->SetInitialChildList(nsnull, list1);
|
||||
|
||||
// list2's frames belong to an anonymous block that we create right
|
||||
// now. The anonymous block will be the parent of the block children
|
||||
@@ -13048,7 +12994,7 @@ nsCSSFrameConstructor::ConstructInline(nsFrameConstructorState& aState,
|
||||
list2->GetParent(), blockFrame);
|
||||
}
|
||||
|
||||
blockFrame->SetInitialChildList(aState.mPresContext, nsnull, list2);
|
||||
blockFrame->SetInitialChildList(nsnull, list2);
|
||||
|
||||
nsFrameConstructorState state(mPresShell, mFixedContainingBlock,
|
||||
GetAbsoluteContainingBlock(blockFrame),
|
||||
@@ -13086,7 +13032,7 @@ nsCSSFrameConstructor::ConstructInline(nsFrameConstructorState& aState,
|
||||
|
||||
// Reparent (cheaply) the frames in list3 - we don't have to futz
|
||||
// with their style context because they already have the right one.
|
||||
inlineFrame->SetInitialChildList(aState.mPresContext, nsnull, list3);
|
||||
inlineFrame->SetInitialChildList(nsnull, list3);
|
||||
MoveChildrenTo(aState.mFrameManager, nsnull, inlineFrame, list3, nsnull, nsnull);
|
||||
}
|
||||
|
||||
@@ -13240,35 +13186,34 @@ nsCSSFrameConstructor::WipeContainingBlock(nsFrameConstructorState& aState,
|
||||
|
||||
// Ok, reverse tracks: wipe out the frames we just created
|
||||
nsFrameManager *frameManager = aState.mFrameManager;
|
||||
nsPresContext *presContext = aState.mPresContext;
|
||||
|
||||
// Destroy the frames. As we do make sure any content to frame mappings
|
||||
// or entries in the undisplayed content map are removed
|
||||
frameManager->ClearAllUndisplayedContentIn(aFrame->GetContent());
|
||||
|
||||
CleanupFrameReferences(presContext, frameManager, aFrameList);
|
||||
CleanupFrameReferences(frameManager, aFrameList);
|
||||
if (aState.mAbsoluteItems.childList) {
|
||||
CleanupFrameReferences(presContext, frameManager, aState.mAbsoluteItems.childList);
|
||||
CleanupFrameReferences(frameManager, aState.mAbsoluteItems.childList);
|
||||
}
|
||||
if (aState.mFixedItems.childList) {
|
||||
CleanupFrameReferences(presContext, frameManager, aState.mFixedItems.childList);
|
||||
CleanupFrameReferences(frameManager, aState.mFixedItems.childList);
|
||||
}
|
||||
if (aState.mFloatedItems.childList) {
|
||||
CleanupFrameReferences(presContext, frameManager, aState.mFloatedItems.childList);
|
||||
CleanupFrameReferences(frameManager, aState.mFloatedItems.childList);
|
||||
}
|
||||
nsFrameList tmp(aFrameList);
|
||||
tmp.DestroyFrames(presContext);
|
||||
tmp.DestroyFrames();
|
||||
|
||||
tmp.SetFrames(aState.mAbsoluteItems.childList);
|
||||
tmp.DestroyFrames(presContext);
|
||||
tmp.DestroyFrames();
|
||||
aState.mAbsoluteItems.childList = nsnull;
|
||||
|
||||
tmp.SetFrames(aState.mFixedItems.childList);
|
||||
tmp.DestroyFrames(presContext);
|
||||
tmp.DestroyFrames();
|
||||
aState.mFixedItems.childList = nsnull;
|
||||
|
||||
tmp.SetFrames(aState.mFloatedItems.childList);
|
||||
tmp.DestroyFrames(presContext);
|
||||
tmp.DestroyFrames();
|
||||
aState.mFloatedItems.childList = nsnull;
|
||||
|
||||
// If we don't have a containing block, try to find our closest non-inline
|
||||
@@ -13384,8 +13329,7 @@ nsresult nsCSSFrameConstructor::RemoveFixedItems(const nsFrameConstructorState&
|
||||
mPresShell->GetPlaceholderFrameFor(fixedChild, &placeholderFrame);
|
||||
NS_ASSERTION(placeholderFrame, "no placeholder for fixed-pos frame");
|
||||
nsIFrame* placeholderParent = placeholderFrame->GetParent();
|
||||
::DeletingFrameSubtree(aState.mPresContext, aState.mFrameManager,
|
||||
placeholderFrame);
|
||||
::DeletingFrameSubtree(aState.mFrameManager, placeholderFrame);
|
||||
rv = aState.mFrameManager->RemoveFrame(placeholderParent, nsnull,
|
||||
placeholderFrame);
|
||||
if (NS_FAILED(rv)) {
|
||||
@@ -13393,8 +13337,7 @@ nsresult nsCSSFrameConstructor::RemoveFixedItems(const nsFrameConstructorState&
|
||||
break;
|
||||
}
|
||||
|
||||
::DeletingFrameSubtree(aState.mPresContext, aState.mFrameManager,
|
||||
fixedChild);
|
||||
::DeletingFrameSubtree(aState.mFrameManager, fixedChild);
|
||||
rv = aState.mFrameManager->RemoveFrame(mFixedContainingBlock,
|
||||
nsLayoutAtoms::fixedList,
|
||||
fixedChild);
|
||||
|
||||
Reference in New Issue
Block a user