From b6ebd9961dac60306af63a035bf8a618bbb78190 Mon Sep 17 00:00:00 2001 From: "roc+%cs.cmu.edu" Date: Mon, 10 Apr 2006 00:16:29 +0000 Subject: [PATCH] Bug 328926. Remove aPresContext parameter from nsIFrame::Destroy, nsIFrame::SetInitialChildList and nsIFrame::RemovedAsPrimaryFrame. patch by Marc Liddell, r+sr=roc git-svn-id: svn://10.0.0.236/trunk@193976 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsBidiPresUtils.cpp | 4 +- mozilla/layout/base/nsCSSFrameConstructor.cpp | 317 +++++++----------- mozilla/layout/base/nsFrameManager.cpp | 4 +- .../layout/forms/nsComboboxControlFrame.cpp | 25 +- mozilla/layout/forms/nsComboboxControlFrame.h | 7 +- mozilla/layout/forms/nsFieldSetFrame.cpp | 14 +- mozilla/layout/forms/nsFileControlFrame.cpp | 21 +- mozilla/layout/forms/nsFileControlFrame.h | 6 +- mozilla/layout/forms/nsFormControlFrame.cpp | 22 +- mozilla/layout/forms/nsFormControlFrame.h | 7 +- .../layout/forms/nsGfxButtonControlFrame.cpp | 2 +- .../layout/forms/nsHTMLButtonControlFrame.cpp | 10 +- .../layout/forms/nsHTMLButtonControlFrame.h | 2 +- mozilla/layout/forms/nsImageControlFrame.cpp | 13 +- mozilla/layout/forms/nsLegendFrame.cpp | 10 +- mozilla/layout/forms/nsLegendFrame.h | 2 +- mozilla/layout/forms/nsListControlFrame.cpp | 15 +- mozilla/layout/forms/nsListControlFrame.h | 5 +- mozilla/layout/forms/nsTextControlFrame.cpp | 29 +- mozilla/layout/forms/nsTextControlFrame.h | 11 +- .../generic/nsAbsoluteContainingBlock.cpp | 9 +- .../generic/nsAbsoluteContainingBlock.h | 4 +- mozilla/layout/generic/nsAreaFrame.cpp | 18 +- mozilla/layout/generic/nsAreaFrame.h | 5 +- mozilla/layout/generic/nsBlockFrame.cpp | 44 +-- mozilla/layout/generic/nsBlockFrame.h | 5 +- mozilla/layout/generic/nsBulletFrame.cpp | 6 +- mozilla/layout/generic/nsBulletFrame.h | 2 +- mozilla/layout/generic/nsColumnSetFrame.cpp | 10 +- mozilla/layout/generic/nsContainerFrame.cpp | 23 +- mozilla/layout/generic/nsContainerFrame.h | 5 +- mozilla/layout/generic/nsFirstLetterFrame.cpp | 10 +- mozilla/layout/generic/nsFrame.cpp | 14 +- mozilla/layout/generic/nsFrame.h | 5 +- mozilla/layout/generic/nsFrameFrame.cpp | 8 +- mozilla/layout/generic/nsFrameList.cpp | 8 +- mozilla/layout/generic/nsFrameList.h | 4 +- mozilla/layout/generic/nsFrameSetFrame.cpp | 6 +- mozilla/layout/generic/nsGfxScrollFrame.cpp | 26 +- mozilla/layout/generic/nsGfxScrollFrame.h | 10 +- mozilla/layout/generic/nsHTMLFrame.cpp | 10 +- mozilla/layout/generic/nsIFrame.h | 7 +- mozilla/layout/generic/nsImageFrame.cpp | 6 +- mozilla/layout/generic/nsImageFrame.h | 2 +- mozilla/layout/generic/nsInlineFrame.cpp | 17 +- mozilla/layout/generic/nsInlineFrame.h | 5 +- mozilla/layout/generic/nsLineBox.cpp | 2 +- mozilla/layout/generic/nsObjectFrame.cpp | 6 +- mozilla/layout/generic/nsObjectFrame.h | 2 +- mozilla/layout/generic/nsPageFrame.cpp | 9 +- mozilla/layout/generic/nsPageFrame.h | 3 +- mozilla/layout/generic/nsPlaceholderFrame.cpp | 8 +- mozilla/layout/generic/nsPlaceholderFrame.h | 2 +- mozilla/layout/generic/nsSplittableFrame.cpp | 6 +- mozilla/layout/generic/nsSplittableFrame.h | 2 +- mozilla/layout/generic/nsTextFrame.cpp | 16 +- mozilla/layout/generic/nsViewportFrame.cpp | 15 +- mozilla/layout/generic/nsViewportFrame.h | 5 +- .../base/src/nsMathMLContainerFrame.cpp | 16 +- .../mathml/base/src/nsMathMLContainerFrame.h | 19 +- .../base/src/nsMathMLForeignFrameWrapper.h | 5 +- .../mathml/base/src/nsMathMLTokenFrame.cpp | 11 +- .../mathml/base/src/nsMathMLTokenFrame.h | 3 +- .../mathml/base/src/nsMathMLmactionFrame.cpp | 5 +- .../mathml/base/src/nsMathMLmactionFrame.h | 3 +- .../mathml/base/src/nsMathMLmfencedFrame.cpp | 7 +- .../mathml/base/src/nsMathMLmfencedFrame.h | 3 +- .../layout/svg/base/src/nsSVGDefsFrame.cpp | 2 +- .../base/src/nsSVGGenericContainerFrame.cpp | 2 +- .../svg/base/src/nsSVGGradientFrame.cpp | 2 +- .../svg/base/src/nsSVGInnerSVGFrame.cpp | 2 +- .../svg/base/src/nsSVGOuterSVGFrame.cpp | 2 +- .../layout/svg/base/src/nsSVGTSpanFrame.cpp | 2 +- .../layout/svg/base/src/nsSVGTextFrame.cpp | 2 +- .../layout/tables/nsTableColGroupFrame.cpp | 9 +- mozilla/layout/tables/nsTableColGroupFrame.h | 3 +- mozilla/layout/tables/nsTableFrame.cpp | 21 +- mozilla/layout/tables/nsTableFrame.h | 5 +- mozilla/layout/tables/nsTableOuterFrame.cpp | 15 +- mozilla/layout/tables/nsTableOuterFrame.h | 5 +- mozilla/layout/tables/nsTableRowFrame.cpp | 2 +- .../layout/tables/nsTableRowGroupFrame.cpp | 4 +- mozilla/layout/xul/base/src/nsBoxFrame.cpp | 29 +- mozilla/layout/xul/base/src/nsBoxFrame.h | 8 +- .../layout/xul/base/src/nsImageBoxFrame.cpp | 6 +- mozilla/layout/xul/base/src/nsImageBoxFrame.h | 2 +- .../xul/base/src/nsListBoxBodyFrame.cpp | 10 +- .../layout/xul/base/src/nsListBoxBodyFrame.h | 3 +- .../layout/xul/base/src/nsMenuBarFrame.cpp | 6 +- mozilla/layout/xul/base/src/nsMenuBarFrame.h | 2 +- mozilla/layout/xul/base/src/nsMenuFrame.cpp | 24 +- mozilla/layout/xul/base/src/nsMenuFrame.h | 5 +- .../layout/xul/base/src/nsMenuPopupFrame.cpp | 6 +- .../layout/xul/base/src/nsMenuPopupFrame.h | 2 +- .../layout/xul/base/src/nsPopupSetFrame.cpp | 11 +- mozilla/layout/xul/base/src/nsPopupSetFrame.h | 2 +- .../xul/base/src/nsProgressMeterFrame.cpp | 7 +- .../xul/base/src/nsProgressMeterFrame.h | 5 +- .../layout/xul/base/src/nsScrollBoxFrame.cpp | 8 +- .../xul/base/src/nsScrollbarButtonFrame.cpp | 6 +- .../xul/base/src/nsScrollbarButtonFrame.h | 2 +- mozilla/layout/xul/base/src/nsSliderFrame.cpp | 13 +- mozilla/layout/xul/base/src/nsSliderFrame.h | 5 +- .../layout/xul/base/src/nsTextBoxFrame.cpp | 34 +- mozilla/layout/xul/base/src/nsTextBoxFrame.h | 8 +- .../xul/base/src/tree/src/nsTreeBodyFrame.cpp | 8 +- .../xul/base/src/tree/src/nsTreeBodyFrame.h | 3 +- .../xul/base/src/tree/src/nsTreeColFrame.cpp | 6 +- .../xul/base/src/tree/src/nsTreeColFrame.h | 2 +- 109 files changed, 548 insertions(+), 696 deletions(-) diff --git a/mozilla/layout/base/nsBidiPresUtils.cpp b/mozilla/layout/base/nsBidiPresUtils.cpp index 384e4a8ae4c..bea8721c1ce 100644 --- a/mozilla/layout/base/nsBidiPresUtils.cpp +++ b/mozilla/layout/base/nsBidiPresUtils.cpp @@ -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 { diff --git a/mozilla/layout/base/nsCSSFrameConstructor.cpp b/mozilla/layout/base/nsCSSFrameConstructor.cpp index 78963fb4b90..95f45884367 100644 --- a/mozilla/layout/base/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/base/nsCSSFrameConstructor.cpp @@ -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 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); diff --git a/mozilla/layout/base/nsFrameManager.cpp b/mozilla/layout/base/nsFrameManager.cpp index 6f78dae60f9..a3fbe403db5 100644 --- a/mozilla/layout/base/nsFrameManager.cpp +++ b/mozilla/layout/base/nsFrameManager.cpp @@ -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; } diff --git a/mozilla/layout/forms/nsComboboxControlFrame.cpp b/mozilla/layout/forms/nsComboboxControlFrame.cpp index eb9257d5c52..c686a4e6911 100644 --- a/mozilla/layout/forms/nsComboboxControlFrame.cpp +++ b/mozilla/layout/forms/nsComboboxControlFrame.cpp @@ -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 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()) { diff --git a/mozilla/layout/forms/nsComboboxControlFrame.h b/mozilla/layout/forms/nsComboboxControlFrame.h index b5f0f9fb525..a129a877ceb 100644 --- a/mozilla/layout/forms/nsComboboxControlFrame.h +++ b/mozilla/layout/forms/nsComboboxControlFrame.h @@ -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(); diff --git a/mozilla/layout/forms/nsFieldSetFrame.cpp b/mozilla/layout/forms/nsFieldSetFrame.cpp index 466c4797276..fae29906546 100644 --- a/mozilla/layout/forms/nsFieldSetFrame.cpp +++ b/mozilla/layout/forms/nsFieldSetFrame.cpp @@ -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; } diff --git a/mozilla/layout/forms/nsFileControlFrame.cpp b/mozilla/layout/forms/nsFileControlFrame.cpp index 1318755ffe0..4ecb73d3570 100644 --- a/mozilla/layout/forms/nsFileControlFrame.cpp +++ b/mozilla/layout/forms/nsFileControlFrame.cpp @@ -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. diff --git a/mozilla/layout/forms/nsFileControlFrame.h b/mozilla/layout/forms/nsFileControlFrame.h index 95b06cf8df3..54fc7e615a3 100644 --- a/mozilla/layout/forms/nsFileControlFrame.h +++ b/mozilla/layout/forms/nsFileControlFrame.h @@ -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; } diff --git a/mozilla/layout/forms/nsFormControlFrame.cpp b/mozilla/layout/forms/nsFormControlFrame.cpp index e1a1795e792..975e5a5c696 100644 --- a/mozilla/layout/forms/nsFormControlFrame.cpp +++ b/mozilla/layout/forms/nsFormControlFrame.cpp @@ -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 { diff --git a/mozilla/layout/forms/nsFormControlFrame.h b/mozilla/layout/forms/nsFormControlFrame.h index 03e04d1bbee..d1d8190e2fd 100644 --- a/mozilla/layout/forms/nsFormControlFrame.h +++ b/mozilla/layout/forms/nsFormControlFrame.h @@ -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 diff --git a/mozilla/layout/forms/nsGfxButtonControlFrame.cpp b/mozilla/layout/forms/nsGfxButtonControlFrame.cpp index cec8bd69724..040b8202cf0 100644 --- a/mozilla/layout/forms/nsGfxButtonControlFrame.cpp +++ b/mozilla/layout/forms/nsGfxButtonControlFrame.cpp @@ -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; } } diff --git a/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp b/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp index 8e12c9f248f..aa92a9f4253 100644 --- a/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp +++ b/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp @@ -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 diff --git a/mozilla/layout/forms/nsHTMLButtonControlFrame.h b/mozilla/layout/forms/nsHTMLButtonControlFrame.h index 9cf15e20597..fe41304779d 100644 --- a/mozilla/layout/forms/nsHTMLButtonControlFrame.h +++ b/mozilla/layout/forms/nsHTMLButtonControlFrame.h @@ -64,7 +64,7 @@ public: ~nsHTMLButtonControlFrame(); - NS_IMETHOD Destroy(nsPresContext *aPresContext); + virtual void Destroy(); NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); diff --git a/mozilla/layout/forms/nsImageControlFrame.cpp b/mozilla/layout/forms/nsImageControlFrame.cpp index e651f5ae2b5..8aaa29678e0 100644 --- a/mozilla/layout/forms/nsImageControlFrame.cpp +++ b/mozilla/layout/forms/nsImageControlFrame.cpp @@ -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); } diff --git a/mozilla/layout/forms/nsLegendFrame.cpp b/mozilla/layout/forms/nsLegendFrame.cpp index 5b0729b551a..aadbca2a562 100644 --- a/mozilla/layout/forms/nsLegendFrame.cpp +++ b/mozilla/layout/forms/nsLegendFrame.cpp @@ -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); } diff --git a/mozilla/layout/forms/nsLegendFrame.h b/mozilla/layout/forms/nsLegendFrame.h index 9b93a43e22e..b752938abde 100644 --- a/mozilla/layout/forms/nsLegendFrame.h +++ b/mozilla/layout/forms/nsLegendFrame.h @@ -63,7 +63,7 @@ public: const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus); - NS_IMETHOD Destroy(nsPresContext *aPresContext); + virtual void Destroy(); virtual nsIAtom* GetType() const; diff --git a/mozilla/layout/forms/nsListControlFrame.cpp b/mozilla/layout/forms/nsListControlFrame.cpp index 1f1e10051e3..b40215e44b0 100644 --- a/mozilla/layout/forms/nsListControlFrame.cpp +++ b/mozilla/layout/forms/nsListControlFrame.cpp @@ -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 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 diff --git a/mozilla/layout/forms/nsListControlFrame.h b/mozilla/layout/forms/nsListControlFrame.h index 311a34d37c9..cf5639213db 100644 --- a/mozilla/layout/forms/nsListControlFrame.h +++ b/mozilla/layout/forms/nsListControlFrame.h @@ -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, diff --git a/mozilla/layout/forms/nsTextControlFrame.cpp b/mozilla/layout/forms/nsTextControlFrame.cpp index 9b3f35d564b..78709e0b154 100644 --- a/mozilla/layout/forms/nsTextControlFrame.cpp +++ b/mozilla/layout/forms/nsTextControlFrame.cpp @@ -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 controllers; nsCOMPtr 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 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; } diff --git a/mozilla/layout/forms/nsTextControlFrame.h b/mozilla/layout/forms/nsTextControlFrame.h index b736a6e81bd..994cbb9f8a3 100644 --- a/mozilla/layout/forms/nsTextControlFrame.h +++ b/mozilla/layout/forms/nsTextControlFrame.h @@ -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. */ diff --git a/mozilla/layout/generic/nsAbsoluteContainingBlock.cpp b/mozilla/layout/generic/nsAbsoluteContainingBlock.cpp index 56607493344..44d2ca6ddff 100644 --- a/mozilla/layout/generic/nsAbsoluteContainingBlock.cpp +++ b/mozilla/layout/generic/nsAbsoluteContainingBlock.cpp @@ -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 diff --git a/mozilla/layout/generic/nsAbsoluteContainingBlock.h b/mozilla/layout/generic/nsAbsoluteContainingBlock.h index 47d6d721545..ebf7a28cb3a 100644 --- a/mozilla/layout/generic/nsAbsoluteContainingBlock.h +++ b/mozilla/layout/generic/nsAbsoluteContainingBlock.h @@ -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();} diff --git a/mozilla/layout/generic/nsAreaFrame.cpp b/mozilla/layout/generic/nsAreaFrame.cpp index 4bf18df860d..d2c618987fb 100644 --- a/mozilla/layout/generic/nsAreaFrame.cpp +++ b/mozilla/layout/generic/nsAreaFrame.cpp @@ -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; } diff --git a/mozilla/layout/generic/nsAreaFrame.h b/mozilla/layout/generic/nsAreaFrame.h index 40b0020fbbf..e915ff129ca 100644 --- a/mozilla/layout/generic/nsAreaFrame.h +++ b/mozilla/layout/generic/nsAreaFrame.h @@ -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 }; diff --git a/mozilla/layout/generic/nsBlockFrame.cpp b/mozilla/layout/generic/nsBlockFrame.cpp index 46107a60a6a..2892359d105 100644 --- a/mozilla/layout/generic/nsBlockFrame.cpp +++ b/mozilla/layout/generic/nsBlockFrame.cpp @@ -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 firstLetterStyle = GetFirstLetterStyle(aPresContext); + nsRefPtr 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 kidSC = shell->StyleSet()-> ResolvePseudoStyleFor(mContent, pseudoElement, mStyleContext); diff --git a/mozilla/layout/generic/nsBlockFrame.h b/mozilla/layout/generic/nsBlockFrame.h index cf6e9fb66f5..944887db3c0 100644 --- a/mozilla/layout/generic/nsBlockFrame.h +++ b/mozilla/layout/generic/nsBlockFrame.h @@ -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; diff --git a/mozilla/layout/generic/nsBulletFrame.cpp b/mozilla/layout/generic/nsBulletFrame.cpp index c7415a42200..b13eb32ac15 100644 --- a/mozilla/layout/generic/nsBulletFrame.cpp +++ b/mozilla/layout/generic/nsBulletFrame.cpp @@ -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 diff --git a/mozilla/layout/generic/nsBulletFrame.h b/mozilla/layout/generic/nsBulletFrame.h index 93b6c58626e..15d1a6b706c 100644 --- a/mozilla/layout/generic/nsBulletFrame.h +++ b/mozilla/layout/generic/nsBulletFrame.h @@ -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); diff --git a/mozilla/layout/generic/nsColumnSetFrame.cpp b/mozilla/layout/generic/nsColumnSetFrame.cpp index 791c00f6915..b4c403b7d6f 100644 --- a/mozilla/layout/generic/nsColumnSetFrame.cpp +++ b/mozilla/layout/generic/nsColumnSetFrame.cpp @@ -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) { diff --git a/mozilla/layout/generic/nsContainerFrame.cpp b/mozilla/layout/generic/nsContainerFrame.cpp index 5a0a8e5b288..dc3ec8e3844 100644 --- a/mozilla/layout/generic/nsContainerFrame.cpp +++ b/mozilla/layout/generic/nsContainerFrame.cpp @@ -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"); diff --git a/mozilla/layout/generic/nsContainerFrame.h b/mozilla/layout/generic/nsContainerFrame.h index ccb9eef313b..4b7e87ffb1e 100644 --- a/mozilla/layout/generic/nsContainerFrame.h +++ b/mozilla/layout/generic/nsContainerFrame.h @@ -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; diff --git a/mozilla/layout/generic/nsFirstLetterFrame.cpp b/mozilla/layout/generic/nsFirstLetterFrame.cpp index 7f25a55d47d..2b70acf37fe 100644 --- a/mozilla/layout/generic/nsFirstLetterFrame.cpp +++ b/mozilla/layout/generic/nsFirstLetterFrame.cpp @@ -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"); diff --git a/mozilla/layout/generic/nsFrame.cpp b/mozilla/layout/generic/nsFrame.cpp index dc3a66e1bfc..44090df1bb3 100644 --- a/mozilla/layout/generic/nsFrame.cpp +++ b/mozilla/layout/generic/nsFrame.cpp @@ -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 diff --git a/mozilla/layout/generic/nsFrame.h b/mozilla/layout/generic/nsFrame.h index 06906369716..e0bf5c89812 100644 --- a/mozilla/layout/generic/nsFrame.h +++ b/mozilla/layout/generic/nsFrame.h @@ -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, diff --git a/mozilla/layout/generic/nsFrameFrame.cpp b/mozilla/layout/generic/nsFrameFrame.cpp index 919a5ee737b..1887f6e7630 100644 --- a/mozilla/layout/generic/nsFrameFrame.cpp +++ b/mozilla/layout/generic/nsFrameFrame.cpp @@ -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() diff --git a/mozilla/layout/generic/nsFrameList.cpp b/mozilla/layout/generic/nsFrameList.cpp index ac3583e823f..5ecae3a82c3 100644 --- a/mozilla/layout/generic/nsFrameList.cpp +++ b/mozilla/layout/generic/nsFrameList.cpp @@ -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; diff --git a/mozilla/layout/generic/nsFrameList.h b/mozilla/layout/generic/nsFrameList.h index 9f409b180c0..4cf4a528e1e 100644 --- a/mozilla/layout/generic/nsFrameList.h +++ b/mozilla/layout/generic/nsFrameList.h @@ -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, diff --git a/mozilla/layout/generic/nsFrameSetFrame.cpp b/mozilla/layout/generic/nsFrameSetFrame.cpp index c799c0a414c..879fd15ab3d 100644 --- a/mozilla/layout/generic/nsFrameSetFrame.cpp +++ b/mozilla/layout/generic/nsFrameSetFrame.cpp @@ -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; } diff --git a/mozilla/layout/generic/nsGfxScrollFrame.cpp b/mozilla/layout/generic/nsGfxScrollFrame.cpp index 2566ddf9d96..11c2a79ff57 100644 --- a/mozilla/layout/generic/nsGfxScrollFrame.cpp +++ b/mozilla/layout/generic/nsGfxScrollFrame.cpp @@ -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(); diff --git a/mozilla/layout/generic/nsGfxScrollFrame.h b/mozilla/layout/generic/nsGfxScrollFrame.h index 986cd8b9f88..ea0ceaeb057 100644 --- a/mozilla/layout/generic/nsGfxScrollFrame.h +++ b/mozilla/layout/generic/nsGfxScrollFrame.h @@ -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); diff --git a/mozilla/layout/generic/nsHTMLFrame.cpp b/mozilla/layout/generic/nsHTMLFrame.cpp index 90cb417fc47..f253052a27a 100644 --- a/mozilla/layout/generic/nsHTMLFrame.cpp +++ b/mozilla/layout/generic/nsHTMLFrame.cpp @@ -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()-> diff --git a/mozilla/layout/generic/nsIFrame.h b/mozilla/layout/generic/nsIFrame.h index 7f3b0d552c0..940db0f4cbb 100644 --- a/mozilla/layout/generic/nsIFrame.h +++ b/mozilla/layout/generic/nsIFrame.h @@ -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; /** diff --git a/mozilla/layout/generic/nsImageFrame.cpp b/mozilla/layout/generic/nsImageFrame.cpp index a3d5a706635..1ae24e54d96 100644 --- a/mozilla/layout/generic/nsImageFrame.cpp +++ b/mozilla/layout/generic/nsImageFrame.cpp @@ -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(); } diff --git a/mozilla/layout/generic/nsImageFrame.h b/mozilla/layout/generic/nsImageFrame.h index 5e2a5ef546b..02df14c3044 100644 --- a/mozilla/layout/generic/nsImageFrame.h +++ b/mozilla/layout/generic/nsImageFrame.h @@ -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); diff --git a/mozilla/layout/generic/nsInlineFrame.cpp b/mozilla/layout/generic/nsInlineFrame.cpp index e10386db807..b0ce08a7f1d 100644 --- a/mozilla/layout/generic/nsInlineFrame.cpp +++ b/mozilla/layout/generic/nsInlineFrame.cpp @@ -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; diff --git a/mozilla/layout/generic/nsInlineFrame.h b/mozilla/layout/generic/nsInlineFrame.h index 4bbd2e41582..5c697d8f613 100644 --- a/mozilla/layout/generic/nsInlineFrame.h +++ b/mozilla/layout/generic/nsInlineFrame.h @@ -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); diff --git a/mozilla/layout/generic/nsLineBox.cpp b/mozilla/layout/generic/nsLineBox.cpp index 9be2d157899..ffa97494103 100644 --- a/mozilla/layout/generic/nsLineBox.cpp +++ b/mozilla/layout/generic/nsLineBox.cpp @@ -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; } diff --git a/mozilla/layout/generic/nsObjectFrame.cpp b/mozilla/layout/generic/nsObjectFrame.cpp index 985051ad2b6..c9afa402925 100644 --- a/mozilla/layout/generic/nsObjectFrame.cpp +++ b/mozilla/layout/generic/nsObjectFrame.cpp @@ -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* diff --git a/mozilla/layout/generic/nsObjectFrame.h b/mozilla/layout/generic/nsObjectFrame.h index aad3c64cd51..a2f3cf00435 100644 --- a/mozilla/layout/generic/nsObjectFrame.h +++ b/mozilla/layout/generic/nsObjectFrame.h @@ -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); diff --git a/mozilla/layout/generic/nsPageFrame.cpp b/mozilla/layout/generic/nsPageFrame.cpp index 1db68078892..f13996c7f14 100644 --- a/mozilla/layout/generic/nsPageFrame.cpp +++ b/mozilla/layout/generic/nsPageFrame.cpp @@ -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, diff --git a/mozilla/layout/generic/nsPageFrame.h b/mozilla/layout/generic/nsPageFrame.h index 01894abbcb0..e296a020157 100644 --- a/mozilla/layout/generic/nsPageFrame.h +++ b/mozilla/layout/generic/nsPageFrame.h @@ -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, diff --git a/mozilla/layout/generic/nsPlaceholderFrame.cpp b/mozilla/layout/generic/nsPlaceholderFrame.cpp index f9d546a0f26..3bf3b18b605 100644 --- a/mozilla/layout/generic/nsPlaceholderFrame.cpp +++ b/mozilla/layout/generic/nsPlaceholderFrame.cpp @@ -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* diff --git a/mozilla/layout/generic/nsPlaceholderFrame.h b/mozilla/layout/generic/nsPlaceholderFrame.h index 55b11e57d3b..cf81de95f6c 100644 --- a/mozilla/layout/generic/nsPlaceholderFrame.h +++ b/mozilla/layout/generic/nsPlaceholderFrame.h @@ -71,7 +71,7 @@ public: const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus); - NS_IMETHOD Destroy(nsPresContext* aPresContext); + virtual void Destroy(); // nsIFrame overrides #ifdef DEBUG diff --git a/mozilla/layout/generic/nsSplittableFrame.cpp b/mozilla/layout/generic/nsSplittableFrame.cpp index a368ed44a28..a2e8dd5550a 100644 --- a/mozilla/layout/generic/nsSplittableFrame.cpp +++ b/mozilla/layout/generic/nsSplittableFrame.cpp @@ -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 diff --git a/mozilla/layout/generic/nsSplittableFrame.h b/mozilla/layout/generic/nsSplittableFrame.h index 3e12cf3476c..55967460b16 100644 --- a/mozilla/layout/generic/nsSplittableFrame.h +++ b/mozilla/layout/generic/nsSplittableFrame.h @@ -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: diff --git a/mozilla/layout/generic/nsTextFrame.cpp b/mozilla/layout/generic/nsTextFrame.cpp index d354192edfe..83e747e658a 100644 --- a/mozilla/layout/generic/nsTextFrame.cpp +++ b/mozilla/layout/generic/nsTextFrame.cpp @@ -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* diff --git a/mozilla/layout/generic/nsViewportFrame.cpp b/mozilla/layout/generic/nsViewportFrame.cpp index 0a8828c20d5..8b356b437fe 100644 --- a/mozilla/layout/generic/nsViewportFrame.cpp +++ b/mozilla/layout/generic/nsViewportFrame.cpp @@ -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; diff --git a/mozilla/layout/generic/nsViewportFrame.h b/mozilla/layout/generic/nsViewportFrame.h index 972613706d6..f145726d9f1 100644 --- a/mozilla/layout/generic/nsViewportFrame.h +++ b/mozilla/layout/generic/nsViewportFrame.h @@ -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, diff --git a/mozilla/layout/mathml/base/src/nsMathMLContainerFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLContainerFrame.cpp index 47d26ef3d65..c677e3ea503 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLContainerFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLContainerFrame.cpp @@ -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 ... - // 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); } diff --git a/mozilla/layout/mathml/base/src/nsMathMLContainerFrame.h b/mozilla/layout/mathml/base/src/nsMathMLContainerFrame.h index c13f7a76dee..c77bbd9c026 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLContainerFrame.h +++ b/mozilla/layout/mathml/base/src/nsMathMLContainerFrame.h @@ -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; } diff --git a/mozilla/layout/mathml/base/src/nsMathMLForeignFrameWrapper.h b/mozilla/layout/mathml/base/src/nsMathMLForeignFrameWrapper.h index 94be665b080..8bcfdd489de 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLForeignFrameWrapper.h +++ b/mozilla/layout/mathml/base/src/nsMathMLForeignFrameWrapper.h @@ -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, diff --git a/mozilla/layout/mathml/base/src/nsMathMLTokenFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLTokenFrame.cpp index a1a4fc164d7..0f483e3d6af 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLTokenFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLTokenFrame.cpp @@ -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; } diff --git a/mozilla/layout/mathml/base/src/nsMathMLTokenFrame.h b/mozilla/layout/mathml/base/src/nsMathMLTokenFrame.h index f4923420314..fb282d72317 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLTokenFrame.h +++ b/mozilla/layout/mathml/base/src/nsMathMLTokenFrame.h @@ -57,8 +57,7 @@ public: nsIFrame* aPrevInFlow); NS_IMETHOD - SetInitialChildList(nsPresContext* aPresContext, - nsIAtom* aListName, + SetInitialChildList(nsIAtom* aListName, nsIFrame* aChildList); NS_IMETHOD diff --git a/mozilla/layout/mathml/base/src/nsMathMLmactionFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLmactionFrame.cpp index bab63a4befa..770a8ab3302 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLmactionFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLmactionFrame.cpp @@ -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 diff --git a/mozilla/layout/mathml/base/src/nsMathMLmactionFrame.h b/mozilla/layout/mathml/base/src/nsMathMLmactionFrame.h index f93a00e1acc..5c7d8d61cf4 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLmactionFrame.h +++ b/mozilla/layout/mathml/base/src/nsMathMLmactionFrame.h @@ -66,8 +66,7 @@ public: nsIFrame* aPrevInFlow); NS_IMETHOD - SetInitialChildList(nsPresContext* aPresContext, - nsIAtom* aListName, + SetInitialChildList(nsIAtom* aListName, nsIFrame* aChildList); virtual nsresult diff --git a/mozilla/layout/mathml/base/src/nsMathMLmfencedFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLmfencedFrame.cpp index 5269ed0f32f..baa5c1cfa89 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLmfencedFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLmfencedFrame.cpp @@ -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 diff --git a/mozilla/layout/mathml/base/src/nsMathMLmfencedFrame.h b/mozilla/layout/mathml/base/src/nsMathMLmfencedFrame.h index e9fc3acbeff..219ba6ff370 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLmfencedFrame.h +++ b/mozilla/layout/mathml/base/src/nsMathMLmfencedFrame.h @@ -60,8 +60,7 @@ public: InheritAutomaticData(nsIFrame* aParent); NS_IMETHOD - SetInitialChildList(nsPresContext* aPresContext, - nsIAtom* aListName, + SetInitialChildList(nsIAtom* aListName, nsIFrame* aChildList); NS_IMETHOD diff --git a/mozilla/layout/svg/base/src/nsSVGDefsFrame.cpp b/mozilla/layout/svg/base/src/nsSVGDefsFrame.cpp index 1476487b52b..9a2885365ec 100644 --- a/mozilla/layout/svg/base/src/nsSVGDefsFrame.cpp +++ b/mozilla/layout/svg/base/src/nsSVGDefsFrame.cpp @@ -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"); diff --git a/mozilla/layout/svg/base/src/nsSVGGenericContainerFrame.cpp b/mozilla/layout/svg/base/src/nsSVGGenericContainerFrame.cpp index b381563b12b..05da63e54bd 100644 --- a/mozilla/layout/svg/base/src/nsSVGGenericContainerFrame.cpp +++ b/mozilla/layout/svg/base/src/nsSVGGenericContainerFrame.cpp @@ -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"); diff --git a/mozilla/layout/svg/base/src/nsSVGGradientFrame.cpp b/mozilla/layout/svg/base/src/nsSVGGradientFrame.cpp index bdf05052cf9..ef60acc68d2 100644 --- a/mozilla/layout/svg/base/src/nsSVGGradientFrame.cpp +++ b/mozilla/layout/svg/base/src/nsSVGGradientFrame.cpp @@ -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; } diff --git a/mozilla/layout/svg/base/src/nsSVGInnerSVGFrame.cpp b/mozilla/layout/svg/base/src/nsSVGInnerSVGFrame.cpp index 05e9acdc405..23c3b39cb38 100644 --- a/mozilla/layout/svg/base/src/nsSVGInnerSVGFrame.cpp +++ b/mozilla/layout/svg/base/src/nsSVGInnerSVGFrame.cpp @@ -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"); diff --git a/mozilla/layout/svg/base/src/nsSVGOuterSVGFrame.cpp b/mozilla/layout/svg/base/src/nsSVGOuterSVGFrame.cpp index 32b2376ceb1..03ca80d3569 100644 --- a/mozilla/layout/svg/base/src/nsSVGOuterSVGFrame.cpp +++ b/mozilla/layout/svg/base/src/nsSVGOuterSVGFrame.cpp @@ -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); diff --git a/mozilla/layout/svg/base/src/nsSVGTSpanFrame.cpp b/mozilla/layout/svg/base/src/nsSVGTSpanFrame.cpp index 7d6c5763b33..05fe537a4a2 100644 --- a/mozilla/layout/svg/base/src/nsSVGTSpanFrame.cpp +++ b/mozilla/layout/svg/base/src/nsSVGTSpanFrame.cpp @@ -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"); diff --git a/mozilla/layout/svg/base/src/nsSVGTextFrame.cpp b/mozilla/layout/svg/base/src/nsSVGTextFrame.cpp index ac2203e859e..b8ccf1fefc6 100644 --- a/mozilla/layout/svg/base/src/nsSVGTextFrame.cpp +++ b/mozilla/layout/svg/base/src/nsSVGTextFrame.cpp @@ -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"); diff --git a/mozilla/layout/tables/nsTableColGroupFrame.cpp b/mozilla/layout/tables/nsTableColGroupFrame.cpp index 8ddc60a5396..3ab91702f1f 100644 --- a/mozilla/layout/tables/nsTableColGroupFrame.cpp +++ b/mozilla/layout/tables/nsTableColGroupFrame.cpp @@ -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; diff --git a/mozilla/layout/tables/nsTableColGroupFrame.h b/mozilla/layout/tables/nsTableColGroupFrame.h index 1d411c6d676..7f8759d15ff 100644 --- a/mozilla/layout/tables/nsTableColGroupFrame.h +++ b/mozilla/layout/tables/nsTableColGroupFrame.h @@ -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); /** diff --git a/mozilla/layout/tables/nsTableFrame.cpp b/mozilla/layout/tables/nsTableFrame.cpp index 96affa8208b..aff65f2a326 100644 --- a/mozilla/layout/tables/nsTableFrame.cpp +++ b/mozilla/layout/tables/nsTableFrame.cpp @@ -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; } } diff --git a/mozilla/layout/tables/nsTableFrame.h b/mozilla/layout/tables/nsTableFrame.h index f865562fdff..695505bc738 100644 --- a/mozilla/layout/tables/nsTableFrame.h +++ b/mozilla/layout/tables/nsTableFrame.h @@ -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. diff --git a/mozilla/layout/tables/nsTableOuterFrame.cpp b/mozilla/layout/tables/nsTableOuterFrame.cpp index 434c172d362..e842b170d70 100644 --- a/mozilla/layout/tables/nsTableOuterFrame.cpp +++ b/mozilla/layout/tables/nsTableOuterFrame.cpp @@ -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"); } diff --git a/mozilla/layout/tables/nsTableOuterFrame.h b/mozilla/layout/tables/nsTableOuterFrame.h index 40caac53050..e8c9f34357a 100644 --- a/mozilla/layout/tables/nsTableOuterFrame.h +++ b/mozilla/layout/tables/nsTableOuterFrame.h @@ -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; diff --git a/mozilla/layout/tables/nsTableRowFrame.cpp b/mozilla/layout/tables/nsTableRowFrame.cpp index e9fa6e52cfe..aac1a7ca7e4 100644 --- a/mozilla/layout/tables/nsTableRowFrame.cpp +++ b/mozilla/layout/tables/nsTableRowFrame.cpp @@ -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); diff --git a/mozilla/layout/tables/nsTableRowGroupFrame.cpp b/mozilla/layout/tables/nsTableRowGroupFrame.cpp index b37289c0d47..8fe8caa0757 100644 --- a/mozilla/layout/tables/nsTableRowGroupFrame.cpp +++ b/mozilla/layout/tables/nsTableRowGroupFrame.cpp @@ -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; } diff --git a/mozilla/layout/xul/base/src/nsBoxFrame.cpp b/mozilla/layout/xul/base/src/nsBoxFrame.cpp index 8ba6b60421a..ea4106ec764 100644 --- a/mozilla/layout/xul/base/src/nsBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsBoxFrame.cpp @@ -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; diff --git a/mozilla/layout/xul/base/src/nsBoxFrame.h b/mozilla/layout/xul/base/src/nsBoxFrame.h index 248bbf2d6ff..2207d285b38 100644 --- a/mozilla/layout/xul/base/src/nsBoxFrame.h +++ b/mozilla/layout/xul/base/src/nsBoxFrame.h @@ -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 mLayoutManager; protected: - nsresult RegUnregAccessKey(nsPresContext* aPresContext, - PRBool aDoReg); + nsresult RegUnregAccessKey(PRBool aDoReg); NS_HIDDEN_(void) CheckBoxOrder(nsBoxLayoutState& aState); diff --git a/mozilla/layout/xul/base/src/nsImageBoxFrame.cpp b/mozilla/layout/xul/base/src/nsImageBoxFrame.cpp index aff75719991..887c1e0318b 100644 --- a/mozilla/layout/xul/base/src/nsImageBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsImageBoxFrame.cpp @@ -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(); } diff --git a/mozilla/layout/xul/base/src/nsImageBoxFrame.h b/mozilla/layout/xul/base/src/nsImageBoxFrame.h index 4fec945d85a..cd728f81a36 100644 --- a/mozilla/layout/xul/base/src/nsImageBoxFrame.h +++ b/mozilla/layout/xul/base/src/nsImageBoxFrame.h @@ -86,7 +86,7 @@ public: NS_IMETHOD DidSetStyleContext(); - NS_IMETHOD Destroy(nsPresContext* aPresContext); + virtual void Destroy(); virtual nsIAtom* GetType() const; #ifdef DEBUG diff --git a/mozilla/layout/xul/base/src/nsListBoxBodyFrame.cpp b/mozilla/layout/xul/base/src/nsListBoxBodyFrame.cpp index 472c8a98048..1817c01e08b 100644 --- a/mozilla/layout/xul/base/src/nsListBoxBodyFrame.cpp +++ b/mozilla/layout/xul/base/src/nsListBoxBodyFrame.cpp @@ -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 /////////////////////////////////////////////////////////////////////// diff --git a/mozilla/layout/xul/base/src/nsListBoxBodyFrame.h b/mozilla/layout/xul/base/src/nsListBoxBodyFrame.h index d16cdd72eea..619e17cc1b0 100644 --- a/mozilla/layout/xul/base/src/nsListBoxBodyFrame.h +++ b/mozilla/layout/xul/base/src/nsListBoxBodyFrame.h @@ -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 diff --git a/mozilla/layout/xul/base/src/nsMenuBarFrame.cpp b/mozilla/layout/xul/base/src/nsMenuBarFrame.cpp index 07b19e381d5..909c8c5b113 100644 --- a/mozilla/layout/xul/base/src/nsMenuBarFrame.cpp +++ b/mozilla/layout/xul/base/src/nsMenuBarFrame.cpp @@ -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(); } diff --git a/mozilla/layout/xul/base/src/nsMenuBarFrame.h b/mozilla/layout/xul/base/src/nsMenuBarFrame.h index 254ea244935..6a71d4bb9df 100644 --- a/mozilla/layout/xul/base/src/nsMenuBarFrame.h +++ b/mozilla/layout/xul/base/src/nsMenuBarFrame.h @@ -109,7 +109,7 @@ public: nsIFrame* aParent, nsIFrame* aPrevInFlow); - NS_IMETHOD Destroy(nsPresContext* aPresContext); + virtual void Destroy(); // Non-interface helpers diff --git a/mozilla/layout/xul/base/src/nsMenuFrame.cpp b/mozilla/layout/xul/base/src/nsMenuFrame.cpp index b568ffd8b05..eed7970d9bf 100644 --- a/mozilla/layout/xul/base/src/nsMenuFrame.cpp +++ b/mozilla/layout/xul/base/src/nsMenuFrame.cpp @@ -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); diff --git a/mozilla/layout/xul/base/src/nsMenuFrame.h b/mozilla/layout/xul/base/src/nsMenuFrame.h index 2a6384ef5ab..4534c394d78 100644 --- a/mozilla/layout/xul/base/src/nsMenuFrame.h +++ b/mozilla/layout/xul/base/src/nsMenuFrame.h @@ -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, diff --git a/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp b/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp index af88e2d9c0d..8e52882b8ec 100644 --- a/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp +++ b/mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp @@ -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 diff --git a/mozilla/layout/xul/base/src/nsMenuPopupFrame.h b/mozilla/layout/xul/base/src/nsMenuPopupFrame.h index a3e276587e2..33491ce9b3e 100644 --- a/mozilla/layout/xul/base/src/nsMenuPopupFrame.h +++ b/mozilla/layout/xul/base/src/nsMenuPopupFrame.h @@ -152,7 +152,7 @@ public: nsGUIEvent* aEvent, nsEventStatus* aEventStatus); - NS_IMETHOD Destroy(nsPresContext* aPresContext); + virtual void Destroy(); virtual nsresult CreateWidgetForView(nsIView* aView); diff --git a/mozilla/layout/xul/base/src/nsPopupSetFrame.cpp b/mozilla/layout/xul/base/src/nsPopupSetFrame.cpp index ff80ceb3c70..f0abccdec3f 100644 --- a/mozilla/layout/xul/base/src/nsPopupSetFrame.cpp +++ b/mozilla/layout/xul/base/src/nsPopupSetFrame.cpp @@ -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; diff --git a/mozilla/layout/xul/base/src/nsPopupSetFrame.h b/mozilla/layout/xul/base/src/nsPopupSetFrame.h index acbd042dfdf..d6e917ca293 100644 --- a/mozilla/layout/xul/base/src/nsPopupSetFrame.h +++ b/mozilla/layout/xul/base/src/nsPopupSetFrame.h @@ -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); diff --git a/mozilla/layout/xul/base/src/nsProgressMeterFrame.cpp b/mozilla/layout/xul/base/src/nsProgressMeterFrame.cpp index a59ad98ed61..24324ac8dd0 100644 --- a/mozilla/layout/xul/base/src/nsProgressMeterFrame.cpp +++ b/mozilla/layout/xul/base/src/nsProgressMeterFrame.cpp @@ -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; } diff --git a/mozilla/layout/xul/base/src/nsProgressMeterFrame.h b/mozilla/layout/xul/base/src/nsProgressMeterFrame.h index abde5df3139..66e61ea307f 100644 --- a/mozilla/layout/xul/base/src/nsProgressMeterFrame.h +++ b/mozilla/layout/xul/base/src/nsProgressMeterFrame.h @@ -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, diff --git a/mozilla/layout/xul/base/src/nsScrollBoxFrame.cpp b/mozilla/layout/xul/base/src/nsScrollBoxFrame.cpp index 3983745cb64..99ffb950f64 100644 --- a/mozilla/layout/xul/base/src/nsScrollBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsScrollBoxFrame.cpp @@ -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(); } diff --git a/mozilla/layout/xul/base/src/nsScrollbarButtonFrame.cpp b/mozilla/layout/xul/base/src/nsScrollbarButtonFrame.cpp index 8fbc5b724c4..f4569e01e4f 100644 --- a/mozilla/layout/xul/base/src/nsScrollbarButtonFrame.cpp +++ b/mozilla/layout/xul/base/src/nsScrollbarButtonFrame.cpp @@ -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(); } diff --git a/mozilla/layout/xul/base/src/nsScrollbarButtonFrame.h b/mozilla/layout/xul/base/src/nsScrollbarButtonFrame.h index 0b85f7a8945..e22522d11ef 100644 --- a/mozilla/layout/xul/base/src/nsScrollbarButtonFrame.h +++ b/mozilla/layout/xul/base/src/nsScrollbarButtonFrame.h @@ -58,7 +58,7 @@ public: nsButtonBoxFrame(aPresShell, aContext) {} // Overrides - NS_IMETHOD Destroy(nsPresContext* aPresContext); + virtual void Destroy(); friend nsIFrame* NS_NewScrollBarButtonFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); diff --git a/mozilla/layout/xul/base/src/nsSliderFrame.cpp b/mozilla/layout/xul/base/src/nsSliderFrame.cpp index e4ded0b6d7d..3733285276f 100644 --- a/mozilla/layout/xul/base/src/nsSliderFrame.cpp +++ b/mozilla/layout/xul/base/src/nsSliderFrame.cpp @@ -726,11 +726,10 @@ nsSliderFrame::SetCurrentPosition(nsIContent* scrollbar, nsIFrame* aThumbFrame, } NS_IMETHODIMP -nsSliderFrame::SetInitialChildList(nsPresContext* aPresContext, - nsIAtom* aListName, - nsIFrame* aChildList) +nsSliderFrame::SetInitialChildList(nsIAtom* aListName, + nsIFrame* aChildList) { - nsresult r = nsBoxFrame::SetInitialChildList(aPresContext, aListName, aChildList); + nsresult r = nsBoxFrame::SetInitialChildList(aListName, aChildList); AddListener(); @@ -950,8 +949,8 @@ nsSliderFrame::HandleRelease(nsPresContext* aPresContext, return NS_OK; } -NS_IMETHODIMP -nsSliderFrame::Destroy(nsPresContext* aPresContext) +void +nsSliderFrame::Destroy() { // tell our mediator if we have one we are gone. if (mMediator) { @@ -961,7 +960,7 @@ nsSliderFrame::Destroy(nsPresContext* aPresContext) } // call base class Destroy() - return nsBoxFrame::Destroy(aPresContext); + nsBoxFrame::Destroy(); } NS_IMETHODIMP diff --git a/mozilla/layout/xul/base/src/nsSliderFrame.h b/mozilla/layout/xul/base/src/nsSliderFrame.h index 592fa298a39..d560e59fa08 100644 --- a/mozilla/layout/xul/base/src/nsSliderFrame.h +++ b/mozilla/layout/xul/base/src/nsSliderFrame.h @@ -150,7 +150,7 @@ public: NS_IMETHOD RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame); - NS_IMETHOD Destroy(nsPresContext* aPresContext); + virtual void Destroy(); NS_IMETHOD BuildDisplayListForChildren(nsDisplayListBuilder* aBuilder, const nsRect& aDirtyRect, @@ -175,8 +175,7 @@ public: nsGUIEvent* aEvent, nsEventStatus* aEventStatus); - NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext, - nsIAtom* aListName, + NS_IMETHOD SetInitialChildList(nsIAtom* aListName, nsIFrame* aChildList); NS_IMETHOD MouseDown(nsIDOMEvent* aMouseEvent); diff --git a/mozilla/layout/xul/base/src/nsTextBoxFrame.cpp b/mozilla/layout/xul/base/src/nsTextBoxFrame.cpp index 2488813c1b2..aec823951fb 100644 --- a/mozilla/layout/xul/base/src/nsTextBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsTextBoxFrame.cpp @@ -120,22 +120,21 @@ nsTextBoxFrame::AttributeChanged(PRInt32 aNameSpaceID, mState |= NS_STATE_NEED_LAYOUT; PRBool aResize; PRBool aRedraw; - nsPresContext* presContext = GetPresContext(); - UpdateAttributes(presContext, aAttribute, aResize, aRedraw); + UpdateAttributes(aAttribute, aResize, aRedraw); if (aResize) { - nsBoxLayoutState state(presContext); + nsBoxLayoutState state(GetPresContext()); MarkDirty(state); } else if (aRedraw) { - nsBoxLayoutState state(presContext); + nsBoxLayoutState state(GetPresContext()); Redraw(state); } // 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(presContext, PR_TRUE); + RegUnregAccessKey(PR_TRUE); return NS_OK; } @@ -158,28 +157,25 @@ nsTextBoxFrame::Init(nsIContent* aContent, nsIFrame* aParent, nsIFrame* aPrevInFlow) { - nsresult rv = nsTextBoxFrameSuper::Init(aContent, aParent, aPrevInFlow); - - nsPresContext *presContext = GetPresContext(); + nsTextBoxFrameSuper::Init(aContent, aParent, aPrevInFlow); mState |= NS_STATE_NEED_LAYOUT; PRBool aResize; PRBool aRedraw; - UpdateAttributes(presContext, nsnull, aResize, aRedraw); /* update all */ + UpdateAttributes(nsnull, aResize, aRedraw); /* update all */ // register access key - RegUnregAccessKey(presContext, PR_TRUE); + RegUnregAccessKey(PR_TRUE); return NS_OK; } -NS_IMETHODIMP -nsTextBoxFrame::Destroy(nsPresContext* aPresContext) +void +nsTextBoxFrame::Destroy() { // unregister access key - RegUnregAccessKey(aPresContext, PR_FALSE); - - return nsTextBoxFrameSuper::Destroy(aPresContext); + RegUnregAccessKey(PR_FALSE); + nsTextBoxFrameSuper::Destroy(); } PRBool @@ -211,8 +207,7 @@ nsTextBoxFrame::InsertSeparatorBeforeAccessKey() } void -nsTextBoxFrame::UpdateAttributes(nsPresContext* aPresContext, - nsIAtom* aAttribute, +nsTextBoxFrame::UpdateAttributes(nsIAtom* aAttribute, PRBool& aResize, PRBool& aRedraw) { @@ -927,8 +922,7 @@ nsTextBoxFrame::GetFrameName(nsAString& aResult) const // If you make changes to this function, check its counterparts // in nsBoxFrame and nsAreaFrame nsresult -nsTextBoxFrame::RegUnregAccessKey(nsPresContext* aPresContext, - PRBool aDoReg) +nsTextBoxFrame::RegUnregAccessKey(PRBool aDoReg) { // if we have no content, we can't do anything if (!mContent) @@ -956,7 +950,7 @@ nsTextBoxFrame::RegUnregAccessKey(nsPresContext* aPresContext, // With a valid PresContext we can get the ESM // and (un)register the access key - nsIEventStateManager *esm = aPresContext->EventStateManager(); + nsIEventStateManager *esm = GetPresContext()->EventStateManager(); PRUint32 key = accessKey.First(); if (aDoReg) diff --git a/mozilla/layout/xul/base/src/nsTextBoxFrame.h b/mozilla/layout/xul/base/src/nsTextBoxFrame.h index 9e7008121ce..6d84107e59b 100644 --- a/mozilla/layout/xul/base/src/nsTextBoxFrame.h +++ b/mozilla/layout/xul/base/src/nsTextBoxFrame.h @@ -62,7 +62,7 @@ public: nsIFrame* aParent, nsIFrame* asPrevInFlow); - NS_IMETHOD Destroy(nsPresContext* aPresContext); + virtual void Destroy(); NS_IMETHOD AttributeChanged(PRInt32 aNameSpaceID, nsIAtom* aAttribute, @@ -72,8 +72,7 @@ public: NS_IMETHOD GetFrameName(nsAString& aResult) const; #endif - void UpdateAttributes(nsPresContext* aPresContext, - nsIAtom* aAttribute, + void UpdateAttributes(nsIAtom* aAttribute, PRBool& aResize, PRBool& aRedraw); @@ -113,8 +112,7 @@ protected: nsSize& aSize, nscoord& aAscent); - nsresult RegUnregAccessKey(nsPresContext* aPresContext, - PRBool aDoReg); + nsresult RegUnregAccessKey(PRBool aDoReg); private: diff --git a/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp b/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp index 8748621792e..06557430107 100644 --- a/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp +++ b/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp @@ -346,12 +346,12 @@ nsTreeBodyFrame::CalcMaxRowWidth() return mStringWidth; } -NS_IMETHODIMP -nsTreeBodyFrame::Destroy(nsPresContext* aPresContext) +void +nsTreeBodyFrame::Destroy() { // Make sure we cancel any posted callbacks. if (mReflowCallbackPosted) { - aPresContext->PresShell()->CancelReflowCallback(this); + GetPresContext()->PresShell()->CancelReflowCallback(this); mReflowCallbackPosted = PR_FALSE; } @@ -384,7 +384,7 @@ nsTreeBodyFrame::Destroy(nsPresContext* aPresContext) mView = nsnull; } - return nsLeafBoxFrame::Destroy(aPresContext); + nsLeafBoxFrame::Destroy(); } void diff --git a/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.h b/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.h index 382cd4575a3..51ab1bb3912 100644 --- a/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.h +++ b/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.h @@ -103,7 +103,8 @@ public: NS_IMETHOD Init(nsIContent* aContent, nsIFrame* aParent, nsIFrame* aPrevInFlow); - NS_IMETHOD Destroy(nsPresContext* aPresContext); + virtual void Destroy(); + NS_IMETHOD GetCursor(const nsPoint& aPoint, nsIFrame::Cursor& aCursor); diff --git a/mozilla/layout/xul/base/src/tree/src/nsTreeColFrame.cpp b/mozilla/layout/xul/base/src/tree/src/nsTreeColFrame.cpp index 157e831019a..b94a9a36a2a 100644 --- a/mozilla/layout/xul/base/src/tree/src/nsTreeColFrame.cpp +++ b/mozilla/layout/xul/base/src/tree/src/nsTreeColFrame.cpp @@ -98,12 +98,12 @@ nsTreeColFrame::Init(nsIContent* aContent, return rv; } -NS_IMETHODIMP -nsTreeColFrame::Destroy(nsPresContext* aPresContext) +void +nsTreeColFrame::Destroy() { if (mColumns) mColumns->InvalidateColumns(); - return nsBoxFrame::Destroy(aPresContext); + nsBoxFrame::Destroy(); } class nsDisplayXULTreeColSplitterTarget : public nsDisplayItem { diff --git a/mozilla/layout/xul/base/src/tree/src/nsTreeColFrame.h b/mozilla/layout/xul/base/src/tree/src/nsTreeColFrame.h index 8c537fc628e..a106c3b5c89 100644 --- a/mozilla/layout/xul/base/src/tree/src/nsTreeColFrame.h +++ b/mozilla/layout/xul/base/src/tree/src/nsTreeColFrame.h @@ -59,7 +59,7 @@ public: nsIFrame* aParent, nsIFrame* aPrevInFlow); - NS_IMETHOD Destroy(nsPresContext* aPresContext); + virtual void Destroy(); NS_IMETHOD BuildDisplayListForChildren(nsDisplayListBuilder* aBuilder, const nsRect& aDirtyRect,