Bug 328926. Remove aPresContext parameter from nsIFrame::Destroy, nsIFrame::SetInitialChildList and nsIFrame::RemovedAsPrimaryFrame. patch by Marc Liddell, r+sr=roc

This commit is contained in:
roc+%cs.cmu.edu 2006-04-10 00:16:29 +00:00
Родитель 917b5e275a
Коммит a7f03736a9
109 изменённых файлов: 548 добавлений и 696 удалений

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

@ -373,7 +373,7 @@ nsBidiPresUtils::Resolve(nsPresContext* aPresContext,
} // if (runLength <= 0)
if (nsLayoutAtoms::directionalFrame == frameType) {
frame->Destroy(aPresContext);
frame->Destroy();
frame = nsnull;
++lineOffset;
}
@ -880,7 +880,7 @@ nsBidiPresUtils::RemoveBidiContinuation(nsPresContext* aPresContext,
for (PRInt32 index = aFirstIndex + 1; index <= aLastIndex; index++) {
nsIFrame* frame = (nsIFrame*) mLogicalFrames[index];
if (nsLayoutAtoms::directionalFrame == frame->GetType()) {
frame->Destroy(aPresContext);
frame->Destroy();
++aOffset;
}
else {

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

@ -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);

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

@ -284,8 +284,6 @@ nsFrameManager::Destroy()
{
NS_ASSERTION(mPresShell, "Frame manager already shut down.");
nsPresContext *presContext = mPresShell->GetPresContext();
// Destroy the frame hierarchy.
mPresShell->SetIgnoreFrameDestruction(PR_TRUE);
@ -295,7 +293,7 @@ nsFrameManager::Destroy()
nsFrameManager::ClearPlaceholderFrameMap();
if (mRootFrame) {
mRootFrame->Destroy(presContext);
mRootFrame->Destroy();
mRootFrame = nsnull;
}

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

@ -1912,7 +1912,7 @@ nsComboboxControlFrame::CreateFrameFor(nsPresContext* aPresContext,
nsresult rv = mDisplayFrame->Init(mContent, this, nsnull);
if (NS_FAILED(rv)) {
mDisplayFrame->Destroy(aPresContext);
mDisplayFrame->Destroy();
mDisplayFrame = nsnull;
return rv;
}
@ -1926,20 +1926,20 @@ nsComboboxControlFrame::CreateFrameFor(nsPresContext* aPresContext,
// initialize the text frame
rv = mTextFrame->Init(aContent, mDisplayFrame, nsnull);
if (NS_FAILED(rv)) {
mDisplayFrame->Destroy(aPresContext);
mDisplayFrame->Destroy();
mDisplayFrame = nsnull;
mTextFrame->Destroy(aPresContext);
mTextFrame->Destroy();
mTextFrame = nsnull;
return rv;
}
mDisplayFrame->SetInitialChildList(aPresContext, nsnull, mTextFrame);
mDisplayFrame->SetInitialChildList(nsnull, mTextFrame);
*aFrame = mDisplayFrame;
return NS_OK;
}
NS_IMETHODIMP
nsComboboxControlFrame::Destroy(nsPresContext* aPresContext)
void
nsComboboxControlFrame::Destroy()
{
// Revoke queued RedisplayTextEvents
nsCOMPtr<nsIEventQueue> eventQueue;
@ -1950,7 +1950,7 @@ nsComboboxControlFrame::Destroy(nsPresContext* aPresContext)
eventQueue->RevokeEvents(this);
}
nsFormControlFrame::RegUnRegAccessKey(GetPresContext(), NS_STATIC_CAST(nsIFrame*, this), PR_FALSE);
nsFormControlFrame::RegUnRegAccessKey(NS_STATIC_CAST(nsIFrame*, this), PR_FALSE);
if (mDroppedDown) {
// Get parent view
@ -1967,9 +1967,9 @@ nsComboboxControlFrame::Destroy(nsPresContext* aPresContext)
}
// Cleanup frames in popup child list
mPopupFrames.DestroyFrames(aPresContext);
mPopupFrames.DestroyFrames();
return nsAreaFrame::Destroy(aPresContext);
nsAreaFrame::Destroy();
}
@ -1983,15 +1983,14 @@ nsComboboxControlFrame::GetFirstChild(nsIAtom* aListName) const
}
NS_IMETHODIMP
nsComboboxControlFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
nsComboboxControlFrame::SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult rv = NS_OK;
if (nsLayoutAtoms::popupList == aListName) {
mPopupFrames.SetFrames(aChildList);
} else {
rv = nsAreaFrame::SetInitialChildList(aPresContext, aListName, aChildList);
rv = nsAreaFrame::SetInitialChildList(aListName, aChildList);
for (nsIFrame * child = aChildList; child;
child = child->GetNextSibling()) {

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

@ -124,11 +124,10 @@ public:
#ifdef NS_DEBUG
NS_IMETHOD GetFrameName(nsAString& aResult) const;
#endif
NS_IMETHOD Destroy(nsPresContext* aPresContext);
virtual void Destroy();
virtual nsIFrame* GetFirstChild(nsIAtom* aListName) const;
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList);
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList);
virtual nsIAtom* GetAdditionalChildListName(PRInt32 aIndex) const;
virtual nsIFrame* GetContentInsertionFrame();

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

@ -70,8 +70,7 @@ public:
nsFieldSetFrame(nsStyleContext* aContext);
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList);
NS_IMETHOD Reflow(nsPresContext* aPresContext,
@ -146,8 +145,7 @@ nsFieldSetFrame::IsContainingBlock() const
}
NS_IMETHODIMP
nsFieldSetFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsFieldSetFrame::SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList)
{
// Get the content and legend frames.
@ -160,7 +158,7 @@ nsFieldSetFrame::SetInitialChildList(nsPresContext* aPresContext,
}
// Queue up the frames for the content frame
return nsHTMLContainerFrame::SetInitialChildList(aPresContext, nsnull, aChildList);
return nsHTMLContainerFrame::SetInitialChildList(nsnull, aChildList);
}
class nsDisplayFieldSetBorderBackground : public nsDisplayItem {
@ -644,12 +642,12 @@ nsFieldSetFrame::RemoveFrame(nsIAtom* aListName,
NS_ASSERTION(!aListName, "Unexpected frame list when removing legend frame");
NS_ASSERTION(mLegendFrame->GetParent() == this, "Legend Parent has wrong parent");
NS_ASSERTION(mLegendFrame->GetNextSibling() == mContentFrame, "mContentFrame is not next sibling");
nsPresContext* presContext = GetPresContext();
mFrames.DestroyFrame(presContext, mLegendFrame);
mFrames.DestroyFrame(mLegendFrame);
mLegendFrame = nsnull;
AddStateBits(NS_FRAME_IS_DIRTY);
if (GetParent()) {
GetParent()->ReflowDirtyChild(presContext->GetPresShell(), this);
GetParent()->ReflowDirtyChild(GetPresContext()->GetPresShell(), this);
}
return NS_OK;
}

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

@ -111,7 +111,7 @@ nsFileControlFrame::~nsFileControlFrame()
}
void
nsFileControlFrame::PreDestroy(nsPresContext* aPresContext)
nsFileControlFrame::PreDestroy()
{
// Toss the value into the control from the anonymous content, which is about
// to get lost. Note that if the page is being torn down then the anonymous
@ -135,21 +135,21 @@ nsFileControlFrame::PreDestroy(nsPresContext* aPresContext)
mDidPreDestroy = PR_TRUE;
}
NS_IMETHODIMP
nsFileControlFrame::Destroy(nsPresContext* aPresContext)
void
nsFileControlFrame::Destroy()
{
if (!mDidPreDestroy) {
PreDestroy(aPresContext);
PreDestroy();
}
mTextFrame = nsnull;
return nsAreaFrame::Destroy(aPresContext);
nsAreaFrame::Destroy();
}
void
nsFileControlFrame::RemovedAsPrimaryFrame(nsPresContext* aPresContext)
nsFileControlFrame::RemovedAsPrimaryFrame()
{
if (!mDidPreDestroy) {
PreDestroy(aPresContext);
PreDestroy();
}
#ifdef DEBUG
else {
@ -458,11 +458,10 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsPresContext* aPresContext,
/*
NS_IMETHODIMP
nsFileControlFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
nsFileControlFrame::SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult r = nsAreaFrame::SetInitialChildList(aPresContext, aListName, aChildList);
nsAreaFrame::SetInitialChildList(aListName, aChildList);
// given that the CSS frame constructor created all our frames. We need to find the text field
// so we can get info from it.

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

@ -75,9 +75,9 @@ public:
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
virtual void RemovedAsPrimaryFrame(nsPresContext* aPresContext);
virtual void RemovedAsPrimaryFrame();
NS_IMETHOD Destroy(nsPresContext *aPresContext);
virtual void Destroy();
#ifdef NS_DEBUG
NS_IMETHOD GetFrameName(nsAString& aResult) const;
@ -197,7 +197,7 @@ private:
* We call this when we are being destroyed or removed from the PFM.
* @param aPresContext the current pres context
*/
void PreDestroy(nsPresContext* aPresContext);
void PreDestroy();
NS_IMETHOD_(nsrefcnt) AddRef() { return 1; }
NS_IMETHOD_(nsrefcnt) Release() { return 1; }

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

@ -56,13 +56,13 @@ nsFormControlFrame::~nsFormControlFrame()
{
}
NS_IMETHODIMP
nsFormControlFrame::Destroy(nsPresContext *aPresContext)
void
nsFormControlFrame::Destroy()
{
// XXXldb Do we really need to do this? Shouldn't only those frames
// that use it do it?
nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE);
return nsLeafFrame::Destroy(aPresContext);
nsFormControlFrame::RegUnRegAccessKey(NS_STATIC_CAST(nsIFrame*, this), PR_FALSE);
nsLeafFrame::Destroy();
}
// Frames are not refcounted, no need to AddRef
@ -263,8 +263,7 @@ nsFormControlFrame::DidReflow(nsPresContext* aPresContext,
}
NS_IMETHODIMP
nsFormControlFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsFormControlFrame::SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList)
{
return NS_OK;
@ -280,7 +279,7 @@ nsFormControlFrame::Reflow(nsPresContext* aPresContext,
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
if (!mDidInit) {
RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_TRUE);
RegUnRegAccessKey(NS_STATIC_CAST(nsIFrame*, this), PR_TRUE);
mDidInit = PR_TRUE;
}
@ -294,17 +293,20 @@ nsFormControlFrame::Reflow(nsPresContext* aPresContext,
}
nsresult
nsFormControlFrame::RegUnRegAccessKey(nsPresContext* aPresContext, nsIFrame * aFrame, PRBool aDoReg)
nsFormControlFrame::RegUnRegAccessKey(nsIFrame * aFrame, PRBool aDoReg)
{
NS_ASSERTION(aPresContext, "aPresContext is NULL in RegUnRegAccessKey!");
NS_ENSURE_ARG_POINTER(aFrame);
nsPresContext* presContext = aFrame->GetPresContext();
NS_ASSERTION(presContext, "aPresContext is NULL in RegUnRegAccessKey!");
nsAutoString accessKey;
nsIContent* content = aFrame->GetContent();
content->GetAttr(kNameSpaceID_None, nsHTMLAtoms::accesskey, accessKey);
if (!accessKey.IsEmpty()) {
nsIEventStateManager *stateManager = aPresContext->EventStateManager();
nsIEventStateManager *stateManager = presContext->EventStateManager();
if (aDoReg) {
return stateManager->RegisterAccessKey(content, (PRUint32)accessKey.First());
} else {

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

@ -92,8 +92,7 @@ public:
nsGUIEvent* aEvent,
nsEventStatus* aEventStatus);
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList);
NS_IMETHOD DidReflow(nsPresContext* aPresContext,
@ -109,7 +108,7 @@ public:
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD Destroy(nsPresContext *aPresContext);
virtual void Destroy();
// new behavior
@ -146,7 +145,7 @@ public:
PRBool& aBailOnWidth,
PRBool& aBailOnHeight);
// AccessKey Helper function
static nsresult RegUnRegAccessKey(nsPresContext* aPresContext, nsIFrame * aFrame, PRBool aDoReg);
static nsresult RegUnRegAccessKey(nsIFrame * aFrame, PRBool aDoReg);
/**
* Helper routine to that returns the height of the screen

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

@ -157,7 +157,7 @@ nsGfxButtonControlFrame::CreateFrameFor(nsPresContext* aPresContext,
// initialize the text frame
newFrame->Init(content, parentFrame, nsnull);
newFrame->SetInitialChildList(aPresContext, nsnull, nsnull);
newFrame->SetInitialChildList(nsnull, nsnull);
rv = NS_OK;
}
}

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

@ -90,11 +90,11 @@ nsHTMLButtonControlFrame::~nsHTMLButtonControlFrame()
{
}
NS_IMETHODIMP
nsHTMLButtonControlFrame::Destroy(nsPresContext *aPresContext)
void
nsHTMLButtonControlFrame::Destroy()
{
nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE);
return nsHTMLContainerFrame::Destroy(aPresContext);
nsFormControlFrame::RegUnRegAccessKey(NS_STATIC_CAST(nsIFrame*, this), PR_FALSE);
nsHTMLContainerFrame::Destroy();
}
NS_IMETHODIMP
@ -253,7 +253,7 @@ nsHTMLButtonControlFrame::Reflow(nsPresContext* aPresContext,
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
if (eReflowReason_Initial == aReflowState.reason) {
nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_TRUE);
nsFormControlFrame::RegUnRegAccessKey(NS_STATIC_CAST(nsIFrame*, this), PR_TRUE);
}
#if 0

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

@ -64,7 +64,7 @@ public:
~nsHTMLButtonControlFrame();
NS_IMETHOD Destroy(nsPresContext *aPresContext);
virtual void Destroy();
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);

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

@ -72,7 +72,7 @@ public:
nsImageControlFrame(nsStyleContext* aContext);
~nsImageControlFrame();
NS_IMETHOD Destroy(nsPresContext *aPresContext);
virtual void Destroy();
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
NS_IMETHOD Reflow(nsPresContext* aPresContext,
@ -125,12 +125,11 @@ nsImageControlFrame::~nsImageControlFrame()
{
}
NS_IMETHODIMP
nsImageControlFrame::Destroy(nsPresContext *aPresContext)
void
nsImageControlFrame::Destroy()
{
nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE);
return nsImageControlFrameSuper::Destroy(aPresContext);
nsFormControlFrame::RegUnRegAccessKey(NS_STATIC_CAST(nsIFrame*, this), PR_FALSE);
nsImageControlFrameSuper::Destroy();
}
nsIFrame*
@ -204,7 +203,7 @@ nsImageControlFrame::Reflow(nsPresContext* aPresContext,
DO_GLOBAL_REFLOW_COUNT("nsImageControlFrame", aReflowState.reason);
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
if (aReflowState.reason == eReflowReason_Initial) {
nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_TRUE);
nsFormControlFrame::RegUnRegAccessKey(NS_STATIC_CAST(nsIFrame*, this), PR_TRUE);
}
return nsImageControlFrameSuper::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
}

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

@ -71,11 +71,11 @@ nsLegendFrame::GetType() const
return nsLayoutAtoms::legendFrame;
}
NS_IMETHODIMP
nsLegendFrame::Destroy(nsPresContext *aPresContext)
void
nsLegendFrame::Destroy()
{
nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE);
return nsAreaFrame::Destroy(aPresContext);
nsFormControlFrame::RegUnRegAccessKey(NS_STATIC_CAST(nsIFrame*, this), PR_FALSE);
nsAreaFrame::Destroy();
}
// Frames are not refcounted, no need to AddRef
@ -102,7 +102,7 @@ nsLegendFrame::Reflow(nsPresContext* aPresContext,
DO_GLOBAL_REFLOW_COUNT("nsLegendFrame", aReflowState.reason);
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
if (eReflowReason_Initial == aReflowState.reason) {
nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_TRUE);
nsFormControlFrame::RegUnRegAccessKey(NS_STATIC_CAST(nsIFrame*, this), PR_TRUE);
}
return nsAreaFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
}

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

@ -63,7 +63,7 @@ public:
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD Destroy(nsPresContext *aPresContext);
virtual void Destroy();
virtual nsIAtom* GetType() const;

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

@ -315,8 +315,8 @@ nsListControlFrame::~nsListControlFrame()
}
// for Bug 47302 (remove this comment later)
NS_IMETHODIMP
nsListControlFrame::Destroy(nsPresContext *aPresContext)
void
nsListControlFrame::Destroy()
{
// get the receiver interface from the browser button's content node
nsCOMPtr<nsIDOMEventReceiver> receiver(do_QueryInterface(mContent));
@ -338,8 +338,8 @@ nsListControlFrame::Destroy(nsPresContext *aPresContext)
mEventListener),
NS_GET_IID(nsIDOMKeyListener));
nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE);
return nsHTMLScrollFrame::Destroy(aPresContext);
nsFormControlFrame::RegUnRegAccessKey(NS_STATIC_CAST(nsIFrame*, this), PR_FALSE);
nsHTMLScrollFrame::Destroy();
}
NS_IMETHODIMP
@ -751,7 +751,7 @@ nsListControlFrame::Reflow(nsPresContext* aPresContext,
// Add the list frame as a child of the form
if (eReflowReason_Initial == aReflowState.reason) {
nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_TRUE);
nsFormControlFrame::RegUnRegAccessKey(NS_STATIC_CAST(nsIFrame*, this), PR_TRUE);
}
//--Calculate a width just big enough for the scrollframe to shrink around the
@ -1391,8 +1391,7 @@ nsListControlFrame::HandleEvent(nsPresContext* aPresContext,
//---------------------------------------------------------
NS_IMETHODIMP
nsListControlFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsListControlFrame::SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList)
{
// First check to see if all the content has been added
@ -1401,7 +1400,7 @@ nsListControlFrame::SetInitialChildList(nsPresContext* aPresContext,
mIsAllFramesHere = PR_FALSE;
mHasBeenInitialized = PR_FALSE;
}
nsresult rv = nsHTMLScrollFrame::SetInitialChildList(aPresContext, aListName, aChildList);
nsresult rv = nsHTMLScrollFrame::SetInitialChildList(aListName, aChildList);
// If all the content is here now check
// to see if all the frames have been created

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

@ -89,8 +89,7 @@ public:
nsGUIEvent* aEvent,
nsEventStatus* aEventStatus);
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList);
NS_IMETHOD Reflow(nsPresContext* aCX,
@ -105,7 +104,7 @@ public:
NS_IMETHOD DidReflow(nsPresContext* aPresContext,
const nsHTMLReflowState* aReflowState,
nsDidReflowStatus aStatus);
NS_IMETHOD Destroy(nsPresContext *aPresContext);
virtual void Destroy();
NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,

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

@ -1051,7 +1051,7 @@ SuppressEventHandlers(nsPresContext* aPresContext)
}
void
nsTextControlFrame::PreDestroy(nsPresContext* aPresContext)
nsTextControlFrame::PreDestroy()
{
// notify the editor that we are going away
if (mEditor)
@ -1076,7 +1076,7 @@ nsTextControlFrame::PreDestroy(nsPresContext* aPresContext)
// Clean up the controller
if (!SuppressEventHandlers(aPresContext))
if (!SuppressEventHandlers(GetPresContext()))
{
nsCOMPtr<nsIControllers> controllers;
nsCOMPtr<nsIDOMNSHTMLInputElement> inputElement = do_QueryInterface(mContent);
@ -1117,7 +1117,7 @@ nsTextControlFrame::PreDestroy(nsPresContext* aPresContext)
//unregister self from content
mTextListener->SetFrame(nsnull);
nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE);
nsFormControlFrame::RegUnRegAccessKey(NS_STATIC_CAST(nsIFrame*, this), PR_FALSE);
if (mTextListener)
{
nsCOMPtr<nsIDOMEventReceiver> erP = do_QueryInterface(mContent);
@ -1146,22 +1146,22 @@ nsTextControlFrame::PreDestroy(nsPresContext* aPresContext)
mDidPreDestroy = PR_TRUE;
}
NS_IMETHODIMP
nsTextControlFrame::Destroy(nsPresContext* aPresContext)
void
nsTextControlFrame::Destroy()
{
nsContentUtils::UnregisterPrefCallback(PREF_DEFAULT_SPELLCHECK,
nsTextControlFrame::RealTimeSpellCallback, this);
if (!mDidPreDestroy) {
PreDestroy(aPresContext);
PreDestroy();
}
return nsBoxFrame::Destroy(aPresContext);
nsBoxFrame::Destroy();
}
void
nsTextControlFrame::RemovedAsPrimaryFrame(nsPresContext* aPresContext)
nsTextControlFrame::RemovedAsPrimaryFrame()
{
if (!mDidPreDestroy) {
PreDestroy(aPresContext);
PreDestroy();
}
else NS_ASSERTION(PR_FALSE, "RemovedAsPrimaryFrame called after PreDestroy");
}
@ -1831,7 +1831,7 @@ nsTextControlFrame::Reflow(nsPresContext* aPresContext,
// make sure the the form registers itself on the initial/first reflow
if (mState & NS_FRAME_FIRST_REFLOW) {
nsFormControlFrame::RegUnRegAccessKey(aPresContext, this, PR_TRUE);
nsFormControlFrame::RegUnRegAccessKey(this, PR_TRUE);
}
nsresult rv = nsStackFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
@ -2828,11 +2828,10 @@ nsTextControlFrame::SetValue(const nsAString& aValue)
NS_IMETHODIMP
nsTextControlFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
nsTextControlFrame::SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult rv = nsBoxFrame::SetInitialChildList(aPresContext, aListName, aChildList);
nsresult rv = nsBoxFrame::SetInitialChildList(aListName, aChildList);
if (mEditor)
mEditor->PostCreate();
//look for scroll view below this frame go along first child list
@ -2863,7 +2862,7 @@ nsTextControlFrame::SetInitialChildList(nsPresContext* aPresContext,
rv = erP->AddEventListenerByIID(NS_STATIC_CAST(nsIDOMFocusListener *,mTextListener), NS_GET_IID(nsIDOMFocusListener));
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to register focus listener");
// XXXbryner do we need to check for a null presshell here?
if (!aPresContext->GetPresShell())
if (!GetPresContext()->GetPresShell())
return NS_ERROR_FAILURE;
}

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

@ -75,9 +75,9 @@ public:
nsTextControlFrame(nsIPresShell* aShell, nsStyleContext* aContext);
virtual ~nsTextControlFrame();
virtual void RemovedAsPrimaryFrame(nsPresContext* aPresContext);
virtual void RemovedAsPrimaryFrame();
NS_IMETHOD Destroy(nsPresContext* aPresContext);
virtual void Destroy();
NS_IMETHOD Reflow(nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
@ -113,9 +113,8 @@ public:
// Utility methods to set current widget state
void SetValue(const nsAString& aValue);
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList);
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList);
//==== BEGIN NSIFORMCONTROLFRAME
virtual void SetFocus(PRBool aOn , PRBool aRepaint);
@ -230,7 +229,7 @@ protected:
* We call this when we are being destroyed or removed from the PFM.
* @param aPresContext the current pres context
*/
void PreDestroy(nsPresContext* aPresContext);
void PreDestroy();
/**
* Fire the onChange event.
*/

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

@ -67,7 +67,6 @@ nsAbsoluteContainingBlock::FirstChild(const nsIFrame* aDelegatingFrame,
nsresult
nsAbsoluteContainingBlock::SetInitialChildList(nsIFrame* aDelegatingFrame,
nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
{
@ -119,8 +118,7 @@ nsAbsoluteContainingBlock::RemoveFrame(nsIFrame* aDelegatingFrame,
nsIAtom* aListName,
nsIFrame* aOldFrame)
{
PRBool result = mAbsoluteFrames.DestroyFrame(aDelegatingFrame->
GetPresContext(), aOldFrame);
PRBool result = mAbsoluteFrames.DestroyFrame(aOldFrame);
NS_ASSERTION(result, "didn't find frame to delete");
// Because positioned frames aren't part of a flow, there's no additional
// work to do, e.g. reflowing sibling frames. And because positioned frames
@ -417,10 +415,9 @@ nsAbsoluteContainingBlock::IncrementalReflow(nsIFrame* aDelegatin
}
void
nsAbsoluteContainingBlock::DestroyFrames(nsIFrame* aDelegatingFrame,
nsPresContext* aPresContext)
nsAbsoluteContainingBlock::DestroyFrames(nsIFrame* aDelegatingFrame)
{
mAbsoluteFrames.DestroyFrames(aPresContext);
mAbsoluteFrames.DestroyFrames();
}
// XXX Optimize the case where it's a resize reflow and the absolutely

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

@ -77,7 +77,6 @@ public:
nsIFrame* GetFirstChild() { return mAbsoluteFrames.FirstChild(); }
nsresult SetInitialChildList(nsIFrame* aDelegatingFrame,
nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList);
nsresult AppendFrames(nsIFrame* aDelegatingFrame,
@ -124,8 +123,7 @@ public:
nscoord aContainingBlockWidth,
nscoord aContainingBlockHeight);
void DestroyFrames(nsIFrame* aDelegatingFrame,
nsPresContext* aPresContext);
void DestroyFrames(nsIFrame* aDelegatingFrame);
PRBool HasAbsoluteFrames() {return mAbsoluteFrames.NotEmpty();}

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

@ -74,8 +74,7 @@ NS_NewAreaFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFl
// If you make changes to this function, check its counterparts
// in nsBoxFrame and nsTextBoxFrame
nsresult
nsAreaFrame::RegUnregAccessKey(nsPresContext* aPresContext,
PRBool aDoReg)
nsAreaFrame::RegUnregAccessKey(PRBool aDoReg)
{
// if we have no content, we can't do anything
if (!mContent)
@ -101,7 +100,7 @@ nsAreaFrame::RegUnregAccessKey(nsPresContext* aPresContext,
// With a valid PresContext we can get the ESM
// and register the access key
nsIEventStateManager *esm = aPresContext->EventStateManager();
nsIEventStateManager *esm = GetPresContext()->EventStateManager();
nsresult rv;
PRUint32 key = accessKey.First();
@ -128,16 +127,15 @@ nsAreaFrame::Init(nsIContent* aContent,
return rv;
// register access key
return RegUnregAccessKey(GetPresContext(), PR_TRUE);
return RegUnregAccessKey(PR_TRUE);
}
NS_IMETHODIMP
nsAreaFrame::Destroy(nsPresContext* aPresContext)
void
nsAreaFrame::Destroy()
{
// unregister access key
RegUnregAccessKey(aPresContext, PR_FALSE);
return nsBlockFrame::Destroy(aPresContext);
RegUnregAccessKey(PR_FALSE);
nsBlockFrame::Destroy();
}
NS_IMETHODIMP
@ -151,7 +149,7 @@ nsAreaFrame::AttributeChanged(PRInt32 aNameSpaceID,
// If the accesskey changed, register for the new value
// The old value has been unregistered in nsXULElement::SetAttr
if (aAttribute == nsXULAtoms::accesskey || aAttribute == nsXULAtoms::control)
RegUnregAccessKey(GetPresContext(), PR_TRUE);
RegUnregAccessKey(PR_TRUE);
return rv;
}

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

@ -65,7 +65,7 @@ public:
nsIFrame* aParent,
nsIFrame* aPrevInFlow);
NS_IMETHOD Destroy(nsPresContext* aPresContext);
virtual void Destroy();
NS_IMETHOD AttributeChanged(PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
@ -87,8 +87,7 @@ protected:
nsAreaFrame(nsStyleContext *aContext) : nsBlockFrame(aContext) {}
#ifdef MOZ_XUL
nsresult RegUnregAccessKey(nsPresContext* aPresContext,
PRBool aDoReg);
nsresult RegUnregAccessKey(PRBool aDoReg);
#endif
};

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

@ -282,34 +282,36 @@ nsBlockFrame::~nsBlockFrame()
{
}
NS_IMETHODIMP
nsBlockFrame::Destroy(nsPresContext* aPresContext)
void
nsBlockFrame::Destroy()
{
mAbsoluteContainer.DestroyFrames(this, aPresContext);
mAbsoluteContainer.DestroyFrames(this);
// Outside bullets are not in our child-list so check for them here
// and delete them when present.
if (mBullet && HaveOutsideBullet()) {
mBullet->Destroy(aPresContext);
mBullet->Destroy();
mBullet = nsnull;
}
mFloats.DestroyFrames(aPresContext);
mFloats.DestroyFrames();
nsPresContext* presContext = GetPresContext();
nsLineBox::DeleteLineList(aPresContext, mLines);
nsLineBox::DeleteLineList(presContext, mLines);
// destroy overflow lines now
nsLineList* overflowLines = RemoveOverflowLines();
if (overflowLines) {
nsLineBox::DeleteLineList(aPresContext, *overflowLines);
nsLineBox::DeleteLineList(presContext, *overflowLines);
}
{
nsAutoOOFFrameList oofs(this);
oofs.mList.DestroyFrames(aPresContext);
oofs.mList.DestroyFrames();
// oofs is now empty and will remove the frame list property
}
return nsBlockFrameSuper::Destroy(aPresContext);
nsBlockFrameSuper::Destroy();
}
NS_IMETHODIMP
@ -3259,7 +3261,7 @@ nsBlockFrame::UndoSplitPlaceholders(nsBlockReflowState& aState,
nsSplittableFrame::RemoveFromFlow(placeholder);
nsIFrame* savePlaceholder = placeholder;
placeholder = NS_STATIC_CAST(nsPlaceholderFrame*, placeholder->GetNextSibling());
savePlaceholder->Destroy(aState.mPresContext);
savePlaceholder->Destroy();
}
}
@ -5480,14 +5482,14 @@ nsBlockFrame::RemoveFloat(nsIFrame* aFloat) {
}
// Try to destroy if it's in mFloats.
if (mFloats.DestroyFrame(GetPresContext(), aFloat)) {
if (mFloats.DestroyFrame(aFloat)) {
return line;
}
// Try our overflow list
{
nsAutoOOFFrameList oofs(this);
if (oofs.mList.DestroyFrame(GetPresContext(), aFloat)) {
if (oofs.mList.DestroyFrame(aFloat)) {
return line_end;
}
}
@ -5495,7 +5497,7 @@ nsBlockFrame::RemoveFloat(nsIFrame* aFloat) {
// If this is during reflow, it could be the out-of-flow frame for a
// placeholder in our block reflow state's mOverflowPlaceholders. But that's
// OK; it's not part of any child list, so we can just go ahead and delete it.
aFloat->Destroy(GetPresContext());
aFloat->Destroy();
return line_end;
}
@ -5619,7 +5621,7 @@ nsBlockFrame::DoRemoveOutOfFlowFrame(nsIFrame* aFrame)
block->mAbsoluteContainer.RemoveFrame(block,
block->mAbsoluteContainer.GetChildListName(),
aFrame);
aFrame->Destroy(aFrame->GetPresContext());
aFrame->Destroy();
}
else {
// This also destroys the frame.
@ -5688,7 +5690,7 @@ nsBlockFrame::DoRemoveFrame(nsIFrame* aDeletedFrame, PRBool aDestroyFrames,
if (overflowPlaceholders && overflowPlaceholders->RemoveFrame(aDeletedFrame)) {
nsIFrame* nif = aDeletedFrame->GetNextInFlow();
if (aDestroyFrames) {
aDeletedFrame->Destroy(presContext);
aDeletedFrame->Destroy();
} else {
aDeletedFrame->SetNextSibling(nsnull);
}
@ -5782,7 +5784,7 @@ found_frame:;
printf(" prevSibling=%p deletedNextContinuation=%p\n", prevSibling, deletedNextContinuation);
#endif
if (aDestroyFrames) {
aDeletedFrame->Destroy(presContext);
aDeletedFrame->Destroy();
} else {
aDeletedFrame->SetNextSibling(nsnull);
}
@ -6713,23 +6715,23 @@ nsBlockFrame::Init(nsIContent* aContent,
}
NS_IMETHODIMP
nsBlockFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsBlockFrame::SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult rv = NS_OK;
if (mAbsoluteContainer.GetChildListName() == aListName) {
mAbsoluteContainer.SetInitialChildList(this, aPresContext, aListName, aChildList);
mAbsoluteContainer.SetInitialChildList(this, aListName, aChildList);
}
else if (nsLayoutAtoms::floatList == aListName) {
mFloats.SetFrames(aChildList);
}
else {
nsPresContext* presContext = GetPresContext();
// Lookup up the two pseudo style contexts
if (nsnull == GetPrevInFlow()) {
nsRefPtr<nsStyleContext> firstLetterStyle = GetFirstLetterStyle(aPresContext);
nsRefPtr<nsStyleContext> firstLetterStyle = GetFirstLetterStyle(presContext);
if (nsnull != firstLetterStyle) {
mState |= NS_BLOCK_HAS_FIRST_LETTER_STYLE;
#ifdef NOISY_FIRST_LETTER
@ -6765,7 +6767,7 @@ nsBlockFrame::SetInitialChildList(nsPresContext* aPresContext,
break;
}
nsIPresShell *shell = aPresContext->PresShell();
nsIPresShell *shell = presContext->PresShell();
nsRefPtr<nsStyleContext> kidSC = shell->StyleSet()->
ResolvePseudoStyleFor(mContent, pseudoElement, mStyleContext);

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

@ -146,8 +146,7 @@ public:
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsIFrame* aPrevInFlow);
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList);
NS_IMETHOD AppendFrames(nsIAtom* aListName,
nsIFrame* aFrameList);
@ -159,7 +158,7 @@ public:
virtual nsIFrame* GetFirstChild(nsIAtom* aListName) const;
NS_IMETHOD SetParent(const nsIFrame* aParent);
virtual nsIAtom* GetAdditionalChildListName(PRInt32 aIndex) const;
NS_IMETHOD Destroy(nsPresContext* aPresContext);
virtual void Destroy();
NS_IMETHOD IsSplittable(nsSplittableType& aIsSplittable) const;
virtual PRBool IsContainingBlock() const;
virtual PRBool IsFloatContainingBlock() const;

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

@ -92,8 +92,8 @@ nsBulletFrame::~nsBulletFrame()
{
}
NS_IMETHODIMP
nsBulletFrame::Destroy(nsPresContext* aPresContext)
void
nsBulletFrame::Destroy()
{
// Stop image loading first
if (mImageRequest) {
@ -105,7 +105,7 @@ nsBulletFrame::Destroy(nsPresContext* aPresContext)
NS_REINTERPRET_CAST(nsBulletListener*, mListener.get())->SetFrame(nsnull);
// Let base class do the rest
return nsFrame::Destroy(aPresContext);
nsFrame::Destroy();
}
#ifdef NS_DEBUG

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

@ -57,7 +57,7 @@ public:
virtual ~nsBulletFrame();
// nsIFrame
NS_IMETHOD Destroy(nsPresContext* aPresContext);
virtual void Destroy();
NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists);

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

@ -54,8 +54,7 @@ class nsColumnSetFrame : public nsHTMLContainerFrame {
public:
nsColumnSetFrame(nsStyleContext* aContext);
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList);
NS_IMETHOD Reflow(nsPresContext* aPresContext,
@ -169,15 +168,14 @@ nsColumnSetFrame::GetType() const
}
NS_IMETHODIMP
nsColumnSetFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
nsColumnSetFrame::SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList)
{
NS_ASSERTION(!aListName, "Only default child list supported");
NS_ASSERTION(aChildList && !aChildList->GetNextSibling(),
"initial child list must have exactly one child");
// Queue up the frames for the content frame
return nsHTMLContainerFrame::SetInitialChildList(aPresContext, nsnull, aChildList);
return nsHTMLContainerFrame::SetInitialChildList(nsnull, aChildList);
}
static nscoord GetAvailableContentWidth(const nsHTMLReflowState& aReflowState) {

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

@ -94,8 +94,7 @@ nsContainerFrame::Init(nsIContent* aContent,
}
NS_IMETHODIMP
nsContainerFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsContainerFrame::SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult result;
@ -136,8 +135,8 @@ CleanupGeneratedContentIn(nsIContent* aRealContent, nsIFrame* aRoot) {
} while (frameList);
}
NS_IMETHODIMP
nsContainerFrame::Destroy(nsPresContext* aPresContext)
void
nsContainerFrame::Destroy()
{
// Prevent event dispatch during destruction
if (HasView()) {
@ -153,16 +152,16 @@ nsContainerFrame::Destroy(nsPresContext* aPresContext)
// our kids are gone by the time that's called.
::CleanupGeneratedContentIn(mContent, this);
}
// Delete the primary child list
mFrames.DestroyFrames(aPresContext);
mFrames.DestroyFrames();
// Destroy overflow frames now
nsFrameList overflowFrames(GetOverflowFrames(aPresContext, PR_TRUE));
overflowFrames.DestroyFrames(aPresContext);
nsFrameList overflowFrames(GetOverflowFrames(GetPresContext(), PR_TRUE));
overflowFrames.DestroyFrames();
// Destroy the frame and remove the flow pointers
return nsSplittableFrame::Destroy(aPresContext);
nsSplittableFrame::Destroy();
}
/////////////////////////////////////////////////////////////////////////////
@ -908,7 +907,7 @@ nsContainerFrame::DeleteNextInFlowChild(nsPresContext* aPresContext,
}
// Delete the next-in-flow frame and its descendants.
aNextInFlow->Destroy(aPresContext);
aNextInFlow->Destroy();
NS_POSTCONDITION(!prevInFlow->GetNextInFlow(), "non null next-in-flow");
}
@ -937,7 +936,7 @@ DestroyOverflowFrames(void* aFrame,
if (aPropertyValue) {
nsFrameList frames((nsIFrame*)aPropertyValue);
frames.DestroyFrames(NS_STATIC_CAST(nsPresContext*, aDtorData));
frames.DestroyFrames();
}
}
@ -950,7 +949,7 @@ nsContainerFrame::SetOverflowFrames(nsPresContext* aPresContext,
nsLayoutAtoms::overflowProperty,
aOverflowFrames,
DestroyOverflowFrames,
aPresContext);
nsnull);
// Verify that we didn't overwrite an existing overflow list
NS_ASSERTION(rv != NS_PROPTABLE_PROP_OVERWRITTEN, "existing overflow list");

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

@ -60,12 +60,11 @@ public:
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsIFrame* aPrevInFlow);
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList);
virtual nsIFrame* GetFirstChild(nsIAtom* aListName) const;
virtual nsIAtom* GetAdditionalChildListName(PRInt32 aIndex) const;
NS_IMETHOD Destroy(nsPresContext* aPresContext);
virtual void Destroy();
NS_IMETHOD ReflowDirtyChild(nsIPresShell* aPresShell, nsIFrame* aChild);
virtual PRBool IsLeaf() const;

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

@ -58,8 +58,7 @@ public:
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsIFrame* aPrevInFlow);
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList);
#ifdef NS_DEBUG
NS_IMETHOD GetFrameName(nsAString& aResult) const;
@ -135,12 +134,11 @@ nsFirstLetterFrame::Init(nsIContent* aContent,
}
NS_IMETHODIMP
nsFirstLetterFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
nsFirstLetterFrame::SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList)
{
mFrames.SetFrames(aChildList);
nsFrameManager *frameManager = aPresContext->FrameManager();
nsFrameManager *frameManager = GetPresContext()->FrameManager();
for (nsIFrame* frame = aChildList; frame; frame = frame->GetNextSibling()) {
NS_ASSERTION(frame->GetParent() == this, "Unexpected parent");

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

@ -585,8 +585,7 @@ nsFrame::Init(nsIContent* aContent,
return NS_OK;
}
NS_IMETHODIMP nsFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
NS_IMETHODIMP nsFrame::SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList)
{
// XXX This shouldn't be getting called at all, but currently is for backwards
@ -625,14 +624,15 @@ nsFrame::RemoveFrame(nsIAtom* aListName,
return NS_ERROR_UNEXPECTED;
}
NS_IMETHODIMP
nsFrame::Destroy(nsPresContext* aPresContext)
void
nsFrame::Destroy()
{
// Get the view pointer now before the frame properties disappear
// when we call NotifyDestroyingFrame()
nsIView* view = GetView();
nsPresContext* presContext = GetPresContext();
nsIPresShell *shell = aPresContext->GetPresShell();
nsIPresShell *shell = presContext->GetPresShell();
if (shell) {
NS_ASSERTION(!(mState & NS_FRAME_OUT_OF_FLOW) ||
!shell->FrameManager()->GetPlaceholderFrameFor(this),
@ -648,7 +648,7 @@ nsFrame::Destroy(nsPresContext* aPresContext)
//XXX Why is this done in nsFrame instead of some frame class
// that actually loads images?
aPresContext->StopImagesFor(this);
presContext->StopImagesFor(this);
if (view) {
// Break association between view and frame
@ -666,8 +666,6 @@ nsFrame::Destroy(nsPresContext* aPresContext)
// recycler.
size_t* sz = (size_t*)this;
shell->FreeFrame(*sz, (void*)this);
return NS_OK;
}
NS_IMETHODIMP

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

@ -167,8 +167,7 @@ public:
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsIFrame* asPrevInFlow);
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList);
NS_IMETHOD AppendFrames(nsIAtom* aListName,
nsIFrame* aFrameList);
@ -177,7 +176,7 @@ public:
nsIFrame* aFrameList);
NS_IMETHOD RemoveFrame(nsIAtom* aListName,
nsIFrame* aOldFrame);
NS_IMETHOD Destroy(nsPresContext* aPresContext);
virtual void Destroy();
NS_IMETHOD CalcBorderPadding(nsMargin& aBorderPadding) const;
virtual nsStyleContext* GetAdditionalStyleContext(PRInt32 aIndex) const;
virtual void SetAdditionalStyleContext(PRInt32 aIndex,

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

@ -126,7 +126,7 @@ public:
nsIFrame* aParent,
nsIFrame* aPrevInFlow);
NS_IMETHOD Destroy(nsPresContext* aPresContext);
virtual void Destroy();
NS_IMETHOD Reflow(nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
@ -585,8 +585,8 @@ NS_NewSubDocumentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell) nsSubDocumentFrame(aContext);
}
NS_IMETHODIMP
nsSubDocumentFrame::Destroy(nsPresContext* aPresContext)
void
nsSubDocumentFrame::Destroy()
{
if (mFrameLoader && mDidCreateDoc) {
// Get the content viewer through the docshell, but don't call
@ -629,7 +629,7 @@ nsSubDocumentFrame::Destroy(nsPresContext* aPresContext)
mFrameLoader->Destroy();
}
return nsLeafFrame::Destroy(aPresContext);
nsLeafFrame::Destroy();
}
nsSize nsSubDocumentFrame::GetMargin()

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

@ -52,12 +52,12 @@
#endif // IBMBIDI
void
nsFrameList::DestroyFrames(nsPresContext* aPresContext)
nsFrameList::DestroyFrames()
{
nsIFrame* next;
for (nsIFrame* frame = mFirstChild; frame; frame = next) {
next = frame->GetNextSibling();
frame->Destroy(aPresContext);
frame->Destroy();
mFirstChild = next;
}
}
@ -148,11 +148,11 @@ nsFrameList::RemoveFirstChild()
}
PRBool
nsFrameList::DestroyFrame(nsPresContext* aPresContext, nsIFrame* aFrame)
nsFrameList::DestroyFrame(nsIFrame* aFrame)
{
NS_PRECONDITION(nsnull != aFrame, "null ptr");
if (RemoveFrame(aFrame)) {
aFrame->Destroy(aPresContext);
aFrame->Destroy();
return PR_TRUE;
}
return PR_FALSE;

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

@ -62,7 +62,7 @@ public:
~nsFrameList() {
}
void DestroyFrames(nsPresContext* aPresContext);
void DestroyFrames();
void SetFrames(nsIFrame* aFrameList) {
mFirstChild = aFrameList;
@ -95,7 +95,7 @@ public:
// Take aFrame out of the frame list and then destroy it. This also
// disconnects aFrame from the sibling list. This will return
// PR_FALSE if aFrame is nsnull or if aFrame is not in the list.
PRBool DestroyFrame(nsPresContext* aPresContext, nsIFrame* aFrame);
PRBool DestroyFrame(nsIFrame* aFrame);
void InsertFrame(nsIFrame* aParent,
nsIFrame* aPrevSibling,

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

@ -415,7 +415,7 @@ nsHTMLFramesetFrame::Init(nsIContent* aContent,
childFrame->SetParentBorderColor(borderColor);
result = frame->Init(child, this, nsnull);
if (NS_FAILED(result)) {
frame->Destroy(aPresContext);
frame->Destroy();
return result;
}
@ -427,7 +427,7 @@ nsHTMLFramesetFrame::Init(nsIContent* aContent,
result = frame->Init(child, this, nsnull);
if (NS_FAILED(result)) {
frame->Destroy(aPresContext);
frame->Destroy();
return result;
}
@ -468,7 +468,7 @@ nsHTMLFramesetFrame::Init(nsIContent* aContent,
result = blankFrame->Init(mContent, this, nsnull);
if (NS_FAILED(result)) {
blankFrame->Destroy(aPresContext);
blankFrame->Destroy();
return result;
}

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

@ -162,24 +162,22 @@ nsHTMLScrollFrame::CreateAnonymousContent(nsPresContext* aPresContext,
return NS_OK;
}
NS_IMETHODIMP
nsHTMLScrollFrame::Destroy(nsPresContext* aPresContext)
void
nsHTMLScrollFrame::Destroy()
{
nsIScrollableView *view = mInner.GetScrollableView();
NS_ASSERTION(view, "unexpected null pointer");
if (view)
view->RemoveScrollPositionListener(&mInner);
return nsHTMLContainerFrame::Destroy(aPresContext);
nsHTMLContainerFrame::Destroy();
}
NS_IMETHODIMP
nsHTMLScrollFrame::
SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult rv = nsHTMLContainerFrame::SetInitialChildList(aPresContext, aListName,
aChildList);
nsresult rv = nsHTMLContainerFrame::SetInitialChildList(aListName, aChildList);
mInner.CreateScrollableView();
mInner.ReloadChildFrames();
@ -1001,23 +999,21 @@ nsXULScrollFrame::CreateAnonymousContent(nsPresContext* aPresContext,
return NS_OK;
}
NS_IMETHODIMP
nsXULScrollFrame::Destroy(nsPresContext* aPresContext)
void
nsXULScrollFrame::Destroy()
{
nsIScrollableView *view = mInner.GetScrollableView();
NS_ASSERTION(view, "unexpected null pointer");
if (view)
view->RemoveScrollPositionListener(&mInner);
return nsBoxFrame::Destroy(aPresContext);
nsBoxFrame::Destroy();
}
NS_IMETHODIMP
nsXULScrollFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
nsXULScrollFrame::SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult rv = nsBoxFrame::SetInitialChildList(aPresContext, aListName,
aChildList);
nsresult rv = nsBoxFrame::SetInitialChildList(aListName, aChildList);
mInner.CreateScrollableView();
mInner.ReloadChildFrames();

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

@ -205,8 +205,7 @@ public:
// Called to set the child frames. We typically have three: the scroll area,
// the vertical scrollbar, and the horizontal scrollbar.
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList);
NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,
@ -241,7 +240,7 @@ public:
nsIFrame* aPrevFrame,
nsIFrame* aFrameList);
NS_IMETHOD Destroy(nsPresContext* aPresContext);
virtual void Destroy();
NS_IMETHOD RemoveFrame(nsIAtom* aListName,
nsIFrame* aOldFrame);
@ -354,8 +353,7 @@ public:
// Called to set the child frames. We typically have three: the scroll area,
// the vertical scrollbar, and the horizontal scrollbar.
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList);
NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,
@ -377,7 +375,7 @@ public:
nsIFrame* aPrevFrame,
nsIFrame* aFrameList);
NS_IMETHOD Destroy(nsPresContext* aPresContext);
virtual void Destroy();
NS_IMETHOD RemoveFrame(nsIAtom* aListName,
nsIFrame* aOldFrame);

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

@ -97,7 +97,7 @@ public:
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsIFrame* aPrevInFlow);
NS_IMETHOD Destroy(nsPresContext* aPresContext);
virtual void Destroy();
NS_IMETHOD AppendFrames(nsIAtom* aListName,
nsIFrame* aFrameList);
@ -205,8 +205,8 @@ CanvasFrame::Init(nsIContent* aContent,
return rv;
}
NS_IMETHODIMP
CanvasFrame::Destroy(nsPresContext* aPresContext)
void
CanvasFrame::Destroy()
{
nsIScrollableView* scrollingView = nsnull;
mViewManager->GetRootScrollableView(&scrollingView);
@ -214,7 +214,7 @@ CanvasFrame::Destroy(nsPresContext* aPresContext)
scrollingView->RemoveScrollPositionListener(this);
}
return nsHTMLContainerFrame::Destroy(aPresContext);
nsHTMLContainerFrame::Destroy();
}
NS_IMETHODIMP
@ -333,7 +333,7 @@ CanvasFrame::RemoveFrame(nsIAtom* aListName,
Invalidate(aOldFrame->GetOverflowRect() + aOldFrame->GetPosition(), PR_FALSE);
// Remove the frame and destroy it
mFrames.DestroyFrame(GetPresContext(), aOldFrame);
mFrames.DestroyFrame(aOldFrame);
// Generate a reflow command so we get reflowed
rv = GetPresContext()->PresShell()->

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

@ -427,12 +427,12 @@ public:
* Destroys this frame and each of its child frames (recursively calls
* Destroy() for each child)
*/
NS_IMETHOD Destroy(nsPresContext* aPresContext) = 0;
virtual void Destroy() = 0;
/*
* Notify the frame that it has been removed as the primary frame for its content
*/
virtual void RemovedAsPrimaryFrame(nsPresContext* aPresContext) {}
virtual void RemovedAsPrimaryFrame() {}
/**
* Called to set the initial list of frames. This happens after the frame
@ -452,8 +452,7 @@ public:
* NS_OK otherwise
* @see #Init()
*/
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList) = 0;
/**

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

@ -240,8 +240,8 @@ NS_IMETHODIMP_(nsrefcnt) nsImageFrame::Release(void)
return 1;
}
NS_IMETHODIMP
nsImageFrame::Destroy(nsPresContext* aPresContext)
void
nsImageFrame::Destroy()
{
// Tell our image map, if there is one, to clean up
// This causes the nsImageMap to unregister itself as
@ -263,7 +263,7 @@ nsImageFrame::Destroy(nsPresContext* aPresContext)
mListener = nsnull;
return nsSplittableFrame::Destroy(aPresContext);
nsSplittableFrame::Destroy();
}

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

@ -92,7 +92,7 @@ public:
// nsISupports
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
NS_IMETHOD Destroy(nsPresContext* aPresContext);
virtual void Destroy();
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsIFrame* aPrevInFlow);

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

@ -252,7 +252,7 @@ nsInlineFrame::RemoveFrame(nsIAtom* aListName,
// remove the frame from its parents list and generate a reflow
// command.
nsIFrame* oldFrameNextContinuation = aOldFrame->GetNextContinuation();
parent->mFrames.DestroyFrame(GetPresContext(), aOldFrame);
parent->mFrames.DestroyFrame(aOldFrame);
aOldFrame = oldFrameNextContinuation;
if (aOldFrame) {
parent = NS_STATIC_CAST(nsInlineFrame*, aOldFrame->GetParent());
@ -1011,24 +1011,23 @@ NS_NewPositionedInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell) nsPositionedInlineFrame(aContext);
}
NS_IMETHODIMP
nsPositionedInlineFrame::Destroy(nsPresContext* aPresContext)
void
nsPositionedInlineFrame::Destroy()
{
mAbsoluteContainer.DestroyFrames(this, aPresContext);
return nsInlineFrame::Destroy(aPresContext);
mAbsoluteContainer.DestroyFrames(this);
nsInlineFrame::Destroy();
}
NS_IMETHODIMP
nsPositionedInlineFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsPositionedInlineFrame::SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult rv;
if (mAbsoluteContainer.GetChildListName() == aListName) {
rv = mAbsoluteContainer.SetInitialChildList(this, aPresContext, aListName, aChildList);
rv = mAbsoluteContainer.SetInitialChildList(this, aListName, aChildList);
} else {
rv = nsInlineFrame::SetInitialChildList(aPresContext, aListName, aChildList);
rv = nsInlineFrame::SetInitialChildList(aListName, aChildList);
}
return rv;

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

@ -200,10 +200,9 @@ public:
virtual ~nsPositionedInlineFrame() { } // useful for debugging
NS_IMETHOD Destroy(nsPresContext* aPresContext);
virtual void Destroy();
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList);
NS_IMETHOD AppendFrames(nsIAtom* aListName,
nsIFrame* aFrameList);

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

@ -343,7 +343,7 @@ nsLineBox::DeleteLineList(nsPresContext* aPresContext, nsLineList& aLines)
// view.
for (nsIFrame* child = aLines.front()->mFirstChild; child; ) {
nsIFrame* nextChild = child->GetNextSibling();
child->Destroy(aPresContext);
child->Destroy();
child = nextChild;
}

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

@ -482,8 +482,8 @@ nsObjectFrame::Init(nsIContent* aContent,
return rv;
}
NS_IMETHODIMP
nsObjectFrame::Destroy(nsPresContext* aPresContext)
void
nsObjectFrame::Destroy()
{
NS_ASSERTION(!mInstantiating, "about to crash due to bug 136927");
@ -491,7 +491,7 @@ nsObjectFrame::Destroy(nsPresContext* aPresContext)
// doing this in the destructor is too late.
StopPlugin();
return nsObjectFrameSuper::Destroy(aPresContext);
nsObjectFrameSuper::Destroy();
}
nsIAtom*

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

@ -93,7 +93,7 @@ public:
NS_IMETHOD GetFrameName(nsAString& aResult) const;
#endif
NS_IMETHOD Destroy(nsPresContext* aPresContext);
virtual void Destroy();
NS_IMETHOD GetPluginInstance(nsIPluginInstance*& aPluginInstance);
virtual nsresult Instantiate(nsIChannel* aChannel, nsIStreamListener** aStreamListener);

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

@ -112,19 +112,18 @@ nsPageFrame::~nsPageFrame()
NS_IMETHODIMP
nsPageFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
nsPageFrame::SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList)
{
nsIView* view = aChildList->GetView();
if (view && mDoCreateWidget) {
if (aPresContext->Type() == nsPresContext::eContext_PrintPreview &&
if (GetPresContext()->Type() == nsPresContext::eContext_PrintPreview &&
view->GetNearestWidget(nsnull)) {
view->CreateWidget(kCChildCID);
}
}
return nsContainerFrame::SetInitialChildList(aPresContext, aListName, aChildList);
return nsContainerFrame::SetInitialChildList(aListName, aChildList);
}
NS_IMETHODIMP nsPageFrame::Reflow(nsPresContext* aPresContext,

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

@ -50,8 +50,7 @@ public:
friend nsIFrame* NS_NewPageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
// nsIFrame
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList);
NS_IMETHOD Reflow(nsPresContext* aPresContext,

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

@ -80,16 +80,16 @@ nsPlaceholderFrame::Reflow(nsPresContext* aPresContext,
return NS_OK;
}
NS_IMETHODIMP
nsPlaceholderFrame::Destroy(nsPresContext* aPresContext)
void
nsPlaceholderFrame::Destroy()
{
nsIPresShell* shell = aPresContext->GetPresShell();
nsIPresShell* shell = GetPresContext()->GetPresShell();
if (shell && mOutOfFlowFrame) {
NS_ASSERTION(!shell->FrameManager()->GetPlaceholderFrameFor(mOutOfFlowFrame),
"Placeholder relationship should have been torn down");
}
return nsSplittableFrame::Destroy(aPresContext);
nsSplittableFrame::Destroy();
}
nsIAtom*

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

@ -71,7 +71,7 @@ public:
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD Destroy(nsPresContext* aPresContext);
virtual void Destroy();
// nsIFrame overrides
#ifdef DEBUG

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

@ -61,8 +61,8 @@ nsSplittableFrame::Init(nsIContent* aContent,
return rv;
}
NS_IMETHODIMP
nsSplittableFrame::Destroy(nsPresContext* aPresContext)
void
nsSplittableFrame::Destroy()
{
// Disconnect from the flow list
if (mPrevContinuation || mNextContinuation) {
@ -70,7 +70,7 @@ nsSplittableFrame::Destroy(nsPresContext* aPresContext)
}
// Let the base class destroy the frame
return nsFrame::Destroy(aPresContext);
nsFrame::Destroy();
}
NS_IMETHODIMP

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

@ -55,7 +55,7 @@ public:
NS_IMETHOD IsSplittable(nsSplittableType& aIsSplittable) const;
NS_IMETHOD Destroy(nsPresContext* aPresContext);
virtual void Destroy();
/*
* Frame continuations can be either fluid or not:

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

@ -262,7 +262,7 @@ public:
void PaintText(nsIRenderingContext& aRenderingContext, nsPoint aPt);
NS_IMETHOD Destroy(nsPresContext* aPresContext);
virtual void Destroy();
NS_IMETHOD GetCursor(const nsPoint& aPoint,
nsIFrame::Cursor& aCursor);
@ -1391,14 +1391,14 @@ NS_IMETHODIMP nsTextFrame::GetAccessible(nsIAccessible** aAccessible)
//-----------------------------------------------------------------------------
NS_IMETHODIMP
nsTextFrame::Destroy(nsPresContext* aPresContext)
void
nsTextFrame::Destroy()
{
if (mNextContinuation) {
mNextContinuation->SetPrevInFlow(nsnull);
}
// Let the base class destroy the frame
return nsFrame::Destroy(aPresContext);
nsFrame::Destroy();
}
class nsContinuingTextFrame : public nsTextFrame {
@ -1409,7 +1409,7 @@ public:
nsIFrame* aParent,
nsIFrame* aPrevInFlow);
NS_IMETHOD Destroy(nsPresContext* aPresContext);
virtual void Destroy();
virtual nsIFrame* GetPrevContinuation() const {
return mPrevContinuation;
@ -1485,14 +1485,14 @@ nsContinuingTextFrame::Init(nsIContent* aContent,
return rv;
}
NS_IMETHODIMP
nsContinuingTextFrame::Destroy(nsPresContext* aPresContext)
void
nsContinuingTextFrame::Destroy()
{
if (mPrevContinuation || mNextContinuation) {
nsSplittableFrame::RemoveFromFlow(this);
}
// Let the base class destroy the frame
return nsFrame::Destroy(aPresContext);
nsFrame::Destroy();
}
nsIFrame*

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

@ -57,16 +57,15 @@ NS_NewViewportFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell) ViewportFrame(aContext);
}
NS_IMETHODIMP
ViewportFrame::Destroy(nsPresContext* aPresContext)
void
ViewportFrame::Destroy()
{
mFixedContainer.DestroyFrames(this, aPresContext);
return nsContainerFrame::Destroy(aPresContext);
mFixedContainer.DestroyFrames(this);
nsContainerFrame::Destroy();
}
NS_IMETHODIMP
ViewportFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
ViewportFrame::SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult rv = NS_OK;
@ -76,10 +75,10 @@ ViewportFrame::SetInitialChildList(nsPresContext* aPresContext,
nsFrame::VerifyDirtyBitSet(aChildList);
#endif
if (mFixedContainer.GetChildListName() == aListName) {
rv = mFixedContainer.SetInitialChildList(this, aPresContext, aListName, aChildList);
rv = mFixedContainer.SetInitialChildList(this, aListName, aChildList);
}
else {
rv = nsContainerFrame::SetInitialChildList(aPresContext, aListName, aChildList);
rv = nsContainerFrame::SetInitialChildList(aListName, aChildList);
}
return rv;

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

@ -70,10 +70,9 @@ public:
ViewportFrame(nsStyleContext* aContext) : nsContainerFrame(aContext) {}
virtual ~ViewportFrame() { } // useful for debugging
NS_IMETHOD Destroy(nsPresContext* aPresContext);
virtual void Destroy();
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList);
NS_IMETHOD AppendFrames(nsIAtom* aListName,

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

@ -758,20 +758,6 @@ nsMathMLContainerFrame::Init(nsIContent* aContent,
// tree is constructed.
}
// This method is called in a bottom-up manner, as we ascend the frame tree
// after its construction
NS_IMETHODIMP
nsMathMLContainerFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
{
// let the base class do its job
return nsHTMLContainerFrame::SetInitialChildList(aPresContext, aListName, aChildList);
// ...We will build our automatic MathML data once the entire <math>...</math>
// tree is constructed.
}
// Note that this method re-builds the automatic data in the children -- not
// in aParentFrame itself (except for those particular operations that the
// parent frame may do in its TransmitAutomaticData()).
@ -928,7 +914,7 @@ nsMathMLContainerFrame::RemoveFrame(nsIAtom* aListName,
return NS_ERROR_INVALID_ARG;
}
// remove the child frame
mFrames.DestroyFrame(GetPresContext(), aOldFrame);
mFrames.DestroyFrame(aOldFrame);
return ChildListChanged(nsIDOMMutationEvent::REMOVAL);
}

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

@ -124,11 +124,6 @@ public:
nsIFrame* aParent,
nsIFrame* aPrevInFlow);
NS_IMETHOD
SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList);
NS_IMETHOD
AppendFrames(nsIAtom* aListName,
nsIFrame* aFrameList);
@ -320,13 +315,12 @@ public:
// beware, mFrames is not set by nsBlockFrame
// cannot use mFrames{.FirstChild()|.etc} since the block code doesn't set mFrames
NS_IMETHOD
SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult rv = nsBlockFrame::SetInitialChildList(aPresContext, aListName, aChildList);
nsresult rv = nsBlockFrame::SetInitialChildList(aListName, aChildList);
// re-resolve our subtree to set any mathml-expected data
nsMathMLContainerFrame::MapAttributesIntoCSS(aPresContext, this);
nsMathMLContainerFrame::MapAttributesIntoCSS(GetPresContext(), this);
nsMathMLContainerFrame::RebuildAutomaticDataForChildren(this);
return rv;
}
@ -396,13 +390,12 @@ public:
friend nsIFrame* NS_NewMathMLmathInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
NS_IMETHOD
SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult rv = nsInlineFrame::SetInitialChildList(aPresContext, aListName, aChildList);
nsresult rv = nsInlineFrame::SetInitialChildList(aListName, aChildList);
// re-resolve our subtree to set any mathml-expected data
nsMathMLContainerFrame::MapAttributesIntoCSS(aPresContext, this);
nsMathMLContainerFrame::MapAttributesIntoCSS(GetPresContext(), this);
nsMathMLContainerFrame::RebuildAutomaticDataForChildren(this);
return rv;
}

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

@ -78,11 +78,10 @@ public:
#ifdef NS_DEBUG
NS_IMETHOD
SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult rv = nsBlockFrame::SetInitialChildList(aPresContext, aListName, aChildList);
nsresult rv = nsBlockFrame::SetInitialChildList(aListName, aChildList);
// cannot use mFrames{.FirstChild()|.etc} since the block code doesn't set mFrames
nsFrameList frameList(aChildList);
NS_ASSERTION(frameList.FirstChild() && frameList.GetLength() == 1,

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

@ -111,12 +111,11 @@ nsMathMLTokenFrame::Init(nsIContent* aContent,
}
NS_IMETHODIMP
nsMathMLTokenFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsMathMLTokenFrame::SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList)
{
// First, let the base class do its work
nsresult rv = nsMathMLContainerFrame::SetInitialChildList(aPresContext, aListName, aChildList);
nsresult rv = nsMathMLContainerFrame::SetInitialChildList(aListName, aChildList);
if (NS_FAILED(rv))
return rv;
@ -130,8 +129,10 @@ nsMathMLTokenFrame::SetInitialChildList(nsPresContext* aPresContext,
childFrame = childFrame->GetNextSibling();
}
SetQuotes(aPresContext);
ProcessTextData(aPresContext);
nsPresContext* presContext = GetPresContext();
SetQuotes(presContext);
ProcessTextData(presContext);
return rv;
}

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

@ -57,8 +57,7 @@ public:
nsIFrame* aPrevInFlow);
NS_IMETHOD
SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList);
NS_IMETHOD

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

@ -225,11 +225,10 @@ nsMathMLmactionFrame::GetSelectedFrame()
}
NS_IMETHODIMP
nsMathMLmactionFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsMathMLmactionFrame::SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult rv = nsMathMLContainerFrame::SetInitialChildList(aPresContext, aListName, aChildList);
nsresult rv = nsMathMLContainerFrame::SetInitialChildList(aListName, aChildList);
// This very first call to GetSelectedFrame() will cause us to be marked as an
// embellished operator if the selected child is an embellished operator

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

@ -66,8 +66,7 @@ public:
nsIFrame* aPrevInFlow);
NS_IMETHOD
SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList);
virtual nsresult

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

@ -76,18 +76,17 @@ nsMathMLmfencedFrame::InheritAutomaticData(nsIFrame* aParent)
}
NS_IMETHODIMP
nsMathMLmfencedFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsMathMLmfencedFrame::SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList)
{
// First, let the base class do its work
nsresult rv = nsMathMLContainerFrame::SetInitialChildList(aPresContext, aListName, aChildList);
nsresult rv = nsMathMLContainerFrame::SetInitialChildList(aListName, aChildList);
if (NS_FAILED(rv)) return rv;
// No need to tract the style contexts given to our MathML chars.
// The Style System will use Get/SetAdditionalStyleContext() to keep them
// up-to-date if dynamic changes arise.
return CreateFencesAndSeparators(aPresContext);
return CreateFencesAndSeparators(GetPresContext());
}
NS_IMETHODIMP

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

@ -60,8 +60,7 @@ public:
InheritAutomaticData(nsIFrame* aParent);
NS_IMETHOD
SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList);
NS_IMETHOD

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

@ -144,7 +144,7 @@ nsSVGDefsFrame::RemoveFrame(nsIAtom* aListName,
if (SVGFrame)
dirty_region = SVGFrame->GetCoveredRegion();
PRBool result = mFrames.DestroyFrame(GetPresContext(), aOldFrame);
PRBool result = mFrames.DestroyFrame(aOldFrame);
nsISVGOuterSVGFrame* outerSVGFrame = nsSVGUtils::GetOuterSVGFrame(this);
NS_ASSERTION(outerSVGFrame, "no outer svg frame");

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

@ -136,7 +136,7 @@ nsSVGGenericContainerFrame::RemoveFrame(nsIAtom* aListName,
if (SVGFrame)
dirty_region = SVGFrame->GetCoveredRegion();
PRBool result = mFrames.DestroyFrame(GetPresContext(), aOldFrame);
PRBool result = mFrames.DestroyFrame(aOldFrame);
nsISVGOuterSVGFrame* outerSVGFrame = nsSVGUtils::GetOuterSVGFrame(this);
NS_ASSERTION(outerSVGFrame, "no outer svg frame");

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

@ -402,7 +402,7 @@ nsSVGGradientFrame::RemoveFrame(nsIAtom* aListName,
nsIFrame* aOldFrame)
{
WillModify();
PRBool result = mFrames.DestroyFrame(GetPresContext(), aOldFrame);
PRBool result = mFrames.DestroyFrame(aOldFrame);
DidModify();
return result ? NS_OK : NS_ERROR_FAILURE;
}

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

@ -288,7 +288,7 @@ nsSVGInnerSVGFrame::RemoveFrame(nsIAtom* aListName,
if (SVGFrame)
dirty_region = SVGFrame->GetCoveredRegion();
PRBool result = mFrames.DestroyFrame(GetPresContext(), aOldFrame);
PRBool result = mFrames.DestroyFrame(aOldFrame);
nsISVGOuterSVGFrame* outerSVGFrame = nsSVGUtils::GetOuterSVGFrame(this);
NS_ASSERTION(outerSVGFrame, "no outer svg frame");

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

@ -577,7 +577,7 @@ nsSVGOuterSVGFrame::RemoveFrame(nsIAtom* aListName,
if (SVGFrame)
dirty_region = SVGFrame->GetCoveredRegion();
PRBool result = mFrames.DestroyFrame(GetPresContext(), aOldFrame);
PRBool result = mFrames.DestroyFrame(aOldFrame);
if (dirty_region)
InvalidateRegion(dirty_region, PR_TRUE);

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

@ -152,7 +152,7 @@ nsSVGTSpanFrame::RemoveFrame(nsIAtom* aListName,
if (SVGFrame)
dirty_region = SVGFrame->GetCoveredRegion();
PRBool result = mFrames.DestroyFrame(GetPresContext(), aOldFrame);
PRBool result = mFrames.DestroyFrame(aOldFrame);
nsISVGOuterSVGFrame* outerSVGFrame = nsSVGUtils::GetOuterSVGFrame(this);
NS_ASSERTION(outerSVGFrame, "no outer svg frame");

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

@ -355,7 +355,7 @@ nsSVGTextFrame::RemoveFrame(nsIAtom* aListName,
if (SVGFrame)
dirty_region = SVGFrame->GetCoveredRegion();
PRBool result = mFrames.DestroyFrame(GetPresContext(), aOldFrame);
PRBool result = mFrames.DestroyFrame(aOldFrame);
nsISVGOuterSVGFrame* outerSVGFrame = nsSVGUtils::GetOuterSVGFrame(this);
NS_ASSERTION(outerSVGFrame, "no outer svg frame");

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

@ -173,8 +173,7 @@ nsTableColGroupFrame::GetLastRealColGroup(nsTableFrame* aTableFrame,
// don't set mColCount here, it is done in AddColsToTable
NS_IMETHODIMP
nsTableColGroupFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsTableColGroupFrame::SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList)
{
if (!mFrames.IsEmpty()) {
@ -197,7 +196,7 @@ nsTableColGroupFrame::SetInitialChildList(nsPresContext* aPresContext,
tableFrame->CreateAnonymousColFrames(this, GetSpan(), eColAnonymousColGroup,
PR_FALSE, nsnull, &firstChild);
if (firstChild) {
SetInitialChildList(aPresContext, aListName, firstChild);
SetInitialChildList(aListName, firstChild);
}
return NS_OK;
}
@ -281,7 +280,7 @@ nsTableColGroupFrame::RemoveChild(nsTableColFrame& aChild,
colIndex = aChild.GetColIndex();
nextChild = aChild.GetNextSibling();
}
if (mFrames.DestroyFrame(GetPresContext(), (nsIFrame*)&aChild)) {
if (mFrames.DestroyFrame((nsIFrame*)&aChild)) {
mColCount--;
if (aResetSubsequentColIndices) {
if (nextChild) { // reset inside this and all following colgroups
@ -327,7 +326,7 @@ nsTableColGroupFrame::RemoveFrame(nsIAtom* aListName,
nsTableFrame::AppendDirtyReflowCommand(tableFrame);
}
else {
mFrames.DestroyFrame(GetPresContext(), aOldFrame);
mFrames.DestroyFrame(aOldFrame);
}
return NS_OK;

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

@ -79,8 +79,7 @@ public:
/** Initialize the colgroup frame with a set of children.
* @see nsIFrame::SetInitialChildList
*/
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList);
/**

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

@ -301,11 +301,11 @@ nsTableFrame::~nsTableFrame()
#endif
}
NS_IMETHODIMP
nsTableFrame::Destroy(nsPresContext* aPresContext)
void
nsTableFrame::Destroy()
{
mColGroups.DestroyFrames(aPresContext);
return nsHTMLContainerFrame::Destroy(aPresContext);
mColGroups.DestroyFrames();
nsHTMLContainerFrame::Destroy();
}
nscoord
@ -385,8 +385,7 @@ nsTableFrame::PageBreakAfter(nsIFrame& aSourceFrame,
// XXX this needs to be cleaned up so that the frame constructor breaks out col group
// frames into a separate child list.
NS_IMETHODIMP
nsTableFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsTableFrame::SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList)
{
@ -722,7 +721,7 @@ void nsTableFrame::InsertCol(nsTableColFrame& aColFrame,
}
// remove the col group if it is empty
if (lastColGroup->GetColCount() <= 0) {
mColGroups.DestroyFrame(GetPresContext(), (nsIFrame*)lastColGroup);
mColGroups.DestroyFrame((nsIFrame*)lastColGroup);
}
removedFromCache = PR_TRUE;
}
@ -937,7 +936,7 @@ nsTableFrame::CreateAnonymousColFrames(nsTableColGroupFrame* aColGroupFrame,
nsIFrame* colFrame = NS_NewTableColFrame(shell, styleContext);
((nsTableColFrame *) colFrame)->SetColType(aColType);
colFrame->Init(iContent, aColGroupFrame, nsnull);
colFrame->SetInitialChildList(presContext, nsnull, nsnull);
colFrame->SetInitialChildList(nsnull, nsnull);
// Add the col to the sibling chain
if (lastColFrame) {
@ -2491,7 +2490,7 @@ nsTableFrame::RemoveFrame(nsIAtom* aListName,
nsTableColGroupFrame* colGroup = (nsTableColGroupFrame*)aOldFrame;
PRInt32 firstColIndex = colGroup->GetStartColumnIndex();
PRInt32 lastColIndex = firstColIndex + colGroup->GetColCount() - 1;
mColGroups.DestroyFrame(GetPresContext(), aOldFrame);
mColGroups.DestroyFrame(aOldFrame);
nsTableColGroupFrame::ResetColIndices(nextColGroupFrame, firstColIndex);
// remove the cols from the table
PRInt32 colX;
@ -2536,14 +2535,14 @@ nsTableFrame::RemoveFrame(nsIAtom* aListName,
AdjustRowIndices(startRowIndex, -numRows);
// remove the row group frame from the sibling chain
mFrames.DestroyFrame(GetPresContext(), aOldFrame);
mFrames.DestroyFrame(aOldFrame);
// XXX This could probably be optimized with much effort
SetNeedStrategyInit(PR_TRUE);
AppendDirtyReflowCommand(this);
} else {
// Just remove the frame
mFrames.DestroyFrame(GetPresContext(), aOldFrame);
mFrames.DestroyFrame(aOldFrame);
return NS_OK;
}
}

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

@ -239,7 +239,7 @@ public:
nsIAtom* aAttribute);
/** @see nsIFrame::Destroy */
NS_IMETHOD Destroy(nsPresContext* aPresContext);
virtual void Destroy();
NS_IMETHOD AppendFrames(nsIAtom* aListName,
nsIFrame* aFrameList);
@ -286,8 +286,7 @@ public:
/** Initialize the table frame with a set of children.
* @see nsIFrame::SetInitialChildList
*/
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList);
/** return the first child belonging to the list aListName.

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

@ -72,11 +72,11 @@ nsTableCaptionFrame::~nsTableCaptionFrame()
{
}
NS_IMETHODIMP
nsTableOuterFrame::Destroy(nsPresContext* aPresContext)
void
nsTableOuterFrame::Destroy()
{
mCaptionFrames.DestroyFrames(aPresContext);
return nsHTMLContainerFrame::Destroy(aPresContext);
mCaptionFrames.DestroyFrames();
nsHTMLContainerFrame::Destroy();
}
nsIAtom*
@ -182,8 +182,7 @@ nsTableOuterFrame::GetAdditionalChildListName(PRInt32 aIndex) const
}
NS_IMETHODIMP
nsTableOuterFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsTableOuterFrame::SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList)
{
if (nsLayoutAtoms::captionList == aListName) {
@ -269,7 +268,7 @@ nsTableOuterFrame::RemoveFrame(nsIAtom* aListName,
}
// Remove the frame and destroy it
mCaptionFrames.DestroyFrame(GetPresContext(), aOldFrame);
mCaptionFrames.DestroyFrame(aOldFrame);
mCaptionFrame = mCaptionFrames.FirstChild();
mMinCaptionWidth = 0;
@ -2093,7 +2092,7 @@ void nsTableOuterFrame::DeleteChildsNextInFlow(nsPresContext* aPresContext,
}
// Delete the next-in-flow frame and adjust its parent's child count
nextInFlow->Destroy(aPresContext);
nextInFlow->Destroy();
NS_POSTCONDITION(!aChild->GetNextInFlow(), "non null next-in-flow");
}

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

@ -91,12 +91,11 @@ public:
nsIFrame* aParent,
nsIFrame* aPrevInFlow);
NS_IMETHOD Destroy(nsPresContext* aPresContext);
virtual void Destroy();
virtual PRBool IsContainingBlock() const;
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList);
virtual nsIFrame* GetFirstChild(nsIAtom* aListName) const;

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

@ -287,7 +287,7 @@ nsTableRowFrame::RemoveFrame(nsIAtom* aListName,
tableFrame->SetNeedStrategyInit(PR_TRUE);
// Remove the frame and destroy it
mFrames.DestroyFrame(GetPresContext(), aOldFrame);
mFrames.DestroyFrame(aOldFrame);
// XXX This could probably be optimized with much effort
tableFrame->SetNeedStrategyInit(PR_TRUE);

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

@ -978,7 +978,7 @@ nsTableRowGroupFrame::UndoContinuedRow(nsPresContext* aPresContext,
// Destroy the row, its cells, and their cell blocks. Cell blocks that have split
// will not have reflowed yet to pick up content from any overflow lines.
aRow->Destroy(aPresContext);
aRow->Destroy();
}
static nsTableRowFrame*
@ -1460,7 +1460,7 @@ nsTableRowGroupFrame::RemoveFrame(nsIAtom* aListName,
nsTableFrame::AppendDirtyReflowCommand(this);
}
}
mFrames.DestroyFrame(GetPresContext(), aOldFrame);
mFrames.DestroyFrame(aOldFrame);
return NS_OK;
}

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

@ -184,14 +184,13 @@ nsBoxFrame::GetHAlign(Halignment& aAlign)
}
NS_IMETHODIMP
nsBoxFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsBoxFrame::SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult r = nsContainerFrame::SetInitialChildList(aPresContext, aListName, aChildList);
nsresult r = nsContainerFrame::SetInitialChildList(aListName, aChildList);
if (r == NS_OK) {
// initialize our list of infos.
nsBoxLayoutState state(aPresContext->PresShell());
nsBoxLayoutState state(GetPresContext()->PresShell());
CheckBoxOrder(state);
if (mLayoutManager)
mLayoutManager->ChildrenSet(this, state, mFrames.FirstChild());
@ -226,13 +225,11 @@ nsBoxFrame::Init(nsIContent* aContent,
}
CacheAttributes();
nsPresContext *aPresContext = GetPresContext();
#ifdef DEBUG_LAYOUT
// if we are root and this
if (mState & NS_STATE_IS_ROOT)
GetDebugPref(aPresContext);
GetDebugPref(GetPresContext());
#endif
mMouseThrough = unset;
@ -240,7 +237,7 @@ nsBoxFrame::Init(nsIContent* aContent,
UpdateMouseThrough();
// register access key
rv = RegUnregAccessKey(aPresContext, PR_TRUE);
rv = RegUnregAccessKey(PR_TRUE);
return rv;
}
@ -1073,16 +1070,16 @@ nsBoxFrame::DoLayout(nsBoxLayoutState& aState)
return rv;
}
NS_IMETHODIMP
nsBoxFrame::Destroy(nsPresContext* aPresContext)
void
nsBoxFrame::Destroy()
{
// unregister access key
RegUnregAccessKey(aPresContext, PR_FALSE);
RegUnregAccessKey(PR_FALSE);
// clean up the container box's layout manager and child boxes
SetLayoutManager(nsnull);
return nsContainerFrame::Destroy(aPresContext);
nsContainerFrame::Destroy();
}
#ifdef DEBUG_LAYOUT
@ -1138,7 +1135,7 @@ nsBoxFrame::RemoveFrame(nsIAtom* aListName,
mLayoutManager->ChildrenRemoved(this, state, aOldFrame);
// destroy the child frame
aOldFrame->Destroy(presContext);
aOldFrame->Destroy();
// mark us dirty and generate a reflow command
MarkDirtyChildren(state);
@ -1334,7 +1331,7 @@ nsBoxFrame::AttributeChanged(PRInt32 aNameSpaceID,
// If the accesskey changed, register for the new value
// The old value has been unregistered in nsXULElement::SetAttr
else if (aAttribute == nsXULAtoms::accesskey) {
RegUnregAccessKey(GetPresContext(), PR_TRUE);
RegUnregAccessKey(PR_TRUE);
}
return rv;
@ -2159,7 +2156,7 @@ nsBoxFrame::CreateViewForFrame(nsPresContext* aPresContext,
// If you make changes to this function, check its counterparts
// in nsTextBoxFrame and nsAreaFrame
nsresult
nsBoxFrame::RegUnregAccessKey(nsPresContext* aPresContext, PRBool aDoReg)
nsBoxFrame::RegUnregAccessKey(PRBool aDoReg)
{
// if we have no content, we can't do anything
if (!mContent)
@ -2186,7 +2183,7 @@ nsBoxFrame::RegUnregAccessKey(nsPresContext* aPresContext, PRBool aDoReg)
// With a valid PresContext we can get the ESM
// and register the access key
nsIEventStateManager *esm = aPresContext->EventStateManager();
nsIEventStateManager *esm = GetPresContext()->EventStateManager();
nsresult rv;

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

@ -150,8 +150,7 @@ public:
NS_IMETHOD RemoveFrame(nsIAtom* aListName,
nsIFrame* aOldFrame);
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList);
virtual nsIAtom* GetType() const;
@ -232,7 +231,7 @@ protected:
virtual PRBool GetInitialVAlignment(Valignment& aValign);
virtual PRBool GetInitialAutoStretch(PRBool& aStretch);
NS_IMETHOD Destroy(nsPresContext* aPresContext);
virtual void Destroy();
nsSize mPrefSize;
nsSize mMinSize;
@ -243,8 +242,7 @@ protected:
nsCOMPtr<nsIBoxLayout> mLayoutManager;
protected:
nsresult RegUnregAccessKey(nsPresContext* aPresContext,
PRBool aDoReg);
nsresult RegUnregAccessKey(PRBool aDoReg);
NS_HIDDEN_(void) CheckBoxOrder(nsBoxLayoutState& aState);

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

@ -285,8 +285,8 @@ nsImageBoxFrame::NeedsRecalc()
return NS_OK;
}
NS_METHOD
nsImageBoxFrame::Destroy(nsPresContext* aPresContext)
void
nsImageBoxFrame::Destroy()
{
// Release image loader first so that it's refcnt can go to zero
if (mImageRequest)
@ -295,7 +295,7 @@ nsImageBoxFrame::Destroy(nsPresContext* aPresContext)
if (mListener)
NS_REINTERPRET_CAST(nsImageBoxListener*, mListener.get())->SetFrame(nsnull); // set the frame to null so we don't send messages to a dead object.
return nsLeafBoxFrame::Destroy(aPresContext);
nsLeafBoxFrame::Destroy();
}

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

@ -86,7 +86,7 @@ public:
NS_IMETHOD DidSetStyleContext();
NS_IMETHOD Destroy(nsPresContext* aPresContext);
virtual void Destroy();
virtual nsIAtom* GetType() const;
#ifdef DEBUG

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

@ -270,12 +270,12 @@ nsListBoxBodyFrame::Init(nsIContent* aContent,
return rv;
}
NS_IMETHODIMP
nsListBoxBodyFrame::Destroy(nsPresContext* aPresContext)
void
nsListBoxBodyFrame::Destroy()
{
// make sure we cancel any posted callbacks.
if (mReflowCallbackPosted)
aPresContext->PresShell()->CancelReflowCallback(this);
GetPresContext()->PresShell()->CancelReflowCallback(this);
// Make sure we tell our listbox's box object we're being destroyed.
for (nsIFrame *a = mParent; a; a = a->GetParent()) {
@ -300,7 +300,7 @@ nsListBoxBodyFrame::Destroy(nsPresContext* aPresContext)
}
}
return nsBoxFrame::Destroy(aPresContext);
nsBoxFrame::Destroy();
}
NS_IMETHODIMP
@ -1454,7 +1454,7 @@ nsListBoxBodyFrame::RemoveChildFrame(nsBoxLayoutState &aState,
"Going to destroy a frame we didn't remove. Prepare to crash");
if (mLayoutManager)
mLayoutManager->ChildrenRemoved(this, aState, aFrame);
aFrame->Destroy(presContext);
aFrame->Destroy();
}
// Creation Routines ///////////////////////////////////////////////////////////////////////

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

@ -76,7 +76,8 @@ public:
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsIFrame* aPrevInFlow);
NS_IMETHOD Destroy(nsPresContext* aPresContext);
virtual void Destroy();
NS_IMETHOD AttributeChanged(PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRInt32 aModType);
// nsIScrollbarMediator

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

@ -768,8 +768,8 @@ nsMenuBarFrame::IsDisabled(nsIContent* aContent)
return PR_FALSE;
}
NS_IMETHODIMP
nsMenuBarFrame::Destroy(nsPresContext* aPresContext)
void
nsMenuBarFrame::Destroy()
{
mTarget->RemoveEventListener(NS_LITERAL_STRING("keypress"), (nsIDOMKeyListener*)mMenuBarListener, PR_FALSE);
mTarget->RemoveEventListener(NS_LITERAL_STRING("keydown"), (nsIDOMKeyListener*)mMenuBarListener, PR_FALSE);
@ -780,6 +780,6 @@ nsMenuBarFrame::Destroy(nsPresContext* aPresContext)
NS_IF_RELEASE(mMenuBarListener);
return nsBoxFrame::Destroy(aPresContext);
nsBoxFrame::Destroy();
}

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

@ -109,7 +109,7 @@ public:
nsIFrame* aParent,
nsIFrame* aPrevInFlow);
NS_IMETHOD Destroy(nsPresContext* aPresContext);
virtual void Destroy();
// Non-interface helpers

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

@ -260,9 +260,8 @@ nsMenuFrame::GetFirstChild(nsIAtom* aListName) const
}
NS_IMETHODIMP
nsMenuFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
nsMenuFrame::SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult rv = NS_OK;
if (nsLayoutAtoms::popupList == aListName) {
@ -285,7 +284,7 @@ nsMenuFrame::SetInitialChildList(nsPresContext* aPresContext,
frames.RemoveFrame(frame);
mPopupFrames.AppendFrame(this, frame);
nsIFrame* first = frames.FirstChild();
rv = nsBoxFrame::SetInitialChildList(aPresContext, aListName, first);
rv = nsBoxFrame::SetInitialChildList(aListName, first);
return rv;
}
}
@ -293,7 +292,7 @@ nsMenuFrame::SetInitialChildList(nsPresContext* aPresContext,
}
// Didn't find it.
rv = nsBoxFrame::SetInitialChildList(aPresContext, aListName, aChildList);
rv = nsBoxFrame::SetInitialChildList(aListName, aChildList);
}
return rv;
}
@ -324,12 +323,12 @@ nsMenuFrame::DestroyPopupFrames(nsPresContext* aPresContext)
}
// Cleanup frames in popup child list
mPopupFrames.DestroyFrames(aPresContext);
mPopupFrames.DestroyFrames();
return NS_OK;
}
NS_IMETHODIMP
nsMenuFrame::Destroy(nsPresContext* aPresContext)
void
nsMenuFrame::Destroy()
{
// Kill our timer if one is active. This is not strictly necessary as
// the pointer to this frame will be cleared from the mediator, but
@ -352,8 +351,8 @@ nsMenuFrame::Destroy(nsPresContext* aPresContext)
}
UngenerateMenu();
DestroyPopupFrames(aPresContext);
return nsBoxFrame::Destroy(aPresContext);
DestroyPopupFrames(GetPresContext());
nsBoxFrame::Destroy();
}
NS_IMETHODIMP
@ -1839,9 +1838,8 @@ nsMenuFrame::RemoveFrame(nsIAtom* aListName,
if (mPopupFrames.ContainsFrame(aOldFrame)) {
// Go ahead and remove this frame.
nsPresContext* presContext = GetPresContext();
mPopupFrames.DestroyFrame(presContext, aOldFrame);
nsBoxLayoutState state(presContext);
mPopupFrames.DestroyFrame(aOldFrame);
nsBoxLayoutState state(GetPresContext());
rv = MarkDirtyChildren(state);
} else {
rv = nsBoxFrame::RemoveFrame(aListName, aOldFrame);

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

@ -120,11 +120,10 @@ public:
// can be stored in a separate list (so that they don't impact reflow of the
// actual menu item at all).
virtual nsIFrame* GetFirstChild(nsIAtom* aListName) const;
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList);
virtual nsIAtom* GetAdditionalChildListName(PRInt32 aIndex) const;
NS_IMETHOD Destroy(nsPresContext* aPresContext);
virtual void Destroy();
// Overridden to prevent events from going to children of the menu.
NS_IMETHOD BuildDisplayListForChildren(nsDisplayListBuilder* aBuilder,

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

@ -1986,8 +1986,8 @@ nsMenuPopupFrame::HandleEvent(nsPresContext* aPresContext,
return nsBoxFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
}
NS_IMETHODIMP
nsMenuPopupFrame::Destroy(nsPresContext* aPresContext)
void
nsMenuPopupFrame::Destroy()
{
// Null out the pointer to this frame in the mediator wrapper so that it
// doesn't try to interact with a deallocated frame.
@ -1997,7 +1997,7 @@ nsMenuPopupFrame::Destroy(nsPresContext* aPresContext)
mCloseTimer->Cancel();
RemoveKeyboardNavigator();
return nsBoxFrame::Destroy(aPresContext);
nsBoxFrame::Destroy();
}
// REVIEW: The override here was doing nothing at all since nsBoxFrame is our

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

@ -152,7 +152,7 @@ public:
nsGUIEvent* aEvent,
nsEventStatus* aEventStatus);
NS_IMETHOD Destroy(nsPresContext* aPresContext);
virtual void Destroy();
virtual nsresult CreateWidgetForView(nsIView* aView);

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

@ -149,8 +149,8 @@ nsPopupSetFrame::Init(nsIContent* aContent,
return rv;
}
NS_IMETHODIMP
nsPopupSetFrame::Destroy(nsPresContext* aPresContext)
void
nsPopupSetFrame::Destroy()
{
// Remove our frame list.
if (mPopupList) {
@ -170,7 +170,7 @@ nsPopupSetFrame::Destroy(nsPresContext* aPresContext)
// keeps things consistent so reentering won't crash us
while (mPopupList) {
if (mPopupList->mPopupFrame) {
mPopupList->mPopupFrame->Destroy(aPresContext);
mPopupList->mPopupFrame->Destroy();
}
nsPopupFrameList* temp = mPopupList;
@ -186,7 +186,7 @@ nsPopupSetFrame::Destroy(nsPresContext* aPresContext)
rootBox->SetPopupSetFrame(nsnull);
}
return nsBoxFrame::Destroy(aPresContext);
nsBoxFrame::Destroy();
}
NS_IMETHODIMP
@ -701,7 +701,6 @@ nsPopupSetFrame::RemovePopupFrame(nsIFrame* aPopup)
// get the popup out of our list, so we don't reflow it later.
nsPopupFrameList* currEntry = mPopupList;
nsPopupFrameList* temp = nsnull;
nsPresContext* presContext = GetPresContext();
while (currEntry) {
if (currEntry->mPopupFrame == aPopup) {
// Remove this entry.
@ -711,7 +710,7 @@ nsPopupSetFrame::RemovePopupFrame(nsIFrame* aPopup)
mPopupList = currEntry->mNextPopup;
// Destroy the frame.
currEntry->mPopupFrame->Destroy(presContext);
currEntry->mPopupFrame->Destroy();
// Delete the entry.
currEntry->mNextPopup = nsnull;

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

@ -99,7 +99,7 @@ public:
#endif
// Used to destroy our popup frames.
NS_IMETHOD Destroy(nsPresContext* aPresContext);
virtual void Destroy();
// Reflow methods
virtual void RepositionPopup(nsPopupFrameList* aEntry, nsBoxLayoutState& aState);

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

@ -72,12 +72,11 @@ nsProgressMeterFrame :: ~nsProgressMeterFrame ( )
}
NS_IMETHODIMP
nsProgressMeterFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
nsProgressMeterFrame::SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList)
{
// Set up our initial flexes.
nsresult rv = nsBoxFrame::SetInitialChildList(aPresContext, aListName, aChildList);
nsresult rv = nsBoxFrame::SetInitialChildList(aListName, aChildList);
AttributeChanged(kNameSpaceID_None, nsHTMLAtoms::value, 0);
return rv;
}

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

@ -58,9 +58,8 @@ class nsProgressMeterFrame : public nsBoxFrame
public:
friend nsIFrame* NS_NewProgressMeterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList);
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList);
NS_IMETHOD AttributeChanged(PRInt32 aNameSpaceID,
nsIAtom* aAttribute,

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

@ -69,7 +69,7 @@ public:
friend nsIFrame* NS_NewAutoRepeatBoxFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext);
NS_IMETHOD Destroy(nsPresContext* aPresContext);
virtual void Destroy();
NS_IMETHOD HandleEvent(nsPresContext* aPresContext,
nsGUIEvent* aEvent,
@ -128,11 +128,11 @@ nsAutoRepeatBoxFrame::Notify(nsITimer *timer)
return NS_OK;
}
NS_IMETHODIMP
nsAutoRepeatBoxFrame::Destroy(nsPresContext* aPresContext)
void
nsAutoRepeatBoxFrame::Destroy()
{
// Ensure our repeat service isn't going... it's possible that a scrollbar can disappear out
// from under you while you're in the process of scrolling.
nsRepeatService::GetInstance()->Stop();
return nsButtonBoxFrame::Destroy(aPresContext);
nsButtonBoxFrame::Destroy();
}

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

@ -250,11 +250,11 @@ nsScrollbarButtonFrame::GetParentWithTag(nsIAtom* toFind, nsIFrame* start,
return NS_OK;
}
NS_IMETHODIMP
nsScrollbarButtonFrame::Destroy(nsPresContext* aPresContext)
void
nsScrollbarButtonFrame::Destroy()
{
// Ensure our repeat service isn't going... it's possible that a scrollbar can disappear out
// from under you while you're in the process of scrolling.
nsRepeatService::GetInstance()->Stop();
return nsButtonBoxFrame::Destroy(aPresContext);
nsButtonBoxFrame::Destroy();
}

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше