backing out roc's patch for bug 328926 due to crash running tests on vc8 machines.

This commit is contained in:
pavlov%pavlov.net 2006-03-15 06:43:36 +00:00
Родитель cdc7ad6d9b
Коммит 131e8794e2
109 изменённых файлов: 677 добавлений и 539 удалений

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

@ -357,7 +357,7 @@ nsBidiPresUtils::Resolve(nsPresContext* aPresContext,
} // if (runLength <= 0)
if (nsLayoutAtoms::directionalFrame == frameType) {
frame->Destroy();
frame->Destroy(aPresContext);
frame = nsnull;
++lineOffset;
}
@ -858,7 +858,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();
frame->Destroy(aPresContext);
++aOffset;
}
else {

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

@ -403,7 +403,8 @@ static PRInt32 FFWC_slowSearchForText=0;
#endif
static nsresult
DeletingFrameSubtree(nsFrameManager* aFrameManager,
DeletingFrameSubtree(nsPresContext* aPresContext,
nsFrameManager* aFrameManager,
nsIFrame* aFrame);
#ifdef MOZ_SVG
@ -669,7 +670,8 @@ MarkIBSpecialPrevSibling(nsPresContext* aPresContext,
// added to the frame hierarchy.
// XXXbz it would really help if we merged the two methods somehow... :(
static void
DoCleanupFrameReferences(nsFrameManager* aFrameManager,
DoCleanupFrameReferences(nsPresContext* aPresContext,
nsFrameManager* aFrameManager,
nsIFrame* aFrameIn)
{
nsIContent* content = aFrameIn->GetContent();
@ -689,7 +691,7 @@ DoCleanupFrameReferences(nsFrameManager* aFrameManager,
// Remove the mapping from the content object to its frame
aFrameManager->SetPrimaryFrameFor(content, nsnull);
aFrameIn->RemovedAsPrimaryFrame();
aFrameIn->RemovedAsPrimaryFrame(aPresContext);
aFrameManager->ClearAllUndisplayedContentIn(content);
// Recursively walk the child frames.
@ -698,7 +700,7 @@ DoCleanupFrameReferences(nsFrameManager* aFrameManager,
do {
nsIFrame* childFrame = aFrameIn->GetFirstChild(childListName);
while (childFrame) {
DoCleanupFrameReferences(aFrameManager, childFrame);
DoCleanupFrameReferences(aPresContext, aFrameManager, childFrame);
// Get the next sibling child frame
childFrame = childFrame->GetNextSibling();
@ -710,11 +712,12 @@ DoCleanupFrameReferences(nsFrameManager* aFrameManager,
// Helper function that walks a frame list and calls DoCleanupFrameReference()
static void
CleanupFrameReferences(nsFrameManager* aFrameManager,
CleanupFrameReferences(nsPresContext* aPresContext,
nsFrameManager* aFrameManager,
nsIFrame* aFrameList)
{
while (aFrameList) {
DoCleanupFrameReferences(aFrameManager, aFrameList);
DoCleanupFrameReferences(aPresContext, aFrameManager, aFrameList);
// Get the sibling frame
aFrameList = aFrameList->GetNextSibling();
@ -1416,8 +1419,9 @@ 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(mFrameManager, aNewFrame);
aNewFrame->Destroy();
CleanupFrameReferences(mPresContext, mFrameManager,
aNewFrame);
aNewFrame->Destroy(mPresContext);
return rv;
}
@ -1493,7 +1497,9 @@ nsFrameConstructorState::ProcessFrameInsertions(nsAbsoluteItems& aFrameItems,
nsIFrame* firstChild = containingBlock->GetFirstChild(aChildListName);
nsresult rv = NS_OK;
if (!firstChild && (containingBlock->GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
rv = containingBlock->SetInitialChildList(aChildListName, firstNewFrame);
rv = containingBlock->SetInitialChildList(mPresContext,
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
@ -2042,7 +2048,7 @@ nsCSSFrameConstructor::CreateAttributeContent(nsIContent* aParentContent,
rv = textFrame->Init(content, aParentFrame, aStyleContext, nsnull);
if (NS_FAILED(rv)) {
content->UnbindFromTree();
textFrame->Destroy();
textFrame->Destroy(mPresShell->GetPresContext());
textFrame = nsnull;
content = nsnull;
}
@ -2070,6 +2076,7 @@ nsCSSFrameConstructor::CreateGeneratedFrameFor(nsIFrame* aParentFram
nsStyleContentType type = data.mType;
nsCOMPtr<nsIContent> content;
nsPresContext* presContext = mPresShell->GetPresContext();
if (eStyleContentType_Image == type) {
if (!data.mContent.mImage) {
@ -2112,7 +2119,7 @@ nsCSSFrameConstructor::CreateGeneratedFrameFor(nsIFrame* aParentFram
rv = imageFrame->Init(content, aParentFrame, aStyleContext, nsnull);
if (NS_FAILED(rv)) {
imageFrame->Destroy();
imageFrame->Destroy(presContext);
return rv == NS_ERROR_FRAME_REPLACED ? NS_OK : rv;
}
@ -2387,7 +2394,7 @@ nsCSSFrameConstructor::CreateGeneratedContentFrame(nsFrameConstructorState& aSta
}
if (childFrames.childList) {
containerFrame->SetInitialChildList(nsnull, childFrames.childList);
containerFrame->SetInitialChildList(aState.mPresContext, nsnull, childFrames.childList);
}
*aResult = containerFrame;
return PR_TRUE;
@ -2589,15 +2596,17 @@ GetCaptionAdjustedParent(nsIFrame* aParentFrame,
}
static nsresult
ProcessPseudoFrame(nsPseudoFrameData& aPseudoData,
ProcessPseudoFrame(nsPresContext* aPresContext,
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(nsnull, items->childList);
rv = aParent->SetInitialChildList(aPresContext, nsnull, items->childList);
if (NS_FAILED(rv)) return rv;
}
aPseudoData.Reset();
@ -2605,43 +2614,47 @@ ProcessPseudoFrame(nsPseudoFrameData& aPseudoData,
}
static nsresult
ProcessPseudoTableFrame(nsPseudoFrames& aPseudoFrames,
ProcessPseudoTableFrame(nsPresContext* aPresContext,
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(aPseudoFrames.mColGroup, aParent);
rv = ProcessPseudoFrame(aPresContext, aPseudoFrames.mColGroup, aParent);
}
// process the inner table frame
rv = ProcessPseudoFrame(aPseudoFrames.mTableInner, aParent);
rv = ProcessPseudoFrame(aPresContext, aPseudoFrames.mTableInner, aParent);
// process the outer table frame
aParent = aPseudoFrames.mTableOuter.mFrame;
nsFrameItems* items = &aPseudoFrames.mTableOuter.mChildList;
if (items && items->childList) {
rv = aParent->SetInitialChildList(nsnull, items->childList);
rv = aParent->SetInitialChildList(aPresContext, nsnull, items->childList);
if (NS_FAILED(rv)) return rv;
}
nsFrameItems* captions = &aPseudoFrames.mTableOuter.mChildList2;
if (captions && captions->childList) {
rv = aParent->SetInitialChildList(nsLayoutAtoms::captionList, captions->childList);
rv = aParent->SetInitialChildList(aPresContext, nsLayoutAtoms::captionList, captions->childList);
}
aPseudoFrames.mTableOuter.Reset();
return rv;
}
static nsresult
ProcessPseudoCellFrame(nsPseudoFrames& aPseudoFrames,
ProcessPseudoCellFrame(nsPresContext* aPresContext,
nsPseudoFrames& aPseudoFrames,
nsIFrame*& aParent)
{
nsresult rv = NS_OK;
if (!aPresContext) return rv;
rv = ProcessPseudoFrame(aPseudoFrames.mCellInner, aParent);
rv = ProcessPseudoFrame(aPresContext, aPseudoFrames.mCellInner, aParent);
if (NS_FAILED(rv)) return rv;
rv = ProcessPseudoFrame(aPseudoFrames.mCellOuter, aParent);
rv = ProcessPseudoFrame(aPresContext, aPseudoFrames.mCellOuter, aParent);
return rv;
}
@ -2664,6 +2677,7 @@ ProcessPseudoFrames(nsFrameConstructorState& aState,
#endif
nsPseudoFrames& pseudoFrames = aState.mPseudoFrames;
nsPresContext* presContext = aState.mPresContext;
if (nsLayoutAtoms::tableFrame == pseudoFrames.mLowestType) {
// if the processing should be limited to the colgroup frame and the
@ -2672,79 +2686,80 @@ ProcessPseudoFrames(nsFrameConstructorState& aState,
// and leave the table frame untouched.
if (nsLayoutAtoms::tableColGroupFrame == aHighestType) {
if (pseudoFrames.mColGroup.mFrame) {
rv = ProcessPseudoFrame(pseudoFrames.mColGroup, aHighestFrame);
rv = ProcessPseudoFrame(presContext, pseudoFrames.mColGroup,
aHighestFrame);
}
return rv;
}
rv = ProcessPseudoTableFrame(pseudoFrames, aHighestFrame);
rv = ProcessPseudoTableFrame(presContext, pseudoFrames, aHighestFrame);
if (nsLayoutAtoms::tableOuterFrame == aHighestType) return rv;
if (pseudoFrames.mCellOuter.mFrame) {
rv = ProcessPseudoCellFrame(pseudoFrames, aHighestFrame);
rv = ProcessPseudoCellFrame(presContext, pseudoFrames, aHighestFrame);
if (IS_TABLE_CELL(aHighestType)) return rv;
}
if (pseudoFrames.mRow.mFrame) {
rv = ProcessPseudoFrame(pseudoFrames.mRow, aHighestFrame);
rv = ProcessPseudoFrame(presContext, pseudoFrames.mRow, aHighestFrame);
if (nsLayoutAtoms::tableRowFrame == aHighestType) return rv;
}
if (pseudoFrames.mRowGroup.mFrame) {
rv = ProcessPseudoFrame(pseudoFrames.mRowGroup, aHighestFrame);
rv = ProcessPseudoFrame(presContext, pseudoFrames.mRowGroup, aHighestFrame);
if (nsLayoutAtoms::tableRowGroupFrame == aHighestType) return rv;
}
}
else if (nsLayoutAtoms::tableRowGroupFrame == pseudoFrames.mLowestType) {
rv = ProcessPseudoFrame(pseudoFrames.mRowGroup, aHighestFrame);
rv = ProcessPseudoFrame(presContext, pseudoFrames.mRowGroup, aHighestFrame);
if (nsLayoutAtoms::tableRowGroupFrame == aHighestType) return rv;
if (pseudoFrames.mTableOuter.mFrame) {
rv = ProcessPseudoTableFrame(pseudoFrames, aHighestFrame);
rv = ProcessPseudoTableFrame(presContext, pseudoFrames, aHighestFrame);
if (nsLayoutAtoms::tableOuterFrame == aHighestType) return rv;
}
if (pseudoFrames.mCellOuter.mFrame) {
rv = ProcessPseudoCellFrame(pseudoFrames, aHighestFrame);
rv = ProcessPseudoCellFrame(presContext, pseudoFrames, aHighestFrame);
if (IS_TABLE_CELL(aHighestType)) return rv;
}
if (pseudoFrames.mRow.mFrame) {
rv = ProcessPseudoFrame(pseudoFrames.mRow, aHighestFrame);
rv = ProcessPseudoFrame(presContext, pseudoFrames.mRow, aHighestFrame);
if (nsLayoutAtoms::tableRowFrame == aHighestType) return rv;
}
}
else if (nsLayoutAtoms::tableRowFrame == pseudoFrames.mLowestType) {
rv = ProcessPseudoFrame(pseudoFrames.mRow, aHighestFrame);
rv = ProcessPseudoFrame(presContext, pseudoFrames.mRow, aHighestFrame);
if (nsLayoutAtoms::tableRowFrame == aHighestType) return rv;
if (pseudoFrames.mRowGroup.mFrame) {
rv = ProcessPseudoFrame(pseudoFrames.mRowGroup, aHighestFrame);
rv = ProcessPseudoFrame(presContext, pseudoFrames.mRowGroup, aHighestFrame);
if (nsLayoutAtoms::tableRowGroupFrame == aHighestType) return rv;
}
if (pseudoFrames.mTableOuter.mFrame) {
rv = ProcessPseudoTableFrame(pseudoFrames, aHighestFrame);
rv = ProcessPseudoTableFrame(presContext, pseudoFrames, aHighestFrame);
if (nsLayoutAtoms::tableOuterFrame == aHighestType) return rv;
}
if (pseudoFrames.mCellOuter.mFrame) {
rv = ProcessPseudoCellFrame(pseudoFrames, aHighestFrame);
rv = ProcessPseudoCellFrame(presContext, pseudoFrames, aHighestFrame);
if (IS_TABLE_CELL(aHighestType)) return rv;
}
}
else if (IS_TABLE_CELL(pseudoFrames.mLowestType)) {
rv = ProcessPseudoCellFrame(pseudoFrames, aHighestFrame);
rv = ProcessPseudoCellFrame(presContext, pseudoFrames, aHighestFrame);
if (IS_TABLE_CELL(aHighestType)) return rv;
if (pseudoFrames.mRow.mFrame) {
rv = ProcessPseudoFrame(pseudoFrames.mRow, aHighestFrame);
rv = ProcessPseudoFrame(presContext, pseudoFrames.mRow, aHighestFrame);
if (nsLayoutAtoms::tableRowFrame == aHighestType) return rv;
}
if (pseudoFrames.mRowGroup.mFrame) {
rv = ProcessPseudoFrame(pseudoFrames.mRowGroup, aHighestFrame);
rv = ProcessPseudoFrame(presContext, pseudoFrames.mRowGroup, aHighestFrame);
if (nsLayoutAtoms::tableRowGroupFrame == aHighestType) return rv;
}
if (pseudoFrames.mTableOuter.mFrame) {
rv = ProcessPseudoTableFrame(pseudoFrames, aHighestFrame);
rv = ProcessPseudoTableFrame(presContext, pseudoFrames, aHighestFrame);
}
}
else if (pseudoFrames.mColGroup.mFrame) {
// process the col group frame
rv = ProcessPseudoFrame(pseudoFrames.mColGroup, aHighestFrame);
rv = ProcessPseudoFrame(presContext, pseudoFrames.mColGroup, aHighestFrame);
}
return rv;
@ -3623,7 +3638,8 @@ nsCSSFrameConstructor::ConstructTableFrame(nsFrameConstructorState& aState,
if (!aIsPseudo) {
// Put the newly created frames into the right child list
aNewOuterFrame->SetInitialChildList(nsnull, aNewInnerFrame);
aNewOuterFrame->SetInitialChildList(aState.mPresContext, nsnull,
aNewInnerFrame);
rv = aState.AddChild(aNewOuterFrame, *frameItems, disp, aContent,
outerStyleContext, parentFrame);
if (NS_FAILED(rv)) {
@ -3643,11 +3659,13 @@ nsCSSFrameConstructor::ConstructTableFrame(nsFrameConstructorState& aState,
PR_FALSE, childItems);
// Set the inner table frame's initial primary list
aNewInnerFrame->SetInitialChildList(nsnull, childItems.childList);
aNewInnerFrame->SetInitialChildList(aState.mPresContext, nsnull,
childItems.childList);
// Set the outer table frame's primary and option lists
if (captionFrame) {
aNewOuterFrame->SetInitialChildList(nsLayoutAtoms::captionList,
aNewOuterFrame->SetInitialChildList(aState.mPresContext,
nsLayoutAtoms::captionList,
captionFrame);
}
}
@ -3701,7 +3719,8 @@ nsCSSFrameConstructor::ConstructTableCaptionFrame(nsFrameConstructorState& aStat
rv = ProcessChildren(aState, aContent, aNewFrame,
PR_TRUE, childItems, PR_TRUE, nsnull);
if (NS_FAILED(rv)) return rv;
aNewFrame->SetInitialChildList(nsnull, childItems.childList);
aNewFrame->SetInitialChildList(aState.mPresContext, nsnull,
childItems.childList);
if (aIsPseudoParent) {
aState.mPseudoFrames.mTableOuter.mChildList2.AddChild(aNewFrame);
}
@ -3770,7 +3789,8 @@ nsCSSFrameConstructor::ConstructTableRowGroupFrame(nsFrameConstructorState& aSta
CreateAnonymousFrames(nsnull, aState, aContent, aNewFrame,
PR_FALSE, childItems);
aNewFrame->SetInitialChildList(nsnull, childItems.childList);
aNewFrame->SetInitialChildList(aState.mPresContext, nsnull,
childItems.childList);
if (aIsPseudoParent) {
nsIFrame* child = (scrollFrame) ? scrollFrame : aNewFrame;
aState.mPseudoFrames.mTableInner.mChildList.AddChild(child);
@ -3827,7 +3847,8 @@ nsCSSFrameConstructor::ConstructTableColGroupFrame(nsFrameConstructorState& aSta
rv = TableProcessChildren(aState, aContent, aNewFrame, aTableCreator,
childItems, captionFrame);
if (NS_FAILED(rv)) return rv;
aNewFrame->SetInitialChildList(nsnull, childItems.childList);
aNewFrame->SetInitialChildList(aState.mPresContext, nsnull,
childItems.childList);
if (aIsPseudoParent) {
aState.mPseudoFrames.mTableInner.mChildList.AddChild(aNewFrame);
}
@ -3883,7 +3904,8 @@ nsCSSFrameConstructor::ConstructTableRowFrame(nsFrameConstructorState& aState,
CreateAnonymousFrames(nsnull, aState, aContent, aNewFrame,
PR_FALSE, childItems);
aNewFrame->SetInitialChildList(nsnull, childItems.childList);
aNewFrame->SetInitialChildList(aState.mPresContext, nsnull,
childItems.childList);
if (aIsPseudoParent) {
aState.mPseudoFrames.mRowGroup.mChildList.AddChild(aNewFrame);
}
@ -4001,7 +4023,7 @@ nsCSSFrameConstructor::ConstructTableCellFrame(nsFrameConstructorState& aState,
aNewCellInnerFrame = aTableCreator.CreateTableCellInnerFrame();
if (NS_UNLIKELY(!aNewCellInnerFrame)) {
aNewCellOuterFrame->Destroy();
aNewCellOuterFrame->Destroy(aState.mPresContext);
aNewCellOuterFrame = nsnull;
return NS_ERROR_OUT_OF_MEMORY;
}
@ -4033,15 +4055,18 @@ nsCSSFrameConstructor::ConstructTableCellFrame(nsFrameConstructorState& aState,
if (NS_FAILED(rv)) {
// Clean up
// XXXbz kids of this stuff need to be cleaned up too!
aNewCellInnerFrame->Destroy();
aNewCellInnerFrame->Destroy(aState.mPresContext);
aNewCellInnerFrame = nsnull;
aNewCellOuterFrame->Destroy();
aNewCellOuterFrame->Destroy(aState.mPresContext);
aNewCellOuterFrame = nsnull;
return rv;
}
aNewCellInnerFrame->SetInitialChildList(nsnull, childItems.childList);
aNewCellOuterFrame->SetInitialChildList(nsnull, aNewCellInnerFrame);
aNewCellInnerFrame->SetInitialChildList(aState.mPresContext, nsnull,
childItems.childList);
aNewCellOuterFrame->SetInitialChildList(aState.mPresContext, nsnull,
aNewCellInnerFrame);
if (aIsPseudoParent) {
aState.mPseudoFrames.mRow.mChildList.AddChild(aNewCellOuterFrame);
}
@ -4672,7 +4697,8 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsFrameConstructorState& aState,
isBlockFrame);
// Set the initial child lists
contentFrame->SetInitialChildList(nsnull, childItems.childList);
contentFrame->SetInitialChildList(aState.mPresContext, nsnull,
childItems.childList);
}
return NS_OK;
@ -4916,14 +4942,14 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIContent* aDocElement,
nsIFrame *pageFrame, *pageContentFrame;
ConstructPageFrame(mPresShell, presContext, rootFrame, nsnull,
pageFrame, pageContentFrame);
rootFrame->SetInitialChildList(nsnull, pageFrame);
rootFrame->SetInitialChildList(presContext, 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(nsnull, newFrame);
viewportFrame->SetInitialChildList(presContext, nsnull, newFrame);
*aNewFrame = viewportFrame;
@ -4974,7 +5000,7 @@ nsCSSFrameConstructor::ConstructPageFrame(nsIPresShell* aPresShell,
return NS_ERROR_NULL_POINTER;
mFixedContainingBlock = aPageContentFrame;
aPageFrame->SetInitialChildList(nsnull, aPageContentFrame);
aPageFrame->SetInitialChildList(aPresContext, nsnull, aPageContentFrame);
// Fixed pos kids are taken care of directly in CreateContinuingFrame()
@ -5088,7 +5114,7 @@ nsCSSFrameConstructor::ConstructButtonFrame(nsFrameConstructorState& aState,
aState.GetGeometricParent(aStyleDisplay, aParentFrame),
aStyleContext, nsnull, buttonFrame);
if (NS_FAILED(rv)) {
buttonFrame->Destroy();
buttonFrame->Destroy(aState.mPresContext);
return rv;
}
// See if we need to create a view, e.g. the frame is absolutely positioned
@ -5097,7 +5123,7 @@ nsCSSFrameConstructor::ConstructButtonFrame(nsFrameConstructorState& aState,
nsIFrame* areaFrame = NS_NewAreaFrame(mPresShell, NS_BLOCK_SPACE_MGR | NS_BLOCK_SHRINK_WRAP);
if (NS_UNLIKELY(!areaFrame)) {
buttonFrame->Destroy();
buttonFrame->Destroy(aState.mPresContext);
return NS_ERROR_OUT_OF_MEMORY;
}
@ -5108,16 +5134,16 @@ nsCSSFrameConstructor::ConstructButtonFrame(nsFrameConstructorState& aState,
rv = InitAndRestoreFrame(aState, aContent, buttonFrame, styleContext, nsnull,
areaFrame);
if (NS_FAILED(rv)) {
areaFrame->Destroy();
buttonFrame->Destroy();
areaFrame->Destroy(aState.mPresContext);
buttonFrame->Destroy(aState.mPresContext);
return rv;
}
rv = aState.AddChild(buttonFrame, aFrameItems, aStyleDisplay, aContent,
aStyleContext, aParentFrame);
if (NS_FAILED(rv)) {
areaFrame->Destroy();
buttonFrame->Destroy();
areaFrame->Destroy(aState.mPresContext);
buttonFrame->Destroy(aState.mPresContext);
return rv;
}
@ -5148,10 +5174,11 @@ nsCSSFrameConstructor::ConstructButtonFrame(nsFrameConstructorState& aState,
if (NS_FAILED(rv)) return rv;
// Set the areas frame's initial child lists
areaFrame->SetInitialChildList(nsnull, childItems.childList);
areaFrame->SetInitialChildList(aState.mPresContext, nsnull,
childItems.childList);
}
buttonFrame->SetInitialChildList(nsnull, areaFrame);
buttonFrame->SetInitialChildList(aState.mPresContext, nsnull, areaFrame);
nsFrameItems anonymousChildItems;
// if there are any anonymous children create frames for them
@ -5273,13 +5300,15 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsFrameConstructorState& aState,
CreateAnonymousFrames(nsHTMLAtoms::combobox, aState, aContent,
comboboxFrame, PR_TRUE, childItems);
comboboxFrame->SetInitialChildList(nsnull, childItems.childList);
comboboxFrame->SetInitialChildList(aState.mPresContext, nsnull,
childItems.childList);
// Initialize the additional popup child list which contains the
// dropdown list frame.
nsFrameItems popupItems;
popupItems.AddChild(listFrame);
comboboxFrame->SetInitialChildList(nsLayoutAtoms::popupList,
comboboxFrame->SetInitialChildList(aState.mPresContext,
nsLayoutAtoms::popupList,
popupItems.childList);
aNewFrame = comboboxFrame;
@ -5412,7 +5441,8 @@ nsCSSFrameConstructor::InitializeSelectFrame(nsFrameConstructorState& aState,
childItems, PR_TRUE);
// Set the scrolled frame's initial child lists
scrolledFrame->SetInitialChildList(nsnull, childItems.childList);
scrolledFrame->SetInitialChildList(aState.mPresContext, nsnull,
childItems.childList);
return NS_OK;
}
@ -5508,10 +5538,12 @@ nsCSSFrameConstructor::ConstructFieldSetFrame(nsFrameConstructorState& aState,
}
// Set the scrolled frame's initial child lists
areaFrame->SetInitialChildList(nsnull, childItems.childList);
areaFrame->SetInitialChildList(aState.mPresContext, nsnull,
childItems.childList);
// Set the scroll frame's initial child list
newFrame->SetInitialChildList(nsnull, legendFrame ? legendFrame : areaFrame);
newFrame->SetInitialChildList(aState.mPresContext, nsnull,
legendFrame ? legendFrame : areaFrame);
// our new frame retured is the top frame which is the list frame.
aNewFrame = newFrame;
@ -5563,14 +5595,14 @@ nsCSSFrameConstructor::ConstructTextFrame(nsFrameConstructorState& aState,
nsnull, newFrame);
if (NS_FAILED(rv)) {
newFrame->Destroy();
newFrame->Destroy(aState.mPresContext);
return rv;
}
// We never need to create a view for a text frame.
// Set the frame's initial child list to null.
newFrame->SetInitialChildList(nsnull, nsnull);
newFrame->SetInitialChildList(aState.mPresContext, nsnull, nsnull);
// Add the newly constructed frame to the flow
aFrameItems.AddChild(newFrame);
@ -5882,7 +5914,8 @@ nsCSSFrameConstructor::ConstructHTMLFrame(nsFrameConstructorState& aState,
// Set the frame's initial child list
if (childItems.childList) {
newFrame->SetInitialChildList(nsnull, childItems.childList);
newFrame->SetInitialChildList(aState.mPresContext, nsnull,
childItems.childList);
}
}
@ -6505,7 +6538,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
aStyleContext, nsnull, newFrame);
if (NS_FAILED(rv)) {
newFrame->Destroy();
newFrame->Destroy(aState.mPresContext);
return rv;
}
@ -6568,8 +6601,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();
placeholderFrame->Destroy();
newFrame->Destroy(aState.mPresContext);
placeholderFrame->Destroy(aState.mPresContext);
*aHaltProcessing = PR_TRUE;
return NS_OK;
}
@ -6603,7 +6636,8 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
childItems);
// Set the frame's initial child list
newFrame->SetInitialChildList(nsnull, childItems.childList);
newFrame->SetInitialChildList(aState.mPresContext, nsnull,
childItems.childList);
}
#ifdef MOZ_XUL
@ -6708,7 +6742,8 @@ nsCSSFrameConstructor::BeginBuildingScrollFrame(nsFrameConstructorState& aState,
contentStyle).get();
if (gfxScrollFrame) {
gfxScrollFrame->SetInitialChildList(nsnull, anonymousItems.childList);
gfxScrollFrame->SetInitialChildList(aState.mPresContext, nsnull,
anonymousItems.childList);
}
if (isPrintPreview && noScalingOfTwips) {
@ -7304,10 +7339,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(nsnull, outerTable);
blockFrame->SetInitialChildList(aState.mPresContext, nsnull, outerTable);
// set the block frame as the initial child of the mrow frame
newFrame->SetInitialChildList(nsnull, blockFrame);
newFrame->SetInitialChildList(aState.mPresContext, nsnull, blockFrame);
// add the new frame to the flow
// XXXbz this is wrong. What if it's out-of-flow? For that matter, this
@ -7369,7 +7404,8 @@ nsCSSFrameConstructor::ConstructMathMLFrame(nsFrameConstructorState& aState,
childItems);
// Set the frame's initial child list
newFrame->SetInitialChildList(nsnull, childItems.childList);
newFrame->SetInitialChildList(aState.mPresContext, nsnull,
childItems.childList);
if (!newFrame->IsLeaf()) {
@ -7482,7 +7518,8 @@ nsCSSFrameConstructor::ConstructXTFFrame(nsFrameConstructorState& aState,
newFrame, insertionNode, isBlock);
// Set the frame's initial child list
newFrame->SetInitialChildList(nsnull, childItems.childList);
newFrame->SetInitialChildList(aState.mPresContext, 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
@ -7867,7 +7904,8 @@ nsCSSFrameConstructor::ConstructSVGFrame(nsFrameConstructorState& aState,
PR_FALSE, childItems);
// Set the frame's initial child list
newFrame->SetInitialChildList(nsnull, childItems.childList);
newFrame->SetInitialChildList(aState.mPresContext, nsnull,
childItems.childList);
}
if (!newFrame->IsLeaf())
@ -9363,7 +9401,8 @@ 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(nsnull,
mDocElementContainingBlock->SetInitialChildList(state.mPresContext,
nsnull,
docElementFrame);
} else {
// Whoops, we've already received our initial reflow! Insert the doc.
@ -9745,7 +9784,8 @@ nsCSSFrameConstructor::ReinsertContent(nsIContent* aContainer,
* this changes
*/
static nsresult
DoDeletingFrameSubtree(nsFrameManager* aFrameManager,
DoDeletingFrameSubtree(nsPresContext* aPresContext,
nsFrameManager* aFrameManager,
nsVoidArray& aDestroyQueue,
nsIFrame* aRemovedFrame,
nsIFrame* aFrame)
@ -9754,7 +9794,7 @@ DoDeletingFrameSubtree(nsFrameManager* aFrameManager,
nsIContent* content = aFrame->GetContent();
if (content) {
aFrameManager->SetPrimaryFrameFor(content, nsnull);
aFrame->RemovedAsPrimaryFrame();
aFrame->RemovedAsPrimaryFrame(aPresContext);
aFrameManager->ClearAllUndisplayedContentIn(content);
}
@ -9766,7 +9806,7 @@ DoDeletingFrameSubtree(nsFrameManager* aFrameManager,
nsIFrame* childFrame = aFrame->GetFirstChild(childListName);
for (; childFrame; childFrame = childFrame->GetNextSibling()) {
if (NS_LIKELY(nsLayoutAtoms::placeholderFrame != childFrame->GetType())) {
DoDeletingFrameSubtree(aFrameManager, aDestroyQueue,
DoDeletingFrameSubtree(aPresContext, aFrameManager, aDestroyQueue,
aRemovedFrame, childFrame);
} else {
@ -9787,13 +9827,13 @@ DoDeletingFrameSubtree(nsFrameManager* aFrameManager,
"out-of-flow is already in the destroy queue");
aDestroyQueue.AppendElement(outOfFlowFrame);
// Recurse into the out-of-flow, it is now the aRemovedFrame.
DoDeletingFrameSubtree(aFrameManager, aDestroyQueue,
DoDeletingFrameSubtree(aPresContext, 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(aFrameManager, aDestroyQueue,
DoDeletingFrameSubtree(aPresContext, aFrameManager, aDestroyQueue,
aRemovedFrame, outOfFlowFrame);
}
}
@ -9816,7 +9856,8 @@ DoDeletingFrameSubtree(nsFrameManager* aFrameManager,
* for aFrame and each of its continuing frames
*/
static nsresult
DeletingFrameSubtree(nsFrameManager* aFrameManager,
DeletingFrameSubtree(nsPresContext* aPresContext,
nsFrameManager* aFrameManager,
nsIFrame* aFrame)
{
NS_ENSURE_TRUE(aFrame, NS_OK); // XXXldb Remove this sometime in the future.
@ -9835,7 +9876,8 @@ DeletingFrameSubtree(nsFrameManager* aFrameManager,
"DeletingFrameSubtree on a special frame. Prepare to crash.");
do {
DoDeletingFrameSubtree(aFrameManager, destroyQueue, aFrame, aFrame);
DoDeletingFrameSubtree(aPresContext, 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
@ -9890,7 +9932,8 @@ nsCSSFrameConstructor::RemoveMappingsForFrameSubtree(nsIFrame* aRemovedFrame)
// Save the frame tree's state before deleting it
CaptureStateFor(aRemovedFrame, mTempFrameTreeState);
return ::DeletingFrameSubtree(mPresShell->FrameManager(), aRemovedFrame);
return ::DeletingFrameSubtree(mPresShell->GetPresContext(),
mPresShell->FrameManager(), aRemovedFrame);
}
nsresult
@ -10027,7 +10070,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(frameManager, childFrame);
::DeletingFrameSubtree(presContext, frameManager, childFrame);
// See if the child frame is an out-of-flow
if (childFrame->GetStateBits() & NS_FRAME_OUT_OF_FLOW) {
@ -10076,7 +10119,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(frameManager, placeholderFrame);
::DeletingFrameSubtree(presContext, frameManager, placeholderFrame);
rv |= frameManager->RemoveFrame(parentFrame,
nsnull, placeholderFrame);
} else {
@ -10877,7 +10920,7 @@ nsCSSFrameConstructor::CreateContinuingOuterTableFrame(nsIPresShell* aPresShe
}
// Set the outer table's initial child list
newFrame->SetInitialChildList(nsnull, newChildFrames.childList);
newFrame->SetInitialChildList(aPresContext, nsnull, newChildFrames.childList);
*aContinuingFrame = newFrame;
return NS_OK;
@ -10934,7 +10977,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(nsnull, childItems.childList);
headerFooterFrame->SetInitialChildList(aPresContext, nsnull, childItems.childList);
((nsTableRowGroupFrame*)headerFooterFrame)->SetRepeatable(PR_TRUE);
// Table specific initialization
@ -10951,7 +10994,7 @@ nsCSSFrameConstructor::CreateContinuingTableFrame(nsIPresShell* aPresShell,
}
// Set the table frame's initial child list
newFrame->SetInitialChildList(nsnull, childFrames.childList);
newFrame->SetInitialChildList(aPresContext, nsnull, childFrames.childList);
*aContinuingFrame = newFrame;
return NS_OK;
@ -11078,7 +11121,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
}
// Set the table cell's initial child list
newFrame->SetInitialChildList(nsnull, newChildList.childList);
newFrame->SetInitialChildList(aPresContext, nsnull, newChildList.childList);
}
} else if (IS_TABLE_CELL(frameType)) {
@ -11095,7 +11138,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
CreateContinuingFrame(aPresContext, areaFrame, newFrame, &continuingAreaFrame);
// Set the table cell's initial child list
newFrame->SetInitialChildList(nsnull, continuingAreaFrame);
newFrame->SetInitialChildList(aPresContext, nsnull, continuingAreaFrame);
}
} else if (nsLayoutAtoms::lineFrame == frameType) {
@ -11152,7 +11195,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
CreateContinuingFrame(aPresContext, areaFrame, newFrame, &continuingAreaFrame);
// Set the fieldset's initial child list
newFrame->SetInitialChildList(nsnull, continuingAreaFrame);
newFrame->SetInitialChildList(aPresContext, nsnull, continuingAreaFrame);
}
} else {
NS_ASSERTION(PR_FALSE, "unexpected frame type");
@ -11237,7 +11280,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(nsnull, fixedPlaceholders.childList);
newFrame->SetInitialChildList(aPresContext, nsnull, fixedPlaceholders.childList);
return NS_OK;
}
@ -11914,7 +11957,8 @@ nsCSSFrameConstructor::WrapFramesInFirstLineFrame(
ReparentFrame(aState.mPresContext, lineFrame, firstLineStyle, kid);
kid = kid->GetNextSibling();
}
lineFrame->SetInitialChildList(nsnull, firstInlineFrame);
lineFrame->SetInitialChildList(aState.mPresContext, nsnull,
firstInlineFrame);
}
else {
rv = NS_ERROR_OUT_OF_MEMORY;
@ -12071,7 +12115,8 @@ nsCSSFrameConstructor::InsertFirstLineFrames(
// Give the inline frames to the lineFrame <b>after</b>
// reparenting them
ReparentFrame(aPresContext, lineFrame, firstLineStyle, newFrame);
lineFrame->SetInitialChildList(nsnull, newFrame);
lineFrame->SetInitialChildList(aState.mPresContext, nsnull,
newFrame);
}
}
else {
@ -12252,7 +12297,7 @@ nsCSSFrameConstructor::CreateFloatingLetterFrame(
aTextFrame);
// And then give the text frame to the letter frame
letterFrame->SetInitialChildList(nsnull, aTextFrame);
letterFrame->SetInitialChildList(aState.mPresContext, 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
@ -12284,7 +12329,7 @@ nsCSSFrameConstructor::CreateFloatingLetterFrame(
if (nextTextFrame) {
if (NS_FAILED(rv)) {
nextTextFrame->Destroy();
nextTextFrame->Destroy(aState.mPresContext);
} else {
aResult.AddChild(nextTextFrame);
}
@ -12339,7 +12384,8 @@ nsCSSFrameConstructor::CreateLetterFrame(nsFrameConstructorState& aState,
InitAndRestoreFrame(aState, aTextContent, letterFrame, textSC,
nsnull, textFrame);
letterFrame->SetInitialChildList(nsnull, textFrame);
letterFrame->SetInitialChildList(aState.mPresContext, nsnull,
textFrame);
aResult.childList = aResult.lastChild = letterFrame;
}
}
@ -12385,7 +12431,7 @@ nsCSSFrameConstructor::WrapFramesInFirstLetterFrame(
letterFrames.lastChild->SetNextSibling(nextSibling);
// Destroy the old textFrame
textFrame->Destroy();
textFrame->Destroy(aState.mPresContext);
// Repair lastChild; the only time this needs to happen is when
// the block had one child (the text frame).
@ -12395,7 +12441,8 @@ nsCSSFrameConstructor::WrapFramesInFirstLetterFrame(
}
else {
// Take the old textFrame out of the inline parents child list
::DeletingFrameSubtree(aState.mFrameManager, textFrame);
::DeletingFrameSubtree(aState.mPresContext, aState.mFrameManager,
textFrame);
parentFrame->RemoveFrame(nsnull, textFrame);
// Insert in the letter frame(s)
@ -12547,7 +12594,7 @@ nsCSSFrameConstructor::RemoveFloatingFirstLetterFrames(
nsIFrame* nextTextParent = nextTextFrame->GetParent();
if (nextTextParent) {
nsSplittableFrame::BreakFromPrevFlow(nextTextFrame);
::DeletingFrameSubtree(aFrameManager, nextTextFrame);
::DeletingFrameSubtree(aPresContext, aFrameManager, nextTextFrame);
aFrameManager->RemoveFrame(nextTextParent, nsnull, nextTextFrame);
}
}
@ -12575,7 +12622,7 @@ nsCSSFrameConstructor::RemoveFloatingFirstLetterFrames(
aFrameManager->UnregisterPlaceholderFrame(placeholderFrame);
// Remove the float frame
::DeletingFrameSubtree(aFrameManager, floatFrame);
::DeletingFrameSubtree(aPresContext, aFrameManager, floatFrame);
aFrameManager->RemoveFrame(aBlockFrame, nsLayoutAtoms::floatList,
floatFrame);
@ -12626,7 +12673,7 @@ nsCSSFrameConstructor::RemoveFirstLetterFrames(nsPresContext* aPresContext,
textFrame->Init(textContent, aFrame, newSC, nsnull);
// Next rip out the kid and replace it with the text frame
::DeletingFrameSubtree(aFrameManager, kid);
::DeletingFrameSubtree(aPresContext, aFrameManager, kid);
aFrameManager->RemoveFrame(aFrame, nsnull, kid);
// Insert text frame in its place
@ -12690,7 +12737,8 @@ nsCSSFrameConstructor::RecoverLetterFrames(nsFrameConstructorState& aState,
}
if (parentFrame) {
// Take the old textFrame out of the parents child list
::DeletingFrameSubtree(aState.mFrameManager, textFrame);
::DeletingFrameSubtree(aState.mPresContext, aState.mFrameManager,
textFrame);
parentFrame->RemoveFrame(nsnull, textFrame);
// Insert in the letter frame(s)
@ -12801,7 +12849,8 @@ nsCSSFrameConstructor::ConstructBlock(nsFrameConstructorState& aState,
parent = columnSetFrame;
*aNewFrame = columnSetFrame;
columnSetFrame->SetInitialChildList(nsnull, blockFrame);
columnSetFrame->SetInitialChildList(aState.mPresContext, nsnull,
blockFrame);
blockFrame->AddStateBits(NS_BLOCK_SPACE_MGR);
}
@ -12858,7 +12907,8 @@ nsCSSFrameConstructor::ConstructBlock(nsFrameConstructorState& aState,
PR_FALSE, childItems);
// Set the frame's initial child list
blockFrame->SetInitialChildList(nsnull, childItems.childList);
blockFrame->SetInitialChildList(aState.mPresContext, nsnull,
childItems.childList);
return rv;
}
@ -12913,7 +12963,8 @@ nsCSSFrameConstructor::ConstructInline(nsFrameConstructorState& aState,
CreateAnonymousFrames(aContent->Tag(), aState, aContent, aNewFrame,
PR_FALSE, childItems);
aNewFrame->SetInitialChildList(nsnull, childItems.childList);
aNewFrame->SetInitialChildList(aState.mPresContext, nsnull,
childItems.childList);
return rv;
}
@ -12949,7 +13000,7 @@ nsCSSFrameConstructor::ConstructInline(nsFrameConstructorState& aState,
lastBlock->SetNextSibling(nsnull);
// list1's frames belong to this inline frame so go ahead and take them
aNewFrame->SetInitialChildList(nsnull, list1);
aNewFrame->SetInitialChildList(aState.mPresContext, 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
@ -12982,7 +13033,7 @@ nsCSSFrameConstructor::ConstructInline(nsFrameConstructorState& aState,
list2->GetParent(), blockFrame);
}
blockFrame->SetInitialChildList(nsnull, list2);
blockFrame->SetInitialChildList(aState.mPresContext, nsnull, list2);
nsFrameConstructorState state(mPresShell, mFixedContainingBlock,
GetAbsoluteContainingBlock(blockFrame),
@ -13021,7 +13072,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(nsnull, list3);
inlineFrame->SetInitialChildList(aState.mPresContext, nsnull, list3);
MoveChildrenTo(aState.mFrameManager, nsnull, inlineFrame, list3, nsnull, nsnull);
}
@ -13175,34 +13226,35 @@ 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(frameManager, aFrameList);
CleanupFrameReferences(presContext, frameManager, aFrameList);
if (aState.mAbsoluteItems.childList) {
CleanupFrameReferences(frameManager, aState.mAbsoluteItems.childList);
CleanupFrameReferences(presContext, frameManager, aState.mAbsoluteItems.childList);
}
if (aState.mFixedItems.childList) {
CleanupFrameReferences(frameManager, aState.mFixedItems.childList);
CleanupFrameReferences(presContext, frameManager, aState.mFixedItems.childList);
}
if (aState.mFloatedItems.childList) {
CleanupFrameReferences(frameManager, aState.mFloatedItems.childList);
CleanupFrameReferences(presContext, frameManager, aState.mFloatedItems.childList);
}
nsFrameList tmp(aFrameList);
tmp.DestroyFrames();
tmp.DestroyFrames(presContext);
tmp.SetFrames(aState.mAbsoluteItems.childList);
tmp.DestroyFrames();
tmp.DestroyFrames(presContext);
aState.mAbsoluteItems.childList = nsnull;
tmp.SetFrames(aState.mFixedItems.childList);
tmp.DestroyFrames();
tmp.DestroyFrames(presContext);
aState.mFixedItems.childList = nsnull;
tmp.SetFrames(aState.mFloatedItems.childList);
tmp.DestroyFrames();
tmp.DestroyFrames(presContext);
aState.mFloatedItems.childList = nsnull;
// If we don't have a containing block, try to find our closest non-inline
@ -13318,7 +13370,8 @@ nsresult nsCSSFrameConstructor::RemoveFixedItems(const nsFrameConstructorState&
mPresShell->GetPlaceholderFrameFor(fixedChild, &placeholderFrame);
NS_ASSERTION(placeholderFrame, "no placeholder for fixed-pos frame");
nsIFrame* placeholderParent = placeholderFrame->GetParent();
::DeletingFrameSubtree(aState.mFrameManager, placeholderFrame);
::DeletingFrameSubtree(aState.mPresContext, aState.mFrameManager,
placeholderFrame);
rv = aState.mFrameManager->RemoveFrame(placeholderParent, nsnull,
placeholderFrame);
if (NS_FAILED(rv)) {
@ -13326,7 +13379,8 @@ nsresult nsCSSFrameConstructor::RemoveFixedItems(const nsFrameConstructorState&
break;
}
::DeletingFrameSubtree(aState.mFrameManager, fixedChild);
::DeletingFrameSubtree(aState.mPresContext, aState.mFrameManager,
fixedChild);
rv = aState.mFrameManager->RemoveFrame(mFixedContainingBlock,
nsLayoutAtoms::fixedList,
fixedChild);

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

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

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

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

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

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

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

@ -70,7 +70,8 @@ public:
nsFieldSetFrame();
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList);
NS_IMETHOD Reflow(nsPresContext* aPresContext,
@ -145,7 +146,8 @@ nsFieldSetFrame::IsContainingBlock() const
}
NS_IMETHODIMP
nsFieldSetFrame::SetInitialChildList(nsIAtom* aListName,
nsFieldSetFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
{
// Get the content and legend frames.
@ -158,7 +160,7 @@ nsFieldSetFrame::SetInitialChildList(nsIAtom* aListName,
}
// Queue up the frames for the content frame
return nsHTMLContainerFrame::SetInitialChildList(nsnull, aChildList);
return nsHTMLContainerFrame::SetInitialChildList(aPresContext, nsnull, aChildList);
}
MOZ_DECL_CTOR_COUNTER(nsDisplayFieldSetBorderBackground)
@ -643,12 +645,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");
mFrames.DestroyFrame(mLegendFrame);
nsPresContext* presContext = GetPresContext();
mFrames.DestroyFrame(presContext, mLegendFrame);
mLegendFrame = nsnull;
AddStateBits(NS_FRAME_IS_DIRTY);
if (GetParent()) {
GetParent()->ReflowDirtyChild(GetPresContext()->GetPresShell(), this);
GetParent()->ReflowDirtyChild(presContext->GetPresShell(), this);
}
return NS_OK;
}

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

@ -110,7 +110,7 @@ nsFileControlFrame::~nsFileControlFrame()
}
void
nsFileControlFrame::PreDestroy()
nsFileControlFrame::PreDestroy(nsPresContext* aPresContext)
{
// 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
@ -134,21 +134,21 @@ nsFileControlFrame::PreDestroy()
mDidPreDestroy = PR_TRUE;
}
void
nsFileControlFrame::Destroy()
NS_IMETHODIMP
nsFileControlFrame::Destroy(nsPresContext* aPresContext)
{
if (!mDidPreDestroy) {
PreDestroy();
PreDestroy(aPresContext);
}
mTextFrame = nsnull;
nsAreaFrame::Destroy();
return nsAreaFrame::Destroy(aPresContext);
}
void
nsFileControlFrame::RemovedAsPrimaryFrame()
nsFileControlFrame::RemovedAsPrimaryFrame(nsPresContext* aPresContext)
{
if (!mDidPreDestroy) {
PreDestroy();
PreDestroy(aPresContext);
}
#ifdef DEBUG
else {
@ -457,10 +457,11 @@ NS_IMETHODIMP nsFileControlFrame::Reflow(nsPresContext* aPresContext,
/*
NS_IMETHODIMP
nsFileControlFrame::SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList)
nsFileControlFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
{
nsAreaFrame::SetInitialChildList(aListName, aChildList);
nsresult r = nsAreaFrame::SetInitialChildList(aPresContext, 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.

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

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

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

@ -55,13 +55,13 @@ nsFormControlFrame::~nsFormControlFrame()
{
}
void
nsFormControlFrame::Destroy()
NS_IMETHODIMP
nsFormControlFrame::Destroy(nsPresContext *aPresContext)
{
// XXXldb Do we really need to do this? Shouldn't only those frames
// that use it do it?
nsFormControlFrame::RegUnRegAccessKey(NS_STATIC_CAST(nsIFrame*, this), PR_FALSE);
nsLeafFrame::Destroy();
nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE);
return nsLeafFrame::Destroy(aPresContext);
}
// Frames are not refcounted, no need to AddRef
@ -262,7 +262,8 @@ nsFormControlFrame::DidReflow(nsPresContext* aPresContext,
}
NS_IMETHODIMP
nsFormControlFrame::SetInitialChildList(nsIAtom* aListName,
nsFormControlFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
{
return NS_OK;
@ -278,7 +279,7 @@ nsFormControlFrame::Reflow(nsPresContext* aPresContext,
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
if (!mDidInit) {
RegUnRegAccessKey(NS_STATIC_CAST(nsIFrame*, this), PR_TRUE);
RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_TRUE);
mDidInit = PR_TRUE;
}
@ -292,20 +293,17 @@ nsFormControlFrame::Reflow(nsPresContext* aPresContext,
}
nsresult
nsFormControlFrame::RegUnRegAccessKey(nsIFrame * aFrame, PRBool aDoReg)
nsFormControlFrame::RegUnRegAccessKey(nsPresContext* aPresContext, 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 = presContext->EventStateManager();
nsIEventStateManager *stateManager = aPresContext->EventStateManager();
if (aDoReg) {
return stateManager->RegisterAccessKey(content, (PRUint32)accessKey.First());
} else {

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

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

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

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

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

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

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

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

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

@ -72,7 +72,7 @@ public:
nsImageControlFrame();
~nsImageControlFrame();
virtual void Destroy();
NS_IMETHOD Destroy(nsPresContext *aPresContext);
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
NS_IMETHOD Reflow(nsPresContext* aPresContext,
@ -124,11 +124,12 @@ nsImageControlFrame::~nsImageControlFrame()
{
}
void
nsImageControlFrame::Destroy()
NS_IMETHODIMP
nsImageControlFrame::Destroy(nsPresContext *aPresContext)
{
nsFormControlFrame::RegUnRegAccessKey(NS_STATIC_CAST(nsIFrame*, this), PR_FALSE);
nsImageControlFrameSuper::Destroy();
nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE);
return nsImageControlFrameSuper::Destroy(aPresContext);
}
nsIFrame*
@ -202,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(NS_STATIC_CAST(nsIFrame*, this), PR_TRUE);
nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_TRUE);
}
return nsImageControlFrameSuper::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
}

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

@ -71,11 +71,11 @@ nsLegendFrame::GetType() const
return nsLayoutAtoms::legendFrame;
}
void
nsLegendFrame::Destroy()
NS_IMETHODIMP
nsLegendFrame::Destroy(nsPresContext *aPresContext)
{
nsFormControlFrame::RegUnRegAccessKey(NS_STATIC_CAST(nsIFrame*, this), PR_FALSE);
nsAreaFrame::Destroy();
nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE);
return nsAreaFrame::Destroy(aPresContext);
}
// 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(NS_STATIC_CAST(nsIFrame*, this), PR_TRUE);
nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_TRUE);
}
return nsAreaFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
}

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

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

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

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

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

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

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

@ -1051,7 +1051,7 @@ SuppressEventHandlers(nsPresContext* aPresContext)
}
void
nsTextControlFrame::PreDestroy()
nsTextControlFrame::PreDestroy(nsPresContext* aPresContext)
{
// notify the editor that we are going away
if (mEditor)
@ -1076,7 +1076,7 @@ nsTextControlFrame::PreDestroy()
// Clean up the controller
if (!SuppressEventHandlers(GetPresContext()))
if (!SuppressEventHandlers(aPresContext))
{
nsCOMPtr<nsIControllers> controllers;
nsCOMPtr<nsIDOMNSHTMLInputElement> inputElement = do_QueryInterface(mContent);
@ -1117,7 +1117,7 @@ nsTextControlFrame::PreDestroy()
//unregister self from content
mTextListener->SetFrame(nsnull);
nsFormControlFrame::RegUnRegAccessKey(NS_STATIC_CAST(nsIFrame*, this), PR_FALSE);
nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE);
if (mTextListener)
{
nsCOMPtr<nsIDOMEventReceiver> erP = do_QueryInterface(mContent);
@ -1146,22 +1146,22 @@ nsTextControlFrame::PreDestroy()
mDidPreDestroy = PR_TRUE;
}
void
nsTextControlFrame::Destroy()
NS_IMETHODIMP
nsTextControlFrame::Destroy(nsPresContext* aPresContext)
{
nsContentUtils::UnregisterPrefCallback(PREF_DEFAULT_SPELLCHECK,
nsTextControlFrame::RealTimeSpellCallback, this);
if (!mDidPreDestroy) {
PreDestroy();
PreDestroy(aPresContext);
}
nsBoxFrame::Destroy();
return nsBoxFrame::Destroy(aPresContext);
}
void
nsTextControlFrame::RemovedAsPrimaryFrame()
nsTextControlFrame::RemovedAsPrimaryFrame(nsPresContext* aPresContext)
{
if (!mDidPreDestroy) {
PreDestroy();
PreDestroy(aPresContext);
}
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(this, PR_TRUE);
nsFormControlFrame::RegUnRegAccessKey(aPresContext, this, PR_TRUE);
}
nsresult rv = nsStackFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
@ -2828,10 +2828,11 @@ nsTextControlFrame::SetValue(const nsAString& aValue)
NS_IMETHODIMP
nsTextControlFrame::SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList)
nsTextControlFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult rv = nsBoxFrame::SetInitialChildList(aListName, aChildList);
nsresult rv = nsBoxFrame::SetInitialChildList(aPresContext, aListName, aChildList);
if (mEditor)
mEditor->PostCreate();
//look for scroll view below this frame go along first child list
@ -2862,7 +2863,7 @@ nsTextControlFrame::SetInitialChildList(nsIAtom* aListName,
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 (!GetPresContext()->GetPresShell())
if (!aPresContext->GetPresShell())
return NS_ERROR_FAILURE;
}

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

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

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

@ -61,6 +61,7 @@ nsAbsoluteContainingBlock::FirstChild(const nsIFrame* aDelegatingFrame,
nsresult
nsAbsoluteContainingBlock::SetInitialChildList(nsIFrame* aDelegatingFrame,
nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
{
@ -112,7 +113,8 @@ nsAbsoluteContainingBlock::RemoveFrame(nsIFrame* aDelegatingFrame,
nsIAtom* aListName,
nsIFrame* aOldFrame)
{
PRBool result = mAbsoluteFrames.DestroyFrame(aOldFrame);
PRBool result = mAbsoluteFrames.DestroyFrame(aDelegatingFrame->
GetPresContext(), 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
@ -409,9 +411,10 @@ nsAbsoluteContainingBlock::IncrementalReflow(nsIFrame* aDelegatin
}
void
nsAbsoluteContainingBlock::DestroyFrames(nsIFrame* aDelegatingFrame)
nsAbsoluteContainingBlock::DestroyFrames(nsIFrame* aDelegatingFrame,
nsPresContext* aPresContext)
{
mAbsoluteFrames.DestroyFrames();
mAbsoluteFrames.DestroyFrames(aPresContext);
}
// XXX Optimize the case where it's a resize reflow and the absolutely

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

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

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

@ -75,7 +75,8 @@ nsAreaFrame::nsAreaFrame()
// If you make changes to this function, check its counterparts
// in nsBoxFrame and nsTextBoxFrame
nsresult
nsAreaFrame::RegUnregAccessKey(PRBool aDoReg)
nsAreaFrame::RegUnregAccessKey(nsPresContext* aPresContext,
PRBool aDoReg)
{
// if we have no content, we can't do anything
if (!mContent)
@ -101,7 +102,7 @@ nsAreaFrame::RegUnregAccessKey(PRBool aDoReg)
// With a valid PresContext we can get the ESM
// and register the access key
nsIEventStateManager *esm = GetPresContext()->EventStateManager();
nsIEventStateManager *esm = aPresContext->EventStateManager();
nsresult rv;
PRUint32 key = accessKey.First();
@ -132,15 +133,16 @@ nsAreaFrame::Init(nsIContent* aContent,
return rv;
// register access key
return RegUnregAccessKey(PR_TRUE);
return RegUnregAccessKey(GetPresContext(), PR_TRUE);
}
void
nsAreaFrame::Destroy()
NS_IMETHODIMP
nsAreaFrame::Destroy(nsPresContext* aPresContext)
{
// unregister access key
RegUnregAccessKey(PR_FALSE);
nsBlockFrame::Destroy();
RegUnregAccessKey(aPresContext, PR_FALSE);
return nsBlockFrame::Destroy(aPresContext);
}
NS_IMETHODIMP
@ -154,7 +156,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(PR_TRUE);
RegUnregAccessKey(GetPresContext(), PR_TRUE);
return rv;
}

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

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

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

@ -282,36 +282,34 @@ nsBlockFrame::~nsBlockFrame()
{
}
void
nsBlockFrame::Destroy()
NS_IMETHODIMP
nsBlockFrame::Destroy(nsPresContext* aPresContext)
{
mAbsoluteContainer.DestroyFrames(this);
mAbsoluteContainer.DestroyFrames(this, aPresContext);
// Outside bullets are not in our child-list so check for them here
// and delete them when present.
if (mBullet && HaveOutsideBullet()) {
mBullet->Destroy();
mBullet->Destroy(aPresContext);
mBullet = nsnull;
}
mFloats.DestroyFrames();
nsPresContext* presContext = GetPresContext();
mFloats.DestroyFrames(aPresContext);
nsLineBox::DeleteLineList(presContext, mLines);
nsLineBox::DeleteLineList(aPresContext, mLines);
// destroy overflow lines now
nsLineList* overflowLines = RemoveOverflowLines();
if (overflowLines) {
nsLineBox::DeleteLineList(presContext, *overflowLines);
nsLineBox::DeleteLineList(aPresContext, *overflowLines);
}
{
nsAutoOOFFrameList oofs(this);
oofs.mList.DestroyFrames();
oofs.mList.DestroyFrames(aPresContext);
// oofs is now empty and will remove the frame list property
}
nsBlockFrameSuper::Destroy();
return nsBlockFrameSuper::Destroy(aPresContext);
}
NS_IMETHODIMP
@ -3255,7 +3253,7 @@ nsBlockFrame::UndoSplitPlaceholders(nsBlockReflowState& aState,
nsSplittableFrame::RemoveFromFlow(placeholder);
nsIFrame* savePlaceholder = placeholder;
placeholder = NS_STATIC_CAST(nsPlaceholderFrame*, placeholder->GetNextSibling());
savePlaceholder->Destroy();
savePlaceholder->Destroy(aState.mPresContext);
}
}
@ -5438,21 +5436,21 @@ nsBlockFrame::RemoveFloat(nsIFrame* aFloat) {
}
// Try to destroy if it's in mFloats.
if (mFloats.DestroyFrame(aFloat)) {
if (mFloats.DestroyFrame(GetPresContext(), aFloat)) {
return line;
}
// Try our overflow list
{
nsAutoOOFFrameList oofs(this);
if (oofs.mList.DestroyFrame(aFloat)) {
if (oofs.mList.DestroyFrame(GetPresContext(), aFloat)) {
return line_end;
}
}
// If aFloat's parent is being reflowed then mFloats may not be up
// to date so we won't find the float above. Just delete it.
aFloat->Destroy();
aFloat->Destroy(GetPresContext());
return line_end;
}
@ -5576,7 +5574,7 @@ nsBlockFrame::DoRemoveOutOfFlowFrame(nsIFrame* aFrame)
block->mAbsoluteContainer.RemoveFrame(block,
block->mAbsoluteContainer.GetChildListName(),
aFrame);
aFrame->Destroy();
aFrame->Destroy(aFrame->GetPresContext());
}
else {
// This also destroys the frame.
@ -5645,7 +5643,7 @@ nsBlockFrame::DoRemoveFrame(nsIFrame* aDeletedFrame, PRBool aDestroyFrames,
if (overflowPlaceholders && overflowPlaceholders->RemoveFrame(aDeletedFrame)) {
nsIFrame* nif = aDeletedFrame->GetNextInFlow();
if (aDestroyFrames) {
aDeletedFrame->Destroy();
aDeletedFrame->Destroy(presContext);
} else {
aDeletedFrame->SetNextSibling(nsnull);
}
@ -5739,7 +5737,7 @@ found_frame:;
printf(" prevSibling=%p deletedNextContinuation=%p\n", prevSibling, deletedNextContinuation);
#endif
if (aDestroyFrames) {
aDeletedFrame->Destroy();
aDeletedFrame->Destroy(presContext);
} else {
aDeletedFrame->SetNextSibling(nsnull);
}
@ -6671,23 +6669,23 @@ nsBlockFrame::Init(nsIContent* aContent,
}
NS_IMETHODIMP
nsBlockFrame::SetInitialChildList(nsIAtom* aListName,
nsBlockFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult rv = NS_OK;
if (mAbsoluteContainer.GetChildListName() == aListName) {
mAbsoluteContainer.SetInitialChildList(this, aListName, aChildList);
mAbsoluteContainer.SetInitialChildList(this, aPresContext, aListName, aChildList);
}
else if (nsLayoutAtoms::floatList == aListName) {
mFloats.SetFrames(aChildList);
}
else {
nsPresContext* presContext = GetPresContext();
// Lookup up the two pseudo style contexts
if (nsnull == GetPrevInFlow()) {
nsRefPtr<nsStyleContext> firstLetterStyle = GetFirstLetterStyle(presContext);
nsRefPtr<nsStyleContext> firstLetterStyle = GetFirstLetterStyle(aPresContext);
if (nsnull != firstLetterStyle) {
mState |= NS_BLOCK_HAS_FIRST_LETTER_STYLE;
#ifdef NOISY_FIRST_LETTER
@ -6723,7 +6721,7 @@ nsBlockFrame::SetInitialChildList(nsIAtom* aListName,
break;
}
nsIPresShell *shell = presContext->PresShell();
nsIPresShell *shell = aPresContext->PresShell();
nsRefPtr<nsStyleContext> kidSC = shell->StyleSet()->
ResolvePseudoStyleFor(mContent, pseudoElement, mStyleContext);

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

@ -141,7 +141,8 @@ public:
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList);
NS_IMETHOD AppendFrames(nsIAtom* aListName,
nsIFrame* aFrameList);
@ -153,7 +154,7 @@ public:
virtual nsIFrame* GetFirstChild(nsIAtom* aListName) const;
NS_IMETHOD SetParent(const nsIFrame* aParent);
virtual nsIAtom* GetAdditionalChildListName(PRInt32 aIndex) const;
virtual void Destroy();
NS_IMETHOD Destroy(nsPresContext* aPresContext);
NS_IMETHOD IsSplittable(nsSplittableType& aIsSplittable) const;
virtual PRBool IsContainingBlock() const;
virtual PRBool IsFloatContainingBlock() const;

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

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

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

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

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

@ -52,7 +52,8 @@ class nsColumnSetFrame : public nsHTMLContainerFrame {
public:
nsColumnSetFrame();
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList);
NS_IMETHOD Reflow(nsPresContext* aPresContext,
@ -166,14 +167,15 @@ nsColumnSetFrame::GetType() const
}
NS_IMETHODIMP
nsColumnSetFrame::SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList)
nsColumnSetFrame::SetInitialChildList(nsPresContext* aPresContext,
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(nsnull, aChildList);
return nsHTMLContainerFrame::SetInitialChildList(aPresContext, nsnull, aChildList);
}
static nscoord GetAvailableContentWidth(const nsHTMLReflowState& aReflowState) {

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

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

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

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

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

@ -56,7 +56,8 @@ public:
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList);
#ifdef NS_DEBUG
NS_IMETHOD GetFrameName(nsAString& aResult) const;
@ -137,11 +138,12 @@ nsFirstLetterFrame::Init(nsIContent* aContent,
}
NS_IMETHODIMP
nsFirstLetterFrame::SetInitialChildList(nsIAtom* aListName,
nsFirstLetterFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
{
mFrames.SetFrames(aChildList);
nsFrameManager *frameManager = GetPresContext()->FrameManager();
nsFrameManager *frameManager = aPresContext->FrameManager();
for (nsIFrame* frame = aChildList; frame; frame = frame->GetNextSibling()) {
frameManager->ReParentStyleContext(frame, mStyleContext);

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

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

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

@ -165,7 +165,8 @@ public:
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* asPrevInFlow);
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList);
NS_IMETHOD AppendFrames(nsIAtom* aListName,
nsIFrame* aFrameList);
@ -174,7 +175,7 @@ public:
nsIFrame* aFrameList);
NS_IMETHOD RemoveFrame(nsIAtom* aListName,
nsIFrame* aOldFrame);
virtual void Destroy();
NS_IMETHOD Destroy(nsPresContext* aPresContext);
NS_IMETHOD CalcBorderPadding(nsMargin& aBorderPadding) const;
virtual nsStyleContext* GetAdditionalStyleContext(PRInt32 aIndex) const;
virtual void SetAdditionalStyleContext(PRInt32 aIndex,

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

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

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

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

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

@ -59,7 +59,7 @@ public:
~nsFrameList() {
}
void DestroyFrames();
void DestroyFrames(nsPresContext* aPresContext);
void SetFrames(nsIFrame* aFrameList) {
mFirstChild = aFrameList;
@ -92,7 +92,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(nsIFrame* aFrame);
PRBool DestroyFrame(nsPresContext* aPresContext, nsIFrame* aFrame);
void InsertFrame(nsIFrame* aParent,
nsIFrame* aPrevSibling,

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

@ -412,7 +412,7 @@ nsHTMLFramesetFrame::Init(nsIContent* aContent,
childFrame->SetParentBorderColor(borderColor);
result = frame->Init(child, this, kidSC, nsnull);
if (NS_FAILED(result)) {
frame->Destroy();
frame->Destroy(aPresContext);
return result;
}
@ -424,7 +424,7 @@ nsHTMLFramesetFrame::Init(nsIContent* aContent,
result = frame->Init(child, this, kidSC, nsnull);
if (NS_FAILED(result)) {
frame->Destroy();
frame->Destroy(aPresContext);
return result;
}
@ -461,13 +461,13 @@ nsHTMLFramesetFrame::Init(nsIContent* aContent,
nsCSSAnonBoxes::framesetBlank,
mStyleContext);
if (!pseudoStyleContext) {
blankFrame->Destroy();
blankFrame->Destroy(aPresContext);
return NS_ERROR_OUT_OF_MEMORY;
}
result = blankFrame->Init(mContent, this, pseudoStyleContext, nsnull);
if (NS_FAILED(result)) {
blankFrame->Destroy();
blankFrame->Destroy(aPresContext);
return result;
}

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

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

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

@ -192,7 +192,8 @@ public:
// Called to set the child frames. We typically have three: the scroll area,
// the vertical scrollbar, and the horizontal scrollbar.
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList);
NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,
@ -228,7 +229,7 @@ public:
nsIFrame* aPrevFrame,
nsIFrame* aFrameList);
virtual void Destroy();
NS_IMETHOD Destroy(nsPresContext* aPresContext);
NS_IMETHOD RemoveFrame(nsIAtom* aListName,
nsIFrame* aOldFrame);
@ -341,7 +342,8 @@ public:
// Called to set the child frames. We typically have three: the scroll area,
// the vertical scrollbar, and the horizontal scrollbar.
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList);
NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,
@ -363,7 +365,7 @@ public:
nsIFrame* aPrevFrame,
nsIFrame* aFrameList);
virtual void Destroy();
NS_IMETHOD Destroy(nsPresContext* aPresContext);
NS_IMETHOD RemoveFrame(nsIAtom* aListName,
nsIFrame* aOldFrame);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -84,10 +84,11 @@ public:
#ifdef NS_DEBUG
NS_IMETHOD
SetInitialChildList(nsIAtom* aListName,
SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult rv = nsBlockFrame::SetInitialChildList(aListName, aChildList);
nsresult rv = nsBlockFrame::SetInitialChildList(aPresContext, 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,

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

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

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

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

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

@ -230,10 +230,11 @@ nsMathMLmactionFrame::GetSelectedFrame()
}
NS_IMETHODIMP
nsMathMLmactionFrame::SetInitialChildList(nsIAtom* aListName,
nsMathMLmactionFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult rv = nsMathMLContainerFrame::SetInitialChildList(aListName, aChildList);
nsresult rv = nsMathMLContainerFrame::SetInitialChildList(aPresContext, 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

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

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

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

@ -80,17 +80,18 @@ nsMathMLmfencedFrame::InheritAutomaticData(nsIFrame* aParent)
}
NS_IMETHODIMP
nsMathMLmfencedFrame::SetInitialChildList(nsIAtom* aListName,
nsMathMLmfencedFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
{
// First, let the base class do its work
nsresult rv = nsMathMLContainerFrame::SetInitialChildList(aListName, aChildList);
nsresult rv = nsMathMLContainerFrame::SetInitialChildList(aPresContext, 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(GetPresContext());
return CreateFencesAndSeparators(aPresContext);
}
NS_IMETHODIMP

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -302,11 +302,11 @@ nsTableFrame::~nsTableFrame()
#endif
}
void
nsTableFrame::Destroy()
NS_IMETHODIMP
nsTableFrame::Destroy(nsPresContext* aPresContext)
{
mColGroups.DestroyFrames();
nsHTMLContainerFrame::Destroy();
mColGroups.DestroyFrames(aPresContext);
return nsHTMLContainerFrame::Destroy(aPresContext);
}
nscoord
@ -386,7 +386,8 @@ 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(nsIAtom* aListName,
nsTableFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult rv=NS_OK;
@ -712,7 +713,7 @@ void nsTableFrame::InsertCol(nsTableColFrame& aColFrame,
}
// remove the col group if it is empty
if (lastColGroup->GetColCount() <= 0) {
mColGroups.DestroyFrame((nsIFrame*)lastColGroup);
mColGroups.DestroyFrame(GetPresContext(), (nsIFrame*)lastColGroup);
}
removedFromCache = PR_TRUE;
}
@ -927,7 +928,7 @@ nsTableFrame::CreateAnonymousColFrames(nsTableColGroupFrame* aColGroupFrame,
nsIFrame* colFrame = NS_NewTableColFrame(shell);
((nsTableColFrame *) colFrame)->SetColType(aColType);
colFrame->Init(iContent, aColGroupFrame, styleContext, nsnull);
colFrame->SetInitialChildList(nsnull, nsnull);
colFrame->SetInitialChildList(presContext, nsnull, nsnull);
// Add the col to the sibling chain
if (lastColFrame) {
@ -2482,7 +2483,7 @@ nsTableFrame::RemoveFrame(nsIAtom* aListName,
nsTableColGroupFrame* colGroup = (nsTableColGroupFrame*)aOldFrame;
PRInt32 firstColIndex = colGroup->GetStartColumnIndex();
PRInt32 lastColIndex = firstColIndex + colGroup->GetColCount() - 1;
mColGroups.DestroyFrame(aOldFrame);
mColGroups.DestroyFrame(GetPresContext(), aOldFrame);
nsTableColGroupFrame::ResetColIndices(nextColGroupFrame, firstColIndex);
// remove the cols from the table
PRInt32 colX;
@ -2527,14 +2528,14 @@ nsTableFrame::RemoveFrame(nsIAtom* aListName,
AdjustRowIndices(startRowIndex, -numRows);
// remove the row group frame from the sibling chain
mFrames.DestroyFrame(aOldFrame);
mFrames.DestroyFrame(GetPresContext(), aOldFrame);
// XXX This could probably be optimized with much effort
SetNeedStrategyInit(PR_TRUE);
AppendDirtyReflowCommand(this);
} else {
// Just remove the frame
mFrames.DestroyFrame(aOldFrame);
mFrames.DestroyFrame(GetPresContext(), aOldFrame);
return NS_OK;
}
}

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

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

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

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

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

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

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

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

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

@ -977,7 +977,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();
aRow->Destroy(aPresContext);
}
static nsTableRowFrame*
@ -1460,7 +1460,7 @@ nsTableRowGroupFrame::RemoveFrame(nsIAtom* aListName,
nsTableFrame::AppendDirtyReflowCommand(this);
}
}
mFrames.DestroyFrame(aOldFrame);
mFrames.DestroyFrame(GetPresContext(), aOldFrame);
return NS_OK;
}

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

@ -180,13 +180,14 @@ nsBoxFrame::GetHAlign(Halignment& aAlign)
}
NS_IMETHODIMP
nsBoxFrame::SetInitialChildList(nsIAtom* aListName,
nsBoxFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult r = nsContainerFrame::SetInitialChildList(aListName, aChildList);
nsresult r = nsContainerFrame::SetInitialChildList(aPresContext, aListName, aChildList);
if (r == NS_OK) {
// initialize our list of infos.
nsBoxLayoutState state(GetPresContext()->PresShell());
nsBoxLayoutState state(aPresContext->PresShell());
CheckBoxOrder(state);
if (mLayoutManager)
mLayoutManager->ChildrenSet(this, state, mFrames.FirstChild());
@ -228,7 +229,7 @@ nsBoxFrame::Init(nsIContent* aContent,
#ifdef DEBUG_LAYOUT
// if we are root and this
if (mState & NS_STATE_IS_ROOT)
GetDebugPref(GetPresContext());
GetDebugPref(aPresContext);
#endif
mMouseThrough = unset;
@ -236,7 +237,7 @@ nsBoxFrame::Init(nsIContent* aContent,
UpdateMouseThrough();
// register access key
rv = RegUnregAccessKey(PR_TRUE);
rv = RegUnregAccessKey(aPresContext, PR_TRUE);
return rv;
}
@ -1068,16 +1069,16 @@ nsBoxFrame::DoLayout(nsBoxLayoutState& aState)
return rv;
}
void
nsBoxFrame::Destroy()
NS_IMETHODIMP
nsBoxFrame::Destroy(nsPresContext* aPresContext)
{
// unregister access key
RegUnregAccessKey(PR_FALSE);
RegUnregAccessKey(aPresContext, PR_FALSE);
// clean up the container box's layout manager and child boxes
SetLayoutManager(nsnull);
nsContainerFrame::Destroy();
return nsContainerFrame::Destroy(aPresContext);
}
#ifdef DEBUG_LAYOUT
@ -1133,7 +1134,7 @@ nsBoxFrame::RemoveFrame(nsIAtom* aListName,
mLayoutManager->ChildrenRemoved(this, state, aOldFrame);
// destroy the child frame
aOldFrame->Destroy();
aOldFrame->Destroy(presContext);
// mark us dirty and generate a reflow command
MarkDirtyChildren(state);
@ -1322,7 +1323,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(PR_TRUE);
RegUnregAccessKey(GetPresContext(), PR_TRUE);
}
return rv;
@ -2156,7 +2157,7 @@ nsBoxFrame::CreateViewForFrame(nsPresContext* aPresContext,
// If you make changes to this function, check its counterparts
// in nsTextBoxFrame and nsAreaFrame
nsresult
nsBoxFrame::RegUnregAccessKey(PRBool aDoReg)
nsBoxFrame::RegUnregAccessKey(nsPresContext* aPresContext, PRBool aDoReg)
{
// if we have no content, we can't do anything
if (!mContent)
@ -2183,7 +2184,7 @@ nsBoxFrame::RegUnregAccessKey(PRBool aDoReg)
// With a valid PresContext we can get the ESM
// and register the access key
nsIEventStateManager *esm = GetPresContext()->EventStateManager();
nsIEventStateManager *esm = aPresContext->EventStateManager();
nsresult rv;

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

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

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

@ -285,8 +285,8 @@ nsImageBoxFrame::NeedsRecalc()
return NS_OK;
}
void
nsImageBoxFrame::Destroy()
NS_METHOD
nsImageBoxFrame::Destroy(nsPresContext* aPresContext)
{
// Release image loader first so that it's refcnt can go to zero
if (mImageRequest)
@ -295,7 +295,7 @@ nsImageBoxFrame::Destroy()
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.
nsLeafBoxFrame::Destroy();
return nsLeafBoxFrame::Destroy(aPresContext);
}

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

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

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

@ -267,12 +267,12 @@ nsListBoxBodyFrame::Init(nsIContent* aContent,
return rv;
}
void
nsListBoxBodyFrame::Destroy()
NS_IMETHODIMP
nsListBoxBodyFrame::Destroy(nsPresContext* aPresContext)
{
// make sure we cancel any posted callbacks.
if (mReflowCallbackPosted)
GetPresContext()->PresShell()->CancelReflowCallback(this);
aPresContext->PresShell()->CancelReflowCallback(this);
// Make sure we tell our listbox's box object we're being destroyed.
for (nsIFrame *a = mParent; a; a = a->GetParent()) {
@ -297,7 +297,7 @@ nsListBoxBodyFrame::Destroy()
}
}
nsBoxFrame::Destroy();
return nsBoxFrame::Destroy(aPresContext);
}
NS_IMETHODIMP
@ -1451,7 +1451,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();
aFrame->Destroy(presContext);
}
// Creation Routines ///////////////////////////////////////////////////////////////////////

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

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

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

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

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

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

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

@ -262,8 +262,9 @@ nsMenuFrame::GetFirstChild(nsIAtom* aListName) const
}
NS_IMETHODIMP
nsMenuFrame::SetInitialChildList(nsIAtom* aListName,
nsIFrame* aChildList)
nsMenuFrame::SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList)
{
nsresult rv = NS_OK;
if (nsLayoutAtoms::popupList == aListName) {
@ -283,14 +284,14 @@ nsMenuFrame::SetInitialChildList(nsIAtom* aListName,
frames.RemoveFrame(frame);
mPopupFrames.AppendFrame(this, frame);
nsIFrame* first = frames.FirstChild();
rv = nsBoxFrame::SetInitialChildList(aListName, first);
rv = nsBoxFrame::SetInitialChildList(aPresContext, aListName, first);
return rv;
}
frame = frame->GetNextSibling();
}
// Didn't find it.
rv = nsBoxFrame::SetInitialChildList(aListName, aChildList);
rv = nsBoxFrame::SetInitialChildList(aPresContext, aListName, aChildList);
}
return rv;
}
@ -321,12 +322,12 @@ nsMenuFrame::DestroyPopupFrames(nsPresContext* aPresContext)
}
// Cleanup frames in popup child list
mPopupFrames.DestroyFrames();
mPopupFrames.DestroyFrames(aPresContext);
return NS_OK;
}
void
nsMenuFrame::Destroy()
NS_IMETHODIMP
nsMenuFrame::Destroy(nsPresContext* aPresContext)
{
// 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
@ -349,8 +350,8 @@ nsMenuFrame::Destroy()
}
UngenerateMenu();
DestroyPopupFrames(GetPresContext());
nsBoxFrame::Destroy();
DestroyPopupFrames(aPresContext);
return nsBoxFrame::Destroy(aPresContext);
}
NS_IMETHODIMP
@ -1833,8 +1834,9 @@ nsMenuFrame::RemoveFrame(nsIAtom* aListName,
if (mPopupFrames.ContainsFrame(aOldFrame)) {
// Go ahead and remove this frame.
mPopupFrames.DestroyFrame(aOldFrame);
nsBoxLayoutState state(GetPresContext());
nsPresContext* presContext = GetPresContext();
mPopupFrames.DestroyFrame(presContext, aOldFrame);
nsBoxLayoutState state(presContext);
rv = MarkDirtyChildren(state);
} else {
rv = nsBoxFrame::RemoveFrame(aListName, aOldFrame);

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

@ -121,10 +121,11 @@ 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(nsIAtom* aListName,
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
nsIAtom* aListName,
nsIFrame* aChildList);
virtual nsIAtom* GetAdditionalChildListName(PRInt32 aIndex) const;
virtual void Destroy();
NS_IMETHOD Destroy(nsPresContext* aPresContext);
// Overridden to prevent events from going to children of the menu.
NS_IMETHOD BuildDisplayListForChildren(nsDisplayListBuilder* aBuilder,

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

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

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

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

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

@ -159,8 +159,8 @@ nsPopupSetFrame::Init(nsIContent* aContent,
return rv;
}
void
nsPopupSetFrame::Destroy()
NS_IMETHODIMP
nsPopupSetFrame::Destroy(nsPresContext* aPresContext)
{
// Remove our frame list.
if (mPopupList) {
@ -179,7 +179,7 @@ nsPopupSetFrame::Destroy()
// keeps things consistent so reentering won't crash us
while (mPopupList) {
if (mPopupList->mPopupFrame) {
mPopupList->mPopupFrame->Destroy();
mPopupList->mPopupFrame->Destroy(aPresContext);
}
nsPopupFrameList* temp = mPopupList;
@ -195,7 +195,7 @@ nsPopupSetFrame::Destroy()
rootBox->SetPopupSetFrame(nsnull);
}
nsBoxFrame::Destroy();
return nsBoxFrame::Destroy(aPresContext);
}
NS_IMETHODIMP
@ -724,6 +724,7 @@ 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.
@ -733,7 +734,7 @@ nsPopupSetFrame::RemovePopupFrame(nsIFrame* aPopup)
mPopupList = currEntry->mNextPopup;
// Destroy the frame.
currEntry->mPopupFrame->Destroy();
currEntry->mPopupFrame->Destroy(presContext);
// Delete the entry.
currEntry->mNextPopup = nsnull;

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

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

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

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

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

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

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

@ -69,7 +69,7 @@ public:
nsAutoRepeatBoxFrame(nsIPresShell* aPresShell);
friend nsIFrame* NS_NewAutoRepeatBoxFrame(nsIPresShell* aPresShell);
virtual void Destroy();
NS_IMETHOD Destroy(nsPresContext* aPresContext);
NS_IMETHOD HandleEvent(nsPresContext* aPresContext,
nsGUIEvent* aEvent,
@ -131,11 +131,11 @@ nsAutoRepeatBoxFrame::Notify(nsITimer *timer)
return NS_OK;
}
void
nsAutoRepeatBoxFrame::Destroy()
NS_IMETHODIMP
nsAutoRepeatBoxFrame::Destroy(nsPresContext* aPresContext)
{
// 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();
nsButtonBoxFrame::Destroy();
return nsButtonBoxFrame::Destroy(aPresContext);
}

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

@ -258,11 +258,11 @@ nsScrollbarButtonFrame::GetParentWithTag(nsIAtom* toFind, nsIFrame* start,
return NS_OK;
}
void
nsScrollbarButtonFrame::Destroy()
NS_IMETHODIMP
nsScrollbarButtonFrame::Destroy(nsPresContext* aPresContext)
{
// 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();
nsButtonBoxFrame::Destroy();
return nsButtonBoxFrame::Destroy(aPresContext);
}

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