From 2bea98552c4c7ec92451c05e7b252ad67b54b1a0 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Mon, 7 Feb 2005 01:58:25 +0000 Subject: [PATCH] Remove prescontext args for some nsIFrame methods (Append/Insert/Remove/ReplaceFrames) and for some methods in table land. Patch by Vidar Braut Haarr , r+sr=bzbarsky git-svn-id: svn://10.0.0.236/trunk@168894 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsBidiPresUtils.cpp | 8 +- mozilla/layout/base/nsCSSFrameConstructor.cpp | 34 +- mozilla/layout/base/nsFrameManager.cpp | 10 +- mozilla/layout/base/nsFrameManager.h | 6 +- mozilla/layout/forms/nsFieldSetFrame.cpp | 55 +-- .../layout/forms/nsHTMLButtonControlFrame.cpp | 44 +- .../layout/forms/nsHTMLButtonControlFrame.h | 16 +- .../generic/nsAbsoluteContainingBlock.cpp | 41 +- .../generic/nsAbsoluteContainingBlock.h | 36 +- mozilla/layout/generic/nsBlockFrame.cpp | 74 ++-- mozilla/layout/generic/nsBlockFrame.h | 21 +- mozilla/layout/generic/nsColumnSetFrame.cpp | 32 +- mozilla/layout/generic/nsContainerFrame.cpp | 8 +- mozilla/layout/generic/nsContainerFrame.h | 4 +- mozilla/layout/generic/nsFrame.cpp | 16 +- mozilla/layout/generic/nsFrame.h | 16 +- mozilla/layout/generic/nsFrameList.cpp | 5 +- mozilla/layout/generic/nsFrameList.h | 3 +- mozilla/layout/generic/nsGfxScrollFrame.cpp | 100 ++--- mozilla/layout/generic/nsGfxScrollFrame.h | 40 +- mozilla/layout/generic/nsHTMLFrame.cpp | 32 +- mozilla/layout/generic/nsIFrame.h | 16 +- mozilla/layout/generic/nsInlineFrame.cpp | 80 ++-- mozilla/layout/generic/nsInlineFrame.h | 56 +-- mozilla/layout/generic/nsObjectFrame.cpp | 4 +- mozilla/layout/generic/nsViewportFrame.cpp | 20 +- mozilla/layout/generic/nsViewportFrame.h | 12 +- .../layout/svg/base/src/nsSVGDefsFrame.cpp | 33 +- mozilla/layout/svg/base/src/nsSVGDefsFrame.h | 16 +- .../svg/base/src/nsSVGForeignObjectFrame.cpp | 50 +-- .../base/src/nsSVGGenericContainerFrame.cpp | 31 +- .../svg/base/src/nsSVGGenericContainerFrame.h | 16 +- .../svg/base/src/nsSVGInnerSVGFrame.cpp | 37 +- .../svg/base/src/nsSVGOuterSVGFrame.cpp | 49 +-- .../layout/svg/base/src/nsSVGTSpanFrame.cpp | 37 +- .../layout/svg/base/src/nsSVGTextFrame.cpp | 37 +- mozilla/layout/tables/nsTableCellFrame.cpp | 43 +- mozilla/layout/tables/nsTableCellFrame.h | 21 +- .../layout/tables/nsTableColGroupFrame.cpp | 73 ++-- mozilla/layout/tables/nsTableColGroupFrame.h | 36 +- mozilla/layout/tables/nsTableFrame.cpp | 380 ++++++++---------- mozilla/layout/tables/nsTableFrame.h | 120 ++---- mozilla/layout/tables/nsTableOuterFrame.cpp | 22 +- mozilla/layout/tables/nsTableOuterFrame.h | 12 +- mozilla/layout/tables/nsTableRowFrame.cpp | 36 +- mozilla/layout/tables/nsTableRowFrame.h | 12 +- .../layout/tables/nsTableRowGroupFrame.cpp | 26 +- mozilla/layout/tables/nsTableRowGroupFrame.h | 12 +- mozilla/layout/xul/base/src/nsBoxFrame.cpp | 21 +- mozilla/layout/xul/base/src/nsBoxFrame.h | 12 +- mozilla/layout/xul/base/src/nsMenuFrame.cpp | 35 +- mozilla/layout/xul/base/src/nsMenuFrame.h | 12 +- .../layout/xul/base/src/nsRootBoxFrame.cpp | 38 +- .../layout/xul/base/src/nsScrollBoxFrame.cpp | 65 ++- .../layout/xul/base/src/nsScrollBoxFrame.h | 21 +- mozilla/layout/xul/base/src/nsSliderFrame.cpp | 26 +- mozilla/layout/xul/base/src/nsSliderFrame.h | 14 +- 57 files changed, 761 insertions(+), 1371 deletions(-) diff --git a/mozilla/layout/base/nsBidiPresUtils.cpp b/mozilla/layout/base/nsBidiPresUtils.cpp index 8e404960dfb..006efddafd6 100644 --- a/mozilla/layout/base/nsBidiPresUtils.cpp +++ b/mozilla/layout/base/nsBidiPresUtils.cpp @@ -130,8 +130,7 @@ CreateBidiContinuation(nsPresContext* aPresContext, (*aNewFrame)->SetNextSibling(nsnull); // The list name nsLayoutAtoms::nextBidi would indicate we don't want reflow - parent->InsertFrames(aPresContext, *presShell, nsLayoutAtoms::nextBidi, - aFrame, *aNewFrame); + parent->InsertFrames(nsLayoutAtoms::nextBidi, aFrame, *aNewFrame); return NS_OK; } @@ -768,8 +767,6 @@ nsBidiPresUtils::RemoveBidiContinuation(nsPresContext* aPresContext, PRInt32 index; nsIFrame* parent = aFrame->GetParent(); - nsIPresShell *presShell = aPresContext->PresShell(); - aOffset = 0; for (index = aLastIndex; index > aFirstIndex; index--) { @@ -782,8 +779,7 @@ nsBidiPresUtils::RemoveBidiContinuation(nsPresContext* aPresContext, if (frame->GetStateBits() & NS_FRAME_IS_BIDI) { // only delete Bidi frames if (parent) { - parent->RemoveFrame(aPresContext, *presShell, - nsLayoutAtoms::nextBidi, frame); + parent->RemoveFrame(nsLayoutAtoms::nextBidi, frame); } else { frame->Destroy(aPresContext); diff --git a/mozilla/layout/base/nsCSSFrameConstructor.cpp b/mozilla/layout/base/nsCSSFrameConstructor.cpp index 566b25c9c0a..19d4fbcc084 100644 --- a/mozilla/layout/base/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/base/nsCSSFrameConstructor.cpp @@ -1317,8 +1317,7 @@ nsFrameConstructorState::ProcessFrameInsertions(nsAbsoluteItems& aFrameItems, firstNewFrame->GetContent(), containingBlock->GetContent()) < 0) { // no lastChild, or lastChild comes before the new children, so just append - rv = containingBlock->AppendFrames(mPresContext, *mPresShell, aChildListName, - firstNewFrame); + rv = containingBlock->AppendFrames(aChildListName, firstNewFrame); } else { nsIFrame* insertionPoint = nsnull; // try the other children @@ -1332,9 +1331,9 @@ nsFrameConstructorState::ProcessFrameInsertions(nsAbsoluteItems& aFrameItems, } insertionPoint = f; } - - rv = containingBlock->InsertFrames(mPresContext, *mPresShell, aChildListName, - insertionPoint, firstNewFrame); + + rv = containingBlock->InsertFrames(aChildListName, insertionPoint, + firstNewFrame); } } aFrameItems.childList = nsnull; @@ -9197,10 +9196,7 @@ nsCSSFrameConstructor::ContentInserted(nsPresContext* aPresContext, // empty, so we can simply append). NS_ASSERTION(mDocElementContainingBlock->GetFirstChild(nsnull) == nsnull, "Unexpected child of document element containing block"); - mDocElementContainingBlock->AppendFrames(aPresContext, - *shell, - nsnull, - docElementFrame); + mDocElementContainingBlock->AppendFrames(nsnull, docElementFrame); } #ifdef DEBUG @@ -9467,7 +9463,8 @@ nsCSSFrameConstructor::ContentInserted(nsPresContext* aPresContext, // XXXwaterson this seems wrong; i.e., how can we assume // that appending is the right thing to do here? state.mFrameManager->AppendFrames(outerTableFrame, - nsLayoutAtoms::captionList, newFrame); + nsLayoutAtoms::captionList, + newFrame); } else { state.mFrameManager->InsertFrames(parentFrame, @@ -12274,8 +12271,7 @@ nsCSSFrameConstructor::InsertFirstLineFrames( // We got lucky: aPrevSibling was the last inline frame in // the line-frame. ReparentFrame(aPresContext, aBlockFrame, firstLineStyle, newFrame); - aState.mFrameManager->InsertFrames(aPresContext, *aState.mPresShell, - aBlockFrame, nsnull, + aState.mFrameManager->InsertFrames(aBlockFrame, nsnull, prevSiblingParent, newFrame); aFrameItems.childList = nsnull; aFrameItems.lastChild = nsnull; @@ -12546,12 +12542,10 @@ nsCSSFrameConstructor::WrapFramesInFirstLetterFrame( // Take the old textFrame out of the inline parents child list DeletingFrameSubtree(aPresContext, aState.mPresShell, aState.mFrameManager, textFrame); - parentFrame->RemoveFrame(aPresContext, *aState.mPresShell, - nsnull, textFrame); + parentFrame->RemoveFrame(nsnull, textFrame); // Insert in the letter frame(s) - parentFrame->InsertFrames(aPresContext, *aState.mPresShell, - nsnull, prevFrame, letterFrames.childList); + parentFrame->InsertFrames(nsnull, prevFrame, letterFrames.childList); } } @@ -12849,12 +12843,10 @@ nsCSSFrameConstructor::RecoverLetterFrames(nsIPresShell* aPresShell, nsPresConte // Take the old textFrame out of the parents child list DeletingFrameSubtree(aPresContext, aState.mPresShell, aState.mFrameManager, textFrame); - parentFrame->RemoveFrame(aPresContext, *aState.mPresShell, - nsnull, textFrame); + parentFrame->RemoveFrame(nsnull, textFrame); // Insert in the letter frame(s) - parentFrame->InsertFrames(aPresContext, *aState.mPresShell, - nsnull, prevFrame, letterFrames.childList); + parentFrame->InsertFrames(nsnull, prevFrame, letterFrames.childList); } return rv; } @@ -13509,7 +13501,7 @@ nsCSSFrameConstructor::SplitToContainingBlock(nsPresContext* aPresContext, aRightInlineChildFrame->SetParent(aFrame); aBlockChildFrame->SetNextSibling(aRightInlineChildFrame); - aFrame->InsertFrames(aPresContext, *shell, nsnull, aLeftInlineChildFrame, aBlockChildFrame); + aFrame->InsertFrames(nsnull, aLeftInlineChildFrame, aBlockChildFrame); // If aLeftInlineChild has a view... if (aLeftInlineChildFrame && aLeftInlineChildFrame->HasView()) { diff --git a/mozilla/layout/base/nsFrameManager.cpp b/mozilla/layout/base/nsFrameManager.cpp index 4c68be4f748..2b7ccdf9e14 100644 --- a/mozilla/layout/base/nsFrameManager.cpp +++ b/mozilla/layout/base/nsFrameManager.cpp @@ -700,12 +700,10 @@ nsFrameManager::InsertFrames(nsIFrame* aParentFrame, nsIFrame* aPrevFrame, nsIFrame* aFrameList) { - nsIPresShell *presShell = GetPresShell(); - nsPresContext *presContext = presShell->GetPresContext(); #ifdef IBMBIDI if (aPrevFrame) { // Insert aFrameList after the last bidi continuation of aPrevFrame. - nsPropertyTable *propTable = presContext->PropertyTable(); + nsPropertyTable *propTable = GetPresContext()->PropertyTable(); nsIFrame* nextBidi; for (; ;) { nextBidi = NS_STATIC_CAST(nsIFrame*, @@ -718,8 +716,7 @@ nsFrameManager::InsertFrames(nsIFrame* aParentFrame, } #endif // IBMBIDI - return aParentFrame->InsertFrames(GetPresContext(), *presShell, - aListName, aPrevFrame, aFrameList); + return aParentFrame->InsertFrames(aListName, aPrevFrame, aFrameList); } nsresult @@ -736,8 +733,7 @@ nsFrameManager::RemoveFrame(nsIFrame* aParentFrame, } #endif // IBMBIDI - return aParentFrame->RemoveFrame(GetPresContext(), *GetPresShell(), - aListName, aOldFrame); + return aParentFrame->RemoveFrame(aListName, aOldFrame); } //---------------------------------------------------------------------- diff --git a/mozilla/layout/base/nsFrameManager.h b/mozilla/layout/base/nsFrameManager.h index 4901804b884..f70a0b03b5b 100644 --- a/mozilla/layout/base/nsFrameManager.h +++ b/mozilla/layout/base/nsFrameManager.h @@ -139,8 +139,7 @@ public: nsIAtom* aListName, nsIFrame* aFrameList) { - return aParentFrame->AppendFrames(GetPresContext(), *GetPresShell(), - aListName, aFrameList); + return aParentFrame->AppendFrames(aListName, aFrameList); } NS_HIDDEN_(nsresult) InsertFrames(nsIFrame* aParentFrame, @@ -157,8 +156,7 @@ public: nsIFrame* aOldFrame, nsIFrame* aNewFrame) { - return aParentFrame->ReplaceFrame(GetPresContext(), *GetPresShell(), - aListName, aOldFrame, aNewFrame); + return aParentFrame->ReplaceFrame(aListName, aOldFrame, aNewFrame); } // Notification that we were unable to render a replaced element diff --git a/mozilla/layout/forms/nsFieldSetFrame.cpp b/mozilla/layout/forms/nsFieldSetFrame.cpp index debb61ab858..0f3b6368b8c 100644 --- a/mozilla/layout/forms/nsFieldSetFrame.cpp +++ b/mozilla/layout/forms/nsFieldSetFrame.cpp @@ -86,26 +86,15 @@ public: PRUint32 aFlags); virtual PRBool CanPaintBackground(); - - NS_IMETHOD AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aFrameList); - NS_IMETHOD InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD AppendFrames(nsIAtom* aListName, + nsIFrame* aFrameList); + NS_IMETHOD InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList); - - NS_IMETHOD RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame); - - NS_IMETHOD ReplaceFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD ReplaceFrame(nsIAtom* aListName, nsIFrame* aOldFrame, nsIFrame* aNewFrame); @@ -613,39 +602,32 @@ nsFieldSetFrame::GetSkipSides() const } NS_IMETHODIMP -nsFieldSetFrame::AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsFieldSetFrame::AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList) { aFrameList = MaybeSetLegend(aFrameList, aListName); if (aFrameList) { ReParentFrameList(aFrameList); - return mContentFrame->AppendFrames(aPresContext, aPresShell, aListName, aFrameList); + return mContentFrame->AppendFrames(aListName, aFrameList); } return NS_OK; } NS_IMETHODIMP -nsFieldSetFrame::InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsFieldSetFrame::InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList) { aFrameList = MaybeSetLegend(aFrameList, aListName); if (aFrameList) { ReParentFrameList(aFrameList); - return mContentFrame->InsertFrames(aPresContext, aPresShell, aListName, - aPrevFrame, aFrameList); + return mContentFrame->InsertFrames(aListName, aPrevFrame, aFrameList); } return NS_OK; } NS_IMETHODIMP -nsFieldSetFrame::RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsFieldSetFrame::RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame) { // For reference, see bug 70648, bug 276104 and bug 236071. @@ -653,31 +635,28 @@ nsFieldSetFrame::RemoveFrame(nsPresContext* aPresContext, 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(aPresContext, mLegendFrame); + nsPresContext* presContext = GetPresContext(); + mFrames.DestroyFrame(presContext, mLegendFrame); mLegendFrame = nsnull; AddStateBits(NS_FRAME_IS_DIRTY); if (GetParent()) { - GetParent()->ReflowDirtyChild(aPresContext->GetPresShell(), this); + GetParent()->ReflowDirtyChild(presContext->GetPresShell(), this); } return NS_OK; } - return mContentFrame->RemoveFrame(aPresContext, aPresShell, aListName, aOldFrame); + return mContentFrame->RemoveFrame(aListName, aOldFrame); } NS_IMETHODIMP -nsFieldSetFrame::ReplaceFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsFieldSetFrame::ReplaceFrame(nsIAtom* aListName, nsIFrame* aOldFrame, nsIFrame* aNewFrame) { if (aOldFrame == mLegendFrame) { mLegendFrame = aNewFrame; - return nsContainerFrame::ReplaceFrame(aPresContext, aPresShell, aListName, - aOldFrame, aNewFrame); + return nsContainerFrame::ReplaceFrame(aListName, aOldFrame, aNewFrame); } - return mContentFrame->ReplaceFrame(aPresContext, aPresShell, aListName, - aOldFrame, aNewFrame); + return mContentFrame->ReplaceFrame(aListName, aOldFrame, aNewFrame); } NS_IMETHODIMP diff --git a/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp b/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp index 15fe0a8d6a0..7daaa90c130 100644 --- a/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp +++ b/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp @@ -645,58 +645,36 @@ NS_IMETHODIMP nsHTMLButtonControlFrame::SetSuggestedSize(nscoord aWidth, nscoord NS_IMETHODIMP -nsHTMLButtonControlFrame::AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsHTMLButtonControlFrame::AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList) { - ReParentFrameList(aPresContext->FrameManager(), aFrameList); - return mFrames.FirstChild()->AppendFrames(aPresContext, - aPresShell, - aListName, - aFrameList); + ReParentFrameList(GetPresContext()->FrameManager(), aFrameList); + return mFrames.FirstChild()->AppendFrames(aListName, aFrameList); } NS_IMETHODIMP -nsHTMLButtonControlFrame::InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsHTMLButtonControlFrame::InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList) { - ReParentFrameList(aPresContext->FrameManager(), aFrameList); - return mFrames.FirstChild()->InsertFrames(aPresContext, - aPresShell, - aListName, - aPrevFrame, - aFrameList); + ReParentFrameList(GetPresContext()->FrameManager(), aFrameList); + return mFrames.FirstChild()->InsertFrames(aListName, aPrevFrame, aFrameList); } NS_IMETHODIMP -nsHTMLButtonControlFrame::RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsHTMLButtonControlFrame::RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame) { - return mFrames.FirstChild()->RemoveFrame(aPresContext, - aPresShell, - aListName, - aOldFrame); + return mFrames.FirstChild()->RemoveFrame(aListName, aOldFrame); } NS_IMETHODIMP -nsHTMLButtonControlFrame::ReplaceFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsHTMLButtonControlFrame::ReplaceFrame(nsIAtom* aListName, nsIFrame* aOldFrame, nsIFrame* aNewFrame) { - ReParentFrameList(aPresContext->FrameManager(), aNewFrame); - return mFrames.FirstChild()->ReplaceFrame(aPresContext, - aPresShell, - aListName, - aOldFrame, - aNewFrame); + ReParentFrameList(GetPresContext()->FrameManager(), aNewFrame); + return mFrames.FirstChild()->ReplaceFrame(aListName, aOldFrame, aNewFrame); } NS_IMETHODIMP diff --git a/mozilla/layout/forms/nsHTMLButtonControlFrame.h b/mozilla/layout/forms/nsHTMLButtonControlFrame.h index 6ea7bfac473..b6d3a14405f 100644 --- a/mozilla/layout/forms/nsHTMLButtonControlFrame.h +++ b/mozilla/layout/forms/nsHTMLButtonControlFrame.h @@ -101,25 +101,17 @@ public: virtual void SetAdditionalStyleContext(PRInt32 aIndex, nsStyleContext* aStyleContext); - NS_IMETHOD AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList); - NS_IMETHOD InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList); - NS_IMETHOD RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame); - NS_IMETHOD ReplaceFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD ReplaceFrame(nsIAtom* aListName, nsIFrame* aOldFrame, nsIFrame* aNewFrame); diff --git a/mozilla/layout/generic/nsAbsoluteContainingBlock.cpp b/mozilla/layout/generic/nsAbsoluteContainingBlock.cpp index 42730d3789c..d4874dadf4e 100644 --- a/mozilla/layout/generic/nsAbsoluteContainingBlock.cpp +++ b/mozilla/layout/generic/nsAbsoluteContainingBlock.cpp @@ -74,11 +74,9 @@ nsAbsoluteContainingBlock::SetInitialChildList(nsIFrame* aDelegatingFrame, } nsresult -nsAbsoluteContainingBlock::AppendFrames(nsIFrame* aDelegatingFrame, - nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aFrameList) +nsAbsoluteContainingBlock::AppendFrames(nsIFrame* aDelegatingFrame, + nsIAtom* aListName, + nsIFrame* aFrameList) { nsresult rv = NS_OK; @@ -93,19 +91,18 @@ nsAbsoluteContainingBlock::AppendFrames(nsIFrame* aDelegatingFrame, rv = NS_NewHTMLReflowCommand(&reflowCmd, aDelegatingFrame, eReflowType_ReflowDirty); if (NS_SUCCEEDED(rv)) { reflowCmd->SetChildListName(GetChildListName()); - aPresShell.AppendReflowCommand(reflowCmd); + aDelegatingFrame->GetPresContext()->PresShell()-> + AppendReflowCommand(reflowCmd); } return rv; } nsresult -nsAbsoluteContainingBlock::InsertFrames(nsIFrame* aDelegatingFrame, - nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aPrevFrame, - nsIFrame* aFrameList) +nsAbsoluteContainingBlock::InsertFrames(nsIFrame* aDelegatingFrame, + nsIAtom* aListName, + nsIFrame* aPrevFrame, + nsIFrame* aFrameList) { nsresult rv = NS_OK; @@ -120,7 +117,8 @@ nsAbsoluteContainingBlock::InsertFrames(nsIFrame* aDelegatingFrame, rv = NS_NewHTMLReflowCommand(&reflowCmd, aDelegatingFrame, eReflowType_ReflowDirty); if (NS_SUCCEEDED(rv)) { reflowCmd->SetChildListName(GetChildListName()); - aPresShell.AppendReflowCommand(reflowCmd); + aDelegatingFrame->GetPresContext()->PresShell()-> + AppendReflowCommand(reflowCmd); } return rv; @@ -128,12 +126,11 @@ nsAbsoluteContainingBlock::InsertFrames(nsIFrame* aDelegatingFrame, nsresult nsAbsoluteContainingBlock::RemoveFrame(nsIFrame* aDelegatingFrame, - nsPresContext* aPresContext, - nsIPresShell& aPresShell, nsIAtom* aListName, nsIFrame* aOldFrame) { - PRBool result = mAbsoluteFrames.DestroyFrame(aPresContext, 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 @@ -142,14 +139,12 @@ nsAbsoluteContainingBlock::RemoveFrame(nsIFrame* aDelegatingFrame, } nsresult -nsAbsoluteContainingBlock::ReplaceFrame(nsIFrame* aDelegatingFrame, - nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aOldFrame, - nsIFrame* aNewFrame) +nsAbsoluteContainingBlock::ReplaceFrame(nsIFrame* aDelegatingFrame, + nsIAtom* aListName, + nsIFrame* aOldFrame, + nsIFrame* aNewFrame) { - PRBool result = mAbsoluteFrames.ReplaceFrame(aPresContext, aDelegatingFrame, + PRBool result = mAbsoluteFrames.ReplaceFrame(aDelegatingFrame, aOldFrame, aNewFrame, PR_TRUE); NS_ASSERTION(result, "Problems replacing a frame"); return result ? NS_OK : NS_ERROR_FAILURE; diff --git a/mozilla/layout/generic/nsAbsoluteContainingBlock.h b/mozilla/layout/generic/nsAbsoluteContainingBlock.h index ed9f269f643..376115c6345 100644 --- a/mozilla/layout/generic/nsAbsoluteContainingBlock.h +++ b/mozilla/layout/generic/nsAbsoluteContainingBlock.h @@ -73,28 +73,20 @@ public: nsPresContext* aPresContext, nsIAtom* aListName, nsIFrame* aChildList); - nsresult AppendFrames(nsIFrame* aDelegatingFrame, - nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aFrameList); - nsresult InsertFrames(nsIFrame* aDelegatingFrame, - nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aPrevFrame, - nsIFrame* aFrameList); - nsresult RemoveFrame(nsIFrame* aDelegatingFrame, - nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aOldFrame); - nsresult ReplaceFrame(nsIFrame* aDelegatingFrame, - nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aOldFrame, - nsIFrame* aNewFrame); + nsresult AppendFrames(nsIFrame* aDelegatingFrame, + nsIAtom* aListName, + nsIFrame* aFrameList); + nsresult InsertFrames(nsIFrame* aDelegatingFrame, + nsIAtom* aListName, + nsIFrame* aPrevFrame, + nsIFrame* aFrameList); + nsresult RemoveFrame(nsIFrame* aDelegatingFrame, + nsIAtom* aListName, + nsIFrame* aOldFrame); + nsresult ReplaceFrame(nsIFrame* aDelegatingFrame, + nsIAtom* aListName, + nsIFrame* aOldFrame, + nsIFrame* aNewFrame); // Called by the delegating frame after it has done its reflow first. This // function will reflow any absolutely positioned child frames that need to diff --git a/mozilla/layout/generic/nsBlockFrame.cpp b/mozilla/layout/generic/nsBlockFrame.cpp index fbdd159054a..21274e4eb6a 100644 --- a/mozilla/layout/generic/nsBlockFrame.cpp +++ b/mozilla/layout/generic/nsBlockFrame.cpp @@ -4900,17 +4900,14 @@ nsBlockFrame::LastChild() } NS_IMETHODIMP -nsBlockFrame::AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsBlockFrame::AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList) { if (nsnull == aFrameList) { return NS_OK; } if (mAbsoluteContainer.GetChildListName() == aListName) { - return mAbsoluteContainer.AppendFrames(this, aPresContext, aPresShell, aListName, - aFrameList); + return mAbsoluteContainer.AppendFrames(this, aListName, aFrameList); } else if (nsLayoutAtoms::floatList == aListName) { // XXX we don't *really* care about this right now because we are @@ -4940,24 +4937,22 @@ nsBlockFrame::AppendFrames(nsPresContext* aPresContext, } printf("\n"); #endif - nsresult rv = AddFrames(aPresContext, aFrameList, lastKid); + nsresult rv = AddFrames(aFrameList, lastKid); if (NS_SUCCEEDED(rv)) { // Ask the parent frame to reflow me. - ReflowDirtyChild(&aPresShell, nsnull); + ReflowDirtyChild(GetPresContext()->PresShell(), nsnull); } return rv; } NS_IMETHODIMP -nsBlockFrame::InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsBlockFrame::InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList) { if (mAbsoluteContainer.GetChildListName() == aListName) { - return mAbsoluteContainer.InsertFrames(this, aPresContext, aPresShell, aListName, - aPrevFrame, aFrameList); + return mAbsoluteContainer.InsertFrames(this, aListName, aPrevFrame, + aFrameList); } else if (nsLayoutAtoms::floatList == aListName) { // XXX we don't *really* care about this right now because we are @@ -4982,20 +4977,19 @@ nsBlockFrame::InsertFrames(nsPresContext* aPresContext, } printf("\n"); #endif - nsresult rv = AddFrames(aPresContext, aFrameList, aPrevFrame); + nsresult rv = AddFrames(aFrameList, aPrevFrame); #ifdef IBMBIDI if (aListName != nsLayoutAtoms::nextBidi) #endif // IBMBIDI if (NS_SUCCEEDED(rv)) { // Ask the parent frame to reflow me. - ReflowDirtyChild(&aPresShell, nsnull); + ReflowDirtyChild(GetPresContext()->PresShell(), nsnull); } return rv; } nsresult -nsBlockFrame::AddFrames(nsPresContext* aPresContext, - nsIFrame* aFrameList, +nsBlockFrame::AddFrames(nsIFrame* aFrameList, nsIFrame* aPrevSibling) { // Clear our line cursor, since our lines may change. @@ -5005,7 +4999,7 @@ nsBlockFrame::AddFrames(nsPresContext* aPresContext, return NS_OK; } - nsIPresShell *presShell = aPresContext->PresShell(); + nsIPresShell *presShell = GetPresContext()->PresShell(); // Attempt to find the line that contains the previous sibling nsLineList::iterator prevSibLine = end_lines(); @@ -5116,9 +5110,7 @@ nsBlockFrame::RemoveFloat(nsIFrame* aFloat) { } NS_IMETHODIMP -nsBlockFrame::RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsBlockFrame::RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame) { nsresult rv = NS_OK; @@ -5131,11 +5123,10 @@ nsBlockFrame::RemoveFrame(nsPresContext* aPresContext, #endif if (nsnull == aListName) { - rv = DoRemoveFrame(aPresContext, aOldFrame); + rv = DoRemoveFrame(aOldFrame); } else if (mAbsoluteContainer.GetChildListName() == aListName) { - return mAbsoluteContainer.RemoveFrame(this, aPresContext, aPresShell, - aListName, aOldFrame); + return mAbsoluteContainer.RemoveFrame(this, aListName, aOldFrame); } else if (nsLayoutAtoms::floatList == aListName) { line_iterator line = RemoveFloat(aOldFrame); @@ -5150,7 +5141,7 @@ nsBlockFrame::RemoveFrame(nsPresContext* aPresContext, #ifdef IBMBIDI else if (nsLayoutAtoms::nextBidi == aListName) { // Skip the call to |ReflowDirtyChild| below by returning now. - return DoRemoveFrame(aPresContext, aOldFrame); + return DoRemoveFrame(aOldFrame); } #endif // IBMBIDI else { @@ -5159,19 +5150,18 @@ nsBlockFrame::RemoveFrame(nsPresContext* aPresContext, if (NS_SUCCEEDED(rv)) { // Ask the parent frame to reflow me. - ReflowDirtyChild(&aPresShell, nsnull); + ReflowDirtyChild(GetPresContext()->PresShell(), nsnull); } return rv; } void -nsBlockFrame::DoRemoveOutOfFlowFrame(nsPresContext* aPresContext, - nsIFrame* aFrame) +nsBlockFrame::DoRemoveOutOfFlowFrame(nsIFrame* aFrame) { // First remove aFrame's next in flow nsIFrame* nextInFlow = aFrame->GetNextInFlow(); if (nextInFlow) { - nsBlockFrame::DoRemoveOutOfFlowFrame(aPresContext, nextInFlow); + nsBlockFrame::DoRemoveOutOfFlowFrame(nextInFlow); } // Now remove aFrame const nsStyleDisplay* display = aFrame->GetStyleDisplay(); @@ -5188,10 +5178,10 @@ nsBlockFrame::DoRemoveOutOfFlowFrame(nsPresContext* aPresContext, nsBlockFrame* block = (nsBlockFrame*)parent; // Remove aFrame from the appropriate list. if (display->IsAbsolutelyPositioned()) { - block->mAbsoluteContainer.RemoveFrame(block, aPresContext, - *(aPresContext->PresShell()), - block->mAbsoluteContainer.GetChildListName(), aFrame); - aFrame->Destroy(aPresContext); + block->mAbsoluteContainer.RemoveFrame(block, + block->mAbsoluteContainer.GetChildListName(), + aFrame); + aFrame->Destroy(aFrame->GetPresContext()); } else { // This also destroys the frame. @@ -5225,19 +5215,19 @@ nsBlockFrame::TryAllLines(nsLineList::iterator* aIterator, // start by locating aDeletedFrame and then scanning from that point // on looking for continuations. nsresult -nsBlockFrame::DoRemoveFrame(nsPresContext* aPresContext, - nsIFrame* aDeletedFrame) +nsBlockFrame::DoRemoveFrame(nsIFrame* aDeletedFrame) { // Clear our line cursor, since our lines may change. ClearLineCursor(); if (aDeletedFrame->GetStateBits() & NS_FRAME_OUT_OF_FLOW) { - DoRemoveOutOfFlowFrame(aPresContext, aDeletedFrame); + DoRemoveOutOfFlowFrame(aDeletedFrame); return NS_OK; } - - nsIPresShell *presShell = aPresContext->PresShell(); + nsPresContext* presContext = GetPresContext(); + nsIPresShell* presShell = presContext->PresShell(); + // Find the line and the previous sibling that contains // deletedFrame; we also find the pointer to the line. nsLineList::iterator line = mLines.begin(), @@ -5325,7 +5315,7 @@ found_frame:; nsFrame::ListTag(stdout, aDeletedFrame); printf(" prevSibling=%p deletedNextInFlow=%p\n", prevSibling, deletedNextInFlow); #endif - aDeletedFrame->Destroy(aPresContext); + aDeletedFrame->Destroy(presContext); aDeletedFrame = deletedNextInFlow; // If line is empty, remove it now. @@ -5399,7 +5389,7 @@ found_frame:; nsBlockFrame* nextBlock = NS_STATIC_CAST(nsBlockFrame*, aDeletedFrame->GetParent()); NS_ASSERTION(nextBlock->GetType() == nsLayoutAtoms::blockFrame, "Our child's continuation's parent is not a block?"); - return nextBlock->DoRemoveFrame(aPresContext, aDeletedFrame); + return nextBlock->DoRemoveFrame(aDeletedFrame); } return NS_OK; @@ -5419,7 +5409,7 @@ nsBlockFrame::DeleteNextInFlowChild(nsPresContext* aPresContext, aPresContext->PropertyTable()->GetProperty(prevInFlow, nsLayoutAtoms::nextBidi)) != aNextInFlow)) #endif // IBMBIDI - DoRemoveFrame(aPresContext, aNextInFlow); + DoRemoveFrame(aNextInFlow); } //////////////////////////////////////////////////////////////////////// @@ -6757,7 +6747,7 @@ nsBlockFrame::SetInitialChildList(nsPresContext* aPresContext, } } - rv = AddFrames(aPresContext, aChildList, nsnull); + rv = AddFrames(aChildList, nsnull); if (NS_FAILED(rv)) { return rv; } @@ -6800,7 +6790,7 @@ nsBlockFrame::SetInitialChildList(nsPresContext* aPresContext, // it to the flow now. if (NS_STYLE_LIST_STYLE_POSITION_INSIDE == styleList->mListStylePosition) { - AddFrames(aPresContext, mBullet, nsnull); + AddFrames(mBullet, nsnull); mState &= ~NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET; } else { diff --git a/mozilla/layout/generic/nsBlockFrame.h b/mozilla/layout/generic/nsBlockFrame.h index bedf267de37..105af185898 100644 --- a/mozilla/layout/generic/nsBlockFrame.h +++ b/mozilla/layout/generic/nsBlockFrame.h @@ -119,18 +119,12 @@ public: NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext, nsIAtom* aListName, nsIFrame* aChildList); - NS_IMETHOD AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList); - NS_IMETHOD InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList); - NS_IMETHOD RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame); virtual nsIFrame* GetFirstChild(nsIAtom* aListName) const; NS_IMETHOD SetParent(const nsIFrame* aParent); @@ -333,8 +327,7 @@ protected: * contains aPrevSibling and add aFrameList after aPrevSibling on that line. * new lines are created as necessary to handle block data in aFrameList. */ - nsresult AddFrames(nsPresContext* aPresContext, - nsIFrame* aFrameList, + nsresult AddFrames(nsIFrame* aFrameList, nsIFrame* aPrevSibling); /** does all the real work for removing aDeletedFrame from this @@ -342,8 +335,7 @@ protected: * handled continued frames * marks lines dirty as needed */ - nsresult DoRemoveFrame(nsPresContext* aPresContext, - nsIFrame* aDeletedFrame); + nsresult DoRemoveFrame(nsIFrame* aDeletedFrame); /** grab overflow lines from this block's prevInFlow, and make them * part of this block's mLines list. @@ -358,8 +350,7 @@ protected: line_iterator RemoveFloat(nsIFrame* aFloat); // Remove a float, abs, rel positioned frame from the appropriate block's list - static void DoRemoveOutOfFlowFrame(nsPresContext* aPresContext, - nsIFrame* aFrame); + static void DoRemoveOutOfFlowFrame(nsIFrame* aFrame); /** set up the conditions necessary for an initial reflow */ nsresult PrepareInitialReflow(nsBlockReflowState& aState); diff --git a/mozilla/layout/generic/nsColumnSetFrame.cpp b/mozilla/layout/generic/nsColumnSetFrame.cpp index e808bce9b74..a51e39a990b 100644 --- a/mozilla/layout/generic/nsColumnSetFrame.cpp +++ b/mozilla/layout/generic/nsColumnSetFrame.cpp @@ -61,18 +61,12 @@ public: const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus); - NS_IMETHOD AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList); - NS_IMETHOD InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList); - NS_IMETHOD RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame); virtual nsIFrame* GetContentInsertionFrame() { @@ -860,31 +854,25 @@ nsColumnSetFrame::GetSkipSides() const } NS_IMETHODIMP -nsColumnSetFrame::AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aFrameList) +nsColumnSetFrame::AppendFrames(nsIAtom* aListName, + nsIFrame* aFrameList) { NS_NOTREACHED("AppendFrames not supported"); return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -nsColumnSetFrame::InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aPrevFrame, - nsIFrame* aFrameList) +nsColumnSetFrame::InsertFrames(nsIAtom* aListName, + nsIFrame* aPrevFrame, + nsIFrame* aFrameList) { NS_NOTREACHED("InsertFrames not supported"); return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP -nsColumnSetFrame::RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aOldFrame) +nsColumnSetFrame::RemoveFrame(nsIAtom* aListName, + nsIFrame* aOldFrame) { NS_NOTREACHED("RemoveFrame not supported"); return NS_ERROR_NOT_IMPLEMENTED; diff --git a/mozilla/layout/generic/nsContainerFrame.cpp b/mozilla/layout/generic/nsContainerFrame.cpp index aeea436b127..5951f355ae0 100644 --- a/mozilla/layout/generic/nsContainerFrame.cpp +++ b/mozilla/layout/generic/nsContainerFrame.cpp @@ -386,9 +386,7 @@ nsContainerFrame::GetFrameForPointUsing(const nsPoint& aPoint, } NS_IMETHODIMP -nsContainerFrame::ReplaceFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsContainerFrame::ReplaceFrame(nsIAtom* aListName, nsIFrame* aOldFrame, nsIFrame* aNewFrame) { @@ -401,9 +399,9 @@ nsContainerFrame::ReplaceFrame(nsPresContext* aPresContext, prevFrame = frames.GetPrevSiblingFor(aOldFrame); // Default implementation treats it like two separate operations - rv = RemoveFrame(aPresContext, aPresShell, aListName, aOldFrame); + rv = RemoveFrame(aListName, aOldFrame); if (NS_SUCCEEDED(rv)) { - rv = InsertFrames(aPresContext, aPresShell, aListName, prevFrame, aNewFrame); + rv = InsertFrames(aListName, prevFrame, aNewFrame); } return rv; diff --git a/mozilla/layout/generic/nsContainerFrame.h b/mozilla/layout/generic/nsContainerFrame.h index 5847fd38273..64c1a30a244 100644 --- a/mozilla/layout/generic/nsContainerFrame.h +++ b/mozilla/layout/generic/nsContainerFrame.h @@ -73,9 +73,7 @@ public: NS_IMETHOD GetFrameForPoint(const nsPoint& aPoint, nsFramePaintLayer aWhichLayer, nsIFrame** aFrame); - NS_IMETHOD ReplaceFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD ReplaceFrame(nsIAtom* aListName, nsIFrame* aOldFrame, nsIFrame* aNewFrame); NS_IMETHOD ReflowDirtyChild(nsIPresShell* aPresShell, nsIFrame* aChild); diff --git a/mozilla/layout/generic/nsFrame.cpp b/mozilla/layout/generic/nsFrame.cpp index a544ed95f7d..ead1034f9a1 100644 --- a/mozilla/layout/generic/nsFrame.cpp +++ b/mozilla/layout/generic/nsFrame.cpp @@ -590,9 +590,7 @@ NS_IMETHODIMP nsFrame::SetInitialChildList(nsPresContext* aPresContext, } NS_IMETHODIMP -nsFrame::AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsFrame::AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList) { NS_PRECONDITION(PR_FALSE, "not a container"); @@ -600,9 +598,7 @@ nsFrame::AppendFrames(nsPresContext* aPresContext, } NS_IMETHODIMP -nsFrame::InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsFrame::InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList) { @@ -611,9 +607,7 @@ nsFrame::InsertFrames(nsPresContext* aPresContext, } NS_IMETHODIMP -nsFrame::RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsFrame::RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame) { NS_PRECONDITION(PR_FALSE, "not a container"); @@ -621,9 +615,7 @@ nsFrame::RemoveFrame(nsPresContext* aPresContext, } NS_IMETHODIMP -nsFrame::ReplaceFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsFrame::ReplaceFrame(nsIAtom* aListName, nsIFrame* aOldFrame, nsIFrame* aNewFrame) { diff --git a/mozilla/layout/generic/nsFrame.h b/mozilla/layout/generic/nsFrame.h index 4b2e40ecd8a..6ef217b57fe 100644 --- a/mozilla/layout/generic/nsFrame.h +++ b/mozilla/layout/generic/nsFrame.h @@ -169,22 +169,14 @@ public: NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext, nsIAtom* aListName, nsIFrame* aChildList); - NS_IMETHOD AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList); - NS_IMETHOD InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList); - NS_IMETHOD RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame); - NS_IMETHOD ReplaceFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD ReplaceFrame(nsIAtom* aListName, nsIFrame* aOldFrame, nsIFrame* aNewFrame); NS_IMETHOD Destroy(nsPresContext* aPresContext); diff --git a/mozilla/layout/generic/nsFrameList.cpp b/mozilla/layout/generic/nsFrameList.cpp index 592a27a462f..954eeccf312 100644 --- a/mozilla/layout/generic/nsFrameList.cpp +++ b/mozilla/layout/generic/nsFrameList.cpp @@ -321,8 +321,7 @@ nsFrameList::DoReplaceFrame(nsIFrame* aParent, } PRBool -nsFrameList::ReplaceFrame(nsPresContext* aPresContext, - nsIFrame* aParent, +nsFrameList::ReplaceFrame(nsIFrame* aParent, nsIFrame* aOldFrame, nsIFrame* aNewFrame, PRBool aDestroy) @@ -331,7 +330,7 @@ nsFrameList::ReplaceFrame(nsPresContext* aPresContext, NS_PRECONDITION(aNewFrame, "null ptr"); if (DoReplaceFrame(aParent, aOldFrame, aNewFrame)) { if (aDestroy) { - aOldFrame->Destroy(aPresContext); + aOldFrame->Destroy(aOldFrame->GetPresContext()); } return PR_TRUE; } diff --git a/mozilla/layout/generic/nsFrameList.h b/mozilla/layout/generic/nsFrameList.h index a0fd7bba556..4149612fb3d 100644 --- a/mozilla/layout/generic/nsFrameList.h +++ b/mozilla/layout/generic/nsFrameList.h @@ -106,8 +106,7 @@ public: aFrameList.mFirstChild = nsnull; } - PRBool ReplaceFrame(nsPresContext* aPresContext, - nsIFrame* aParent, + PRBool ReplaceFrame(nsIFrame* aParent, nsIFrame* aOldFrame, nsIFrame* aNewFrame, PRBool aDestroy); diff --git a/mozilla/layout/generic/nsGfxScrollFrame.cpp b/mozilla/layout/generic/nsGfxScrollFrame.cpp index 560ba1dbb08..c6809e795e9 100644 --- a/mozilla/layout/generic/nsGfxScrollFrame.cpp +++ b/mozilla/layout/generic/nsGfxScrollFrame.cpp @@ -208,62 +208,40 @@ nsHTMLScrollFrame::SetInitialChildList(nsPresContext* aPresContext, NS_IMETHODIMP -nsHTMLScrollFrame::AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aFrameList) +nsHTMLScrollFrame::AppendFrames(nsIAtom* aListName, + nsIFrame* aFrameList) { - nsresult rv = nsBoxFrame::AppendFrames(aPresContext, - aPresShell, - aListName, - aFrameList); + nsresult rv = nsBoxFrame::AppendFrames(aListName, aFrameList); mInner.ReloadChildFrames(); return rv; } NS_IMETHODIMP -nsHTMLScrollFrame::InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aPrevFrame, - nsIFrame* aFrameList) +nsHTMLScrollFrame::InsertFrames(nsIAtom* aListName, + nsIFrame* aPrevFrame, + nsIFrame* aFrameList) { - nsresult rv = nsBoxFrame::InsertFrames(aPresContext, - aPresShell, - aListName, - aPrevFrame, - aFrameList); + nsresult rv = nsBoxFrame::InsertFrames(aListName, aPrevFrame, aFrameList); mInner.ReloadChildFrames(); return rv; } NS_IMETHODIMP -nsHTMLScrollFrame::RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aOldFrame) +nsHTMLScrollFrame::RemoveFrame(nsIAtom* aListName, + nsIFrame* aOldFrame) { - nsresult rv = nsBoxFrame::RemoveFrame(aPresContext, - aPresShell, - aListName, - aOldFrame); + nsresult rv = nsBoxFrame::RemoveFrame(aListName, aOldFrame); mInner.ReloadChildFrames(); return rv; } NS_IMETHODIMP -nsHTMLScrollFrame::ReplaceFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aOldFrame, - nsIFrame* aNewFrame) +nsHTMLScrollFrame::ReplaceFrame(nsIAtom* aListName, + nsIFrame* aOldFrame, + nsIFrame* aNewFrame) { - nsresult rv = nsBoxFrame::ReplaceFrame(aPresContext, - aPresShell, - aListName, - aOldFrame, - aNewFrame); + nsresult rv = nsBoxFrame::ReplaceFrame(aListName, aOldFrame, aNewFrame); mInner.ReloadChildFrames(); return rv; } @@ -731,62 +709,40 @@ nsXULScrollFrame::SetInitialChildList(nsPresContext* aPresContext, NS_IMETHODIMP -nsXULScrollFrame::AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aFrameList) +nsXULScrollFrame::AppendFrames(nsIAtom* aListName, + nsIFrame* aFrameList) { - nsresult rv = nsBoxFrame::AppendFrames(aPresContext, - aPresShell, - aListName, - aFrameList); + nsresult rv = nsBoxFrame::AppendFrames(aListName, aFrameList); mInner.ReloadChildFrames(); return rv; } NS_IMETHODIMP -nsXULScrollFrame::InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aPrevFrame, - nsIFrame* aFrameList) +nsXULScrollFrame::InsertFrames(nsIAtom* aListName, + nsIFrame* aPrevFrame, + nsIFrame* aFrameList) { - nsresult rv = nsBoxFrame::InsertFrames(aPresContext, - aPresShell, - aListName, - aPrevFrame, - aFrameList); + nsresult rv = nsBoxFrame::InsertFrames(aListName, aPrevFrame, aFrameList); mInner.ReloadChildFrames(); return rv; } NS_IMETHODIMP -nsXULScrollFrame::RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aOldFrame) +nsXULScrollFrame::RemoveFrame(nsIAtom* aListName, + nsIFrame* aOldFrame) { - nsresult rv = nsBoxFrame::RemoveFrame(aPresContext, - aPresShell, - aListName, - aOldFrame); + nsresult rv = nsBoxFrame::RemoveFrame(aListName, aOldFrame); mInner.ReloadChildFrames(); return rv; } NS_IMETHODIMP -nsXULScrollFrame::ReplaceFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aOldFrame, - nsIFrame* aNewFrame) +nsXULScrollFrame::ReplaceFrame(nsIAtom* aListName, + nsIFrame* aOldFrame, + nsIFrame* aNewFrame) { - nsresult rv = nsBoxFrame::ReplaceFrame(aPresContext, - aPresShell, - aListName, - aOldFrame, - aNewFrame); + nsresult rv = nsBoxFrame::ReplaceFrame(aListName, aOldFrame, aNewFrame); mInner.ReloadChildFrames(); return rv; } diff --git a/mozilla/layout/generic/nsGfxScrollFrame.h b/mozilla/layout/generic/nsGfxScrollFrame.h index 33fc31bc374..4d2bf33ae51 100644 --- a/mozilla/layout/generic/nsGfxScrollFrame.h +++ b/mozilla/layout/generic/nsGfxScrollFrame.h @@ -187,27 +187,19 @@ public: // Because there can be only one child frame, these two function return // NS_ERROR_FAILURE - NS_IMETHOD AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList); - NS_IMETHOD InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList); - NS_IMETHOD ReplaceFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aOldFrame, - nsIFrame* aNewFrame); + NS_IMETHOD ReplaceFrame(nsIAtom* aListName, + nsIFrame* aOldFrame, + nsIFrame* aNewFrame); NS_IMETHOD Destroy(nsPresContext* aPresContext); - NS_IMETHOD RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame); @@ -333,27 +325,19 @@ public: // Because there can be only one child frame, these two function return // NS_ERROR_FAILURE - NS_IMETHOD AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList); - NS_IMETHOD InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList); - NS_IMETHOD ReplaceFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aOldFrame, - nsIFrame* aNewFrame); + NS_IMETHOD ReplaceFrame(nsIAtom* aListName, + nsIFrame* aOldFrame, + nsIFrame* aNewFrame); NS_IMETHOD Destroy(nsPresContext* aPresContext); - NS_IMETHOD RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame); diff --git a/mozilla/layout/generic/nsHTMLFrame.cpp b/mozilla/layout/generic/nsHTMLFrame.cpp index 4f2e338a85e..4bc897f9692 100644 --- a/mozilla/layout/generic/nsHTMLFrame.cpp +++ b/mozilla/layout/generic/nsHTMLFrame.cpp @@ -97,18 +97,12 @@ public: nsIFrame* aPrevInFlow); NS_IMETHOD Destroy(nsPresContext* aPresContext); - NS_IMETHOD AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList); - NS_IMETHOD InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList); - NS_IMETHOD RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame); NS_IMETHOD Reflow(nsPresContext* aPresContext, @@ -271,9 +265,7 @@ CanvasFrame::ScrollPositionDidChange(nsIScrollableView* aScrollable, nscoord aX, } NS_IMETHODIMP -CanvasFrame::AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +CanvasFrame::AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList) { nsresult rv; @@ -299,7 +291,7 @@ CanvasFrame::AppendFrames(nsPresContext* aPresContext, nsHTMLReflowCommand* reflowCmd; rv = NS_NewHTMLReflowCommand(&reflowCmd, this, eReflowType_ReflowDirty); if (NS_SUCCEEDED(rv)) { - aPresShell.AppendReflowCommand(reflowCmd); + GetPresContext()->PresShell()->AppendReflowCommand(reflowCmd); } } @@ -307,9 +299,7 @@ CanvasFrame::AppendFrames(nsPresContext* aPresContext, } NS_IMETHODIMP -CanvasFrame::InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +CanvasFrame::InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList) { @@ -321,16 +311,14 @@ CanvasFrame::InsertFrames(nsPresContext* aPresContext, if (aPrevFrame) { rv = NS_ERROR_UNEXPECTED; } else { - rv = AppendFrames(aPresContext, aPresShell, aListName, aFrameList); + rv = AppendFrames(aListName, aFrameList); } return rv; } NS_IMETHODIMP -CanvasFrame::RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +CanvasFrame::RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame) { nsresult rv; @@ -348,13 +336,13 @@ CanvasFrame::RemoveFrame(nsPresContext* aPresContext, Invalidate(aOldFrame->GetOverflowRect() + aOldFrame->GetPosition(), PR_FALSE); // Remove the frame and destroy it - mFrames.DestroyFrame(aPresContext, aOldFrame); + mFrames.DestroyFrame(GetPresContext(), aOldFrame); // Generate a reflow command so we get reflowed nsHTMLReflowCommand* reflowCmd; rv = NS_NewHTMLReflowCommand(&reflowCmd, this, eReflowType_ReflowDirty); if (NS_SUCCEEDED(rv)) { - aPresShell.AppendReflowCommand(reflowCmd); + GetPresContext()->PresShell()->AppendReflowCommand(reflowCmd); } } else { diff --git a/mozilla/layout/generic/nsIFrame.h b/mozilla/layout/generic/nsIFrame.h index 927427d691f..f5552e542fd 100644 --- a/mozilla/layout/generic/nsIFrame.h +++ b/mozilla/layout/generic/nsIFrame.h @@ -483,9 +483,7 @@ public: * NS_ERROR_UNEXPECTED if the frame is an atomic frame, * NS_OK otherwise */ - NS_IMETHOD AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList) = 0; /** @@ -503,9 +501,7 @@ public: * NS_ERROR_UNEXPECTED if the frame is an atomic frame, * NS_OK otherwise */ - NS_IMETHOD InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList) = 0; @@ -525,9 +521,7 @@ public: * NS_ERROR_UNEXPECTED if the frame is an atomic frame, * NS_OK otherwise */ - NS_IMETHOD RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame) = 0; /** @@ -547,9 +541,7 @@ public: * NS_ERROR_UNEXPECTED if the frame is an atomic frame, * NS_OK otherwise */ - NS_IMETHOD ReplaceFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD ReplaceFrame(nsIAtom* aListName, nsIFrame* aOldFrame, nsIFrame* aNewFrame) = 0; diff --git a/mozilla/layout/generic/nsInlineFrame.cpp b/mozilla/layout/generic/nsInlineFrame.cpp index 0577e86486c..e672075c116 100644 --- a/mozilla/layout/generic/nsInlineFrame.cpp +++ b/mozilla/layout/generic/nsInlineFrame.cpp @@ -189,10 +189,8 @@ nsInlineFrame::IsEmpty() } NS_IMETHODIMP -nsInlineFrame::AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aFrameList) +nsInlineFrame::AppendFrames(nsIAtom* aListName, + nsIFrame* aFrameList) { if (nsnull != aListName) { return NS_ERROR_INVALID_ARG; @@ -201,17 +199,15 @@ nsInlineFrame::AppendFrames(nsPresContext* aPresContext, mFrames.AppendFrames(this, aFrameList); // Ask the parent frame to reflow me. - ReflowDirtyChild(&aPresShell, nsnull); + ReflowDirtyChild(GetPresContext()->PresShell(), nsnull); } return NS_OK; } NS_IMETHODIMP -nsInlineFrame::InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aPrevFrame, - nsIFrame* aFrameList) +nsInlineFrame::InsertFrames(nsIAtom* aListName, + nsIFrame* aPrevFrame, + nsIFrame* aFrameList) { if (nsnull != aListName) { #ifdef IBMBIDI @@ -227,16 +223,14 @@ nsInlineFrame::InsertFrames(nsPresContext* aPresContext, if (nsnull == aListName) #endif // Ask the parent frame to reflow me. - ReflowDirtyChild(&aPresShell, nsnull); + ReflowDirtyChild(GetPresContext()->PresShell(), nsnull); } return NS_OK; } NS_IMETHODIMP -nsInlineFrame::RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aOldFrame) +nsInlineFrame::RemoveFrame(nsIAtom* aListName, + nsIFrame* aOldFrame) { if (nsnull != aListName) { #ifdef IBMBIDI @@ -272,7 +266,7 @@ nsInlineFrame::RemoveFrame(nsPresContext* aPresContext, // remove the frame from its parents list and generate a reflow // command. nsIFrame* oldFrameNextInFlow = aOldFrame->GetNextInFlow(); - parent->mFrames.DestroyFrame(aPresContext, aOldFrame); + parent->mFrames.DestroyFrame(GetPresContext(), aOldFrame); aOldFrame = oldFrameNextInFlow; if (aOldFrame) { parent = NS_STATIC_CAST(nsInlineFrame*, aOldFrame->GetParent()); @@ -281,7 +275,7 @@ nsInlineFrame::RemoveFrame(nsPresContext* aPresContext, if (generateReflowCommand) { // Ask the parent frame to reflow me. - ReflowDirtyChild(&aPresShell, nsnull); + ReflowDirtyChild(GetPresContext()->PresShell(), nsnull); } } @@ -289,11 +283,9 @@ nsInlineFrame::RemoveFrame(nsPresContext* aPresContext, } NS_IMETHODIMP -nsInlineFrame::ReplaceFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aOldFrame, - nsIFrame* aNewFrame) +nsInlineFrame::ReplaceFrame(nsIAtom* aListName, + nsIFrame* aOldFrame, + nsIFrame* aNewFrame) { if (aListName) { NS_ERROR("Don't have any special lists on inline frames!"); @@ -305,10 +297,10 @@ nsInlineFrame::ReplaceFrame(nsPresContext* aPresContext, } PRBool retval = - mFrames.ReplaceFrame(aPresContext, this, aOldFrame, aNewFrame, PR_TRUE); + mFrames.ReplaceFrame(this, aOldFrame, aNewFrame, PR_TRUE); // Ask the parent frame to reflow me. - ReflowDirtyChild(&aPresShell, nsnull); + ReflowDirtyChild(GetPresContext()->PresShell(), nsnull); return retval ? NS_OK : NS_ERROR_FAILURE; } @@ -1124,74 +1116,62 @@ nsPositionedInlineFrame::SetInitialChildList(nsPresContext* aPresContext, } NS_IMETHODIMP -nsPositionedInlineFrame::AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsPositionedInlineFrame::AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList) { nsresult rv; if (mAbsoluteContainer.GetChildListName() == aListName) { - rv = mAbsoluteContainer.AppendFrames(this, aPresContext, aPresShell, aListName, - aFrameList); + rv = mAbsoluteContainer.AppendFrames(this, aListName, aFrameList); } else { - rv = nsInlineFrame::AppendFrames(aPresContext, aPresShell, aListName, - aFrameList); + rv = nsInlineFrame::AppendFrames(aListName, aFrameList); } return rv; } NS_IMETHODIMP -nsPositionedInlineFrame::InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsPositionedInlineFrame::InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList) { nsresult rv; if (mAbsoluteContainer.GetChildListName() == aListName) { - rv = mAbsoluteContainer.InsertFrames(this, aPresContext, aPresShell, aListName, - aPrevFrame, aFrameList); + rv = mAbsoluteContainer.InsertFrames(this, aListName, aPrevFrame, + aFrameList); } else { - rv = nsInlineFrame::InsertFrames(aPresContext, aPresShell, aListName, aPrevFrame, - aFrameList); + rv = nsInlineFrame::InsertFrames(aListName, aPrevFrame, aFrameList); } return rv; } NS_IMETHODIMP -nsPositionedInlineFrame::RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsPositionedInlineFrame::RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame) { nsresult rv; if (mAbsoluteContainer.GetChildListName() == aListName) { - rv = mAbsoluteContainer.RemoveFrame(this, aPresContext, aPresShell, aListName, aOldFrame); + rv = mAbsoluteContainer.RemoveFrame(this, aListName, aOldFrame); } else { - rv = nsInlineFrame::RemoveFrame(aPresContext, aPresShell, aListName, aOldFrame); + rv = nsInlineFrame::RemoveFrame(aListName, aOldFrame); } return rv; } NS_IMETHODIMP -nsPositionedInlineFrame::ReplaceFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsPositionedInlineFrame::ReplaceFrame(nsIAtom* aListName, nsIFrame* aOldFrame, nsIFrame* aNewFrame) { if (mAbsoluteContainer.GetChildListName() == aListName) { - return mAbsoluteContainer.ReplaceFrame(this, aPresContext, aPresShell, - aListName, aOldFrame, aNewFrame); + return mAbsoluteContainer.ReplaceFrame(this, aListName, aOldFrame, + aNewFrame); } else { - return nsInlineFrame::ReplaceFrame(aPresContext, aPresShell, aListName, - aOldFrame, aNewFrame); + return nsInlineFrame::ReplaceFrame(aListName, aOldFrame, aNewFrame); } } diff --git a/mozilla/layout/generic/nsInlineFrame.h b/mozilla/layout/generic/nsInlineFrame.h index 63acc6ed285..5797a8ba8f1 100644 --- a/mozilla/layout/generic/nsInlineFrame.h +++ b/mozilla/layout/generic/nsInlineFrame.h @@ -74,24 +74,16 @@ public: NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); // nsIFrame overrides - NS_IMETHOD AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aFrameList); - NS_IMETHOD InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aPrevFrame, - nsIFrame* aFrameList); - NS_IMETHOD RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aOldFrame); - NS_IMETHOD ReplaceFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aOldFrame, - nsIFrame* aNewFrame); + NS_IMETHOD AppendFrames(nsIAtom* aListName, + nsIFrame* aFrameList); + NS_IMETHOD InsertFrames(nsIAtom* aListName, + nsIFrame* aPrevFrame, + nsIFrame* aFrameList); + NS_IMETHOD RemoveFrame(nsIAtom* aListName, + nsIFrame* aOldFrame); + NS_IMETHOD ReplaceFrame(nsIAtom* aListName, + nsIFrame* aOldFrame, + nsIFrame* aNewFrame); NS_IMETHOD Paint(nsPresContext* aPresContext, nsIRenderingContext& aRenderingContext, const nsRect& aDirtyRect, @@ -215,24 +207,16 @@ public: NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext, nsIAtom* aListName, nsIFrame* aChildList); - NS_IMETHOD AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aFrameList); - NS_IMETHOD InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aPrevFrame, - nsIFrame* aFrameList); - NS_IMETHOD RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aOldFrame); - NS_IMETHOD ReplaceFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aOldFrame, - nsIFrame* aNewFrame); + NS_IMETHOD AppendFrames(nsIAtom* aListName, + nsIFrame* aFrameList); + NS_IMETHOD InsertFrames(nsIAtom* aListName, + nsIFrame* aPrevFrame, + nsIFrame* aFrameList); + NS_IMETHOD RemoveFrame(nsIAtom* aListName, + nsIFrame* aOldFrame); + NS_IMETHOD ReplaceFrame(nsIAtom* aListName, + nsIFrame* aOldFrame, + nsIFrame* aNewFrame); virtual nsIAtom* GetAdditionalChildListName(PRInt32 aIndex) const; diff --git a/mozilla/layout/generic/nsObjectFrame.cpp b/mozilla/layout/generic/nsObjectFrame.cpp index 5052970fdcb..fb83a1a12cf 100644 --- a/mozilla/layout/generic/nsObjectFrame.cpp +++ b/mozilla/layout/generic/nsObjectFrame.cpp @@ -1680,7 +1680,7 @@ nsObjectFrame::CreateDefaultFrames(nsPresContext *aPresContext, break; nsHTMLContainerFrame::CreateViewForFrame(imgFrame, divFrame, PR_FALSE); - divFrame->AppendFrames(aPresContext, *shell, nsnull, imgFrame); + divFrame->AppendFrames(nsnull, imgFrame); rv = NS_NewTextFrame(shell, &textFrame); if (NS_FAILED(rv)) @@ -1693,7 +1693,7 @@ nsObjectFrame::CreateDefaultFrames(nsPresContext *aPresContext, textFrame->SetInitialChildList(aPresContext, nsnull, nsnull); - divFrame->AppendFrames(aPresContext, *shell, nsnull, textFrame); + divFrame->AppendFrames(nsnull, textFrame); } while (0); if (NS_FAILED(rv)) { diff --git a/mozilla/layout/generic/nsViewportFrame.cpp b/mozilla/layout/generic/nsViewportFrame.cpp index cd8aa00978a..c57727e9fa4 100644 --- a/mozilla/layout/generic/nsViewportFrame.cpp +++ b/mozilla/layout/generic/nsViewportFrame.cpp @@ -99,16 +99,13 @@ ViewportFrame::GetFrameForPoint(const nsPoint& aPoint, } NS_IMETHODIMP -ViewportFrame::AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +ViewportFrame::AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList) { nsresult rv = NS_OK; if (mFixedContainer.GetChildListName() == aListName) { - rv = mFixedContainer.AppendFrames(this, aPresContext, aPresShell, - aListName, aFrameList); + rv = mFixedContainer.AppendFrames(this, aListName, aFrameList); } else { // We only expect incremental changes for our fixed frames @@ -120,17 +117,14 @@ ViewportFrame::AppendFrames(nsPresContext* aPresContext, } NS_IMETHODIMP -ViewportFrame::InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +ViewportFrame::InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList) { nsresult rv = NS_OK; if (mFixedContainer.GetChildListName() == aListName) { - rv = mFixedContainer.InsertFrames(this, aPresContext, aPresShell, aListName, - aPrevFrame, aFrameList); + rv = mFixedContainer.InsertFrames(this, aListName, aPrevFrame, aFrameList); } else { // We only expect incremental changes for our fixed frames @@ -142,15 +136,13 @@ ViewportFrame::InsertFrames(nsPresContext* aPresContext, } NS_IMETHODIMP -ViewportFrame::RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +ViewportFrame::RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame) { nsresult rv = NS_OK; if (mFixedContainer.GetChildListName() == aListName) { - rv = mFixedContainer.RemoveFrame(this, aPresContext, aPresShell, aListName, aOldFrame); + rv = mFixedContainer.RemoveFrame(this, aListName, aOldFrame); } else { // We only expect incremental changes for our fixed frames diff --git a/mozilla/layout/generic/nsViewportFrame.h b/mozilla/layout/generic/nsViewportFrame.h index c3e68db0aa7..cc40e797e8b 100644 --- a/mozilla/layout/generic/nsViewportFrame.h +++ b/mozilla/layout/generic/nsViewportFrame.h @@ -75,20 +75,14 @@ public: nsFramePaintLayer aWhichLayer, nsIFrame** aFrame); - NS_IMETHOD AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList); - NS_IMETHOD InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList); - NS_IMETHOD RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame); virtual nsIAtom* GetAdditionalChildListName(PRInt32 aIndex) const; diff --git a/mozilla/layout/svg/base/src/nsSVGDefsFrame.cpp b/mozilla/layout/svg/base/src/nsSVGDefsFrame.cpp index 08522d816ff..588cae81d5d 100644 --- a/mozilla/layout/svg/base/src/nsSVGDefsFrame.cpp +++ b/mozilla/layout/svg/base/src/nsSVGDefsFrame.cpp @@ -127,22 +127,17 @@ nsSVGDefsFrame::Init(nsPresContext* aPresContext, } NS_IMETHODIMP -nsSVGDefsFrame::AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aFrameList) +nsSVGDefsFrame::AppendFrames(nsIAtom* aListName, + nsIFrame* aFrameList) { // append == insert at end: - return InsertFrames(aPresContext, aPresShell, aListName, - mFrames.LastChild(), aFrameList); + return InsertFrames(aListName, mFrames.LastChild(), aFrameList); } NS_IMETHODIMP -nsSVGDefsFrame::InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aPrevFrame, - nsIFrame* aFrameList) +nsSVGDefsFrame::InsertFrames(nsIAtom* aListName, + nsIFrame* aPrevFrame, + nsIFrame* aFrameList) { // memorize last new frame nsIFrame* lastNewFrame = nsnull; @@ -172,10 +167,8 @@ nsSVGDefsFrame::InsertFrames(nsPresContext* aPresContext, } NS_IMETHODIMP -nsSVGDefsFrame::RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aOldFrame) +nsSVGDefsFrame::RemoveFrame(nsIAtom* aListName, + nsIFrame* aOldFrame) { nsCOMPtr dirty_region; @@ -185,7 +178,7 @@ nsSVGDefsFrame::RemoveFrame(nsPresContext* aPresContext, if (SVGFrame) dirty_region = SVGFrame->GetCoveredRegion(); - PRBool result = mFrames.DestroyFrame(aPresContext, aOldFrame); + PRBool result = mFrames.DestroyFrame(GetPresContext(), aOldFrame); nsISVGOuterSVGFrame* outerSVGFrame = GetOuterSVGFrame(); NS_ASSERTION(outerSVGFrame, "no outer svg frame"); @@ -197,11 +190,9 @@ nsSVGDefsFrame::RemoveFrame(nsPresContext* aPresContext, } NS_IMETHODIMP -nsSVGDefsFrame::ReplaceFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aOldFrame, - nsIFrame* aNewFrame) +nsSVGDefsFrame::ReplaceFrame(nsIAtom* aListName, + nsIFrame* aOldFrame, + nsIFrame* aNewFrame) { NS_NOTYETIMPLEMENTED("write me!"); return NS_ERROR_UNEXPECTED; diff --git a/mozilla/layout/svg/base/src/nsSVGDefsFrame.h b/mozilla/layout/svg/base/src/nsSVGDefsFrame.h index 234932c4f3a..1c819580682 100644 --- a/mozilla/layout/svg/base/src/nsSVGDefsFrame.h +++ b/mozilla/layout/svg/base/src/nsSVGDefsFrame.h @@ -68,22 +68,14 @@ private: public: // nsIFrame: - NS_IMETHOD AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList); - NS_IMETHOD InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList); - NS_IMETHOD RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame); - NS_IMETHOD ReplaceFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD ReplaceFrame(nsIAtom* aListName, nsIFrame* aOldFrame, nsIFrame* aNewFrame); NS_IMETHOD Init(nsPresContext* aPresContext, diff --git a/mozilla/layout/svg/base/src/nsSVGForeignObjectFrame.cpp b/mozilla/layout/svg/base/src/nsSVGForeignObjectFrame.cpp index 1408ce0cce3..0d322320f07 100644 --- a/mozilla/layout/svg/base/src/nsSVGForeignObjectFrame.cpp +++ b/mozilla/layout/svg/base/src/nsSVGForeignObjectFrame.cpp @@ -96,25 +96,17 @@ public: const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus); - NS_IMETHOD AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList); - NS_IMETHOD InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList); - NS_IMETHOD RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame); - NS_IMETHOD ReplaceFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD ReplaceFrame(nsIAtom* aListName, nsIFrame* aOldFrame, nsIFrame* aNewFrame); @@ -371,55 +363,45 @@ nsSVGForeignObjectFrame::Reflow(nsPresContext* aPresContext, } NS_IMETHODIMP -nsSVGForeignObjectFrame::AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsSVGForeignObjectFrame::AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList) { #ifdef DEBUG printf("**nsSVGForeignObjectFrame::AppendFrames()\n"); #endif nsresult rv; - rv = nsSVGForeignObjectFrameBase::AppendFrames(aPresContext, aPresShell, - aListName, aFrameList); + rv = nsSVGForeignObjectFrameBase::AppendFrames(aListName, aFrameList); Update(); return rv; } NS_IMETHODIMP -nsSVGForeignObjectFrame::InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aPrevFrame, - nsIFrame* aFrameList) +nsSVGForeignObjectFrame::InsertFrames(nsIAtom* aListName, + nsIFrame* aPrevFrame, + nsIFrame* aFrameList) { #ifdef DEBUG printf("**nsSVGForeignObjectFrame::InsertFrames()\n"); #endif nsresult rv; - rv = nsSVGForeignObjectFrameBase::InsertFrames(aPresContext, aPresShell, - aListName, aPrevFrame, aFrameList); + rv = nsSVGForeignObjectFrameBase::InsertFrames(aListName, aPrevFrame, + aFrameList); Update(); return rv; } NS_IMETHODIMP -nsSVGForeignObjectFrame::RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsSVGForeignObjectFrame::RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame) { nsresult rv; - rv = nsSVGForeignObjectFrameBase::RemoveFrame(aPresContext, aPresShell, - aListName, aOldFrame); + rv = nsSVGForeignObjectFrameBase::RemoveFrame(aListName, aOldFrame); Update(); return rv; } NS_IMETHODIMP -nsSVGForeignObjectFrame::ReplaceFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsSVGForeignObjectFrame::ReplaceFrame(nsIAtom* aListName, nsIFrame* aOldFrame, nsIFrame* aNewFrame) { @@ -427,8 +409,8 @@ nsSVGForeignObjectFrame::ReplaceFrame(nsPresContext* aPresContext, printf("**nsSVGForeignObjectFrame::ReplaceFrame()\n"); #endif nsresult rv; - rv = nsSVGForeignObjectFrameBase::ReplaceFrame(aPresContext, aPresShell, - aListName, aOldFrame, aNewFrame); + rv = nsSVGForeignObjectFrameBase::ReplaceFrame(aListName, aOldFrame, + aNewFrame); Update(); return rv; } diff --git a/mozilla/layout/svg/base/src/nsSVGGenericContainerFrame.cpp b/mozilla/layout/svg/base/src/nsSVGGenericContainerFrame.cpp index dc642a0d06f..43208480324 100644 --- a/mozilla/layout/svg/base/src/nsSVGGenericContainerFrame.cpp +++ b/mozilla/layout/svg/base/src/nsSVGGenericContainerFrame.cpp @@ -101,22 +101,17 @@ nsSVGGenericContainerFrame::Init(nsPresContext* aPresContext, NS_IMETHODIMP -nsSVGGenericContainerFrame::AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsSVGGenericContainerFrame::AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList) { // append == insert at end: - return InsertFrames(aPresContext, aPresShell, aListName, - mFrames.LastChild(), aFrameList); + return InsertFrames(aListName, mFrames.LastChild(), aFrameList); } NS_IMETHODIMP -nsSVGGenericContainerFrame::InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aPrevFrame, - nsIFrame* aFrameList) +nsSVGGenericContainerFrame::InsertFrames(nsIAtom* aListName, + nsIFrame* aPrevFrame, + nsIFrame* aFrameList) { nsIFrame* lastNewFrame = nsnull; { @@ -144,10 +139,8 @@ nsSVGGenericContainerFrame::InsertFrames(nsPresContext* aPresContext, } NS_IMETHODIMP -nsSVGGenericContainerFrame::RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aOldFrame) +nsSVGGenericContainerFrame::RemoveFrame(nsIAtom* aListName, + nsIFrame* aOldFrame) { nsCOMPtr dirty_region; @@ -157,7 +150,7 @@ nsSVGGenericContainerFrame::RemoveFrame(nsPresContext* aPresContext, if (SVGFrame) dirty_region = SVGFrame->GetCoveredRegion(); - PRBool result = mFrames.DestroyFrame(aPresContext, aOldFrame); + PRBool result = mFrames.DestroyFrame(GetPresContext(), aOldFrame); nsISVGOuterSVGFrame* outerSVGFrame = GetOuterSVGFrame(); NS_ASSERTION(outerSVGFrame, "no outer svg frame"); @@ -169,11 +162,9 @@ nsSVGGenericContainerFrame::RemoveFrame(nsPresContext* aPresContext, } NS_IMETHODIMP -nsSVGGenericContainerFrame::ReplaceFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aOldFrame, - nsIFrame* aNewFrame) +nsSVGGenericContainerFrame::ReplaceFrame(nsIAtom* aListName, + nsIFrame* aOldFrame, + nsIFrame* aNewFrame) { NS_NOTYETIMPLEMENTED("write me!"); return NS_ERROR_UNEXPECTED; diff --git a/mozilla/layout/svg/base/src/nsSVGGenericContainerFrame.h b/mozilla/layout/svg/base/src/nsSVGGenericContainerFrame.h index be4daa4af09..f6e352a52b8 100644 --- a/mozilla/layout/svg/base/src/nsSVGGenericContainerFrame.h +++ b/mozilla/layout/svg/base/src/nsSVGGenericContainerFrame.h @@ -68,22 +68,14 @@ private: public: // nsIFrame: - NS_IMETHOD AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList); - NS_IMETHOD InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList); - NS_IMETHOD RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame); - NS_IMETHOD ReplaceFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD ReplaceFrame(nsIAtom* aListName, nsIFrame* aOldFrame, nsIFrame* aNewFrame); NS_IMETHOD Init(nsPresContext* aPresContext, diff --git a/mozilla/layout/svg/base/src/nsSVGInnerSVGFrame.cpp b/mozilla/layout/svg/base/src/nsSVGInnerSVGFrame.cpp index 098f9e4cc96..eb0ebdc9c87 100644 --- a/mozilla/layout/svg/base/src/nsSVGInnerSVGFrame.cpp +++ b/mozilla/layout/svg/base/src/nsSVGInnerSVGFrame.cpp @@ -78,22 +78,14 @@ private: public: // nsIFrame: - NS_IMETHOD AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList); - NS_IMETHOD InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList); - NS_IMETHOD RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame); - NS_IMETHOD ReplaceFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD ReplaceFrame(nsIAtom* aListName, nsIFrame* aOldFrame, nsIFrame* aNewFrame); NS_IMETHOD Init(nsPresContext* aPresContext, @@ -251,20 +243,15 @@ nsSVGInnerSVGFrame::Init(nsPresContext* aPresContext, NS_IMETHODIMP -nsSVGInnerSVGFrame::AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsSVGInnerSVGFrame::AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList) { // append == insert at end: - return InsertFrames(aPresContext, aPresShell, aListName, - mFrames.LastChild(), aFrameList); + return InsertFrames(aListName, mFrames.LastChild(), aFrameList); } NS_IMETHODIMP -nsSVGInnerSVGFrame::InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsSVGInnerSVGFrame::InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList) { @@ -294,9 +281,7 @@ nsSVGInnerSVGFrame::InsertFrames(nsPresContext* aPresContext, } NS_IMETHODIMP -nsSVGInnerSVGFrame::RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsSVGInnerSVGFrame::RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame) { nsCOMPtr dirty_region; @@ -307,7 +292,7 @@ nsSVGInnerSVGFrame::RemoveFrame(nsPresContext* aPresContext, if (SVGFrame) dirty_region = SVGFrame->GetCoveredRegion(); - PRBool result = mFrames.DestroyFrame(aPresContext, aOldFrame); + PRBool result = mFrames.DestroyFrame(GetPresContext(), aOldFrame); nsISVGOuterSVGFrame* outerSVGFrame = GetOuterSVGFrame(); NS_ASSERTION(outerSVGFrame, "no outer svg frame"); @@ -319,9 +304,7 @@ nsSVGInnerSVGFrame::RemoveFrame(nsPresContext* aPresContext, } NS_IMETHODIMP -nsSVGInnerSVGFrame::ReplaceFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsSVGInnerSVGFrame::ReplaceFrame(nsIAtom* aListName, nsIFrame* aOldFrame, nsIFrame* aNewFrame) { diff --git a/mozilla/layout/svg/base/src/nsSVGOuterSVGFrame.cpp b/mozilla/layout/svg/base/src/nsSVGOuterSVGFrame.cpp index 38267e40354..1e399b59d6c 100644 --- a/mozilla/layout/svg/base/src/nsSVGOuterSVGFrame.cpp +++ b/mozilla/layout/svg/base/src/nsSVGOuterSVGFrame.cpp @@ -186,22 +186,14 @@ public: nsDidReflowStatus aStatus); - NS_IMETHOD AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList); - NS_IMETHOD InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList); - NS_IMETHOD RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame); - NS_IMETHOD ReplaceFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD ReplaceFrame(nsIAtom* aListName, nsIFrame* aOldFrame, nsIFrame* aNewFrame); @@ -608,22 +600,17 @@ nsSVGOuterSVGFrame::DidReflow(nsPresContext* aPresContext, // container methods NS_IMETHODIMP -nsSVGOuterSVGFrame::AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aFrameList) +nsSVGOuterSVGFrame::AppendFrames(nsIAtom* aListName, + nsIFrame* aFrameList) { // append == insert at end: - return InsertFrames(aPresContext, aPresShell, aListName, - mFrames.LastChild(), aFrameList); + return InsertFrames(aListName, mFrames.LastChild(), aFrameList); } NS_IMETHODIMP -nsSVGOuterSVGFrame::InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aPrevFrame, - nsIFrame* aFrameList) +nsSVGOuterSVGFrame::InsertFrames(nsIAtom* aListName, + nsIFrame* aPrevFrame, + nsIFrame* aFrameList) { // memorize last new frame nsIFrame* lastNewFrame = nsnull; @@ -658,10 +645,8 @@ nsSVGOuterSVGFrame::InsertFrames(nsPresContext* aPresContext, } NS_IMETHODIMP -nsSVGOuterSVGFrame::RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aOldFrame) +nsSVGOuterSVGFrame::RemoveFrame(nsIAtom* aListName, + nsIFrame* aOldFrame) { nsCOMPtr dirty_region; @@ -671,7 +656,7 @@ nsSVGOuterSVGFrame::RemoveFrame(nsPresContext* aPresContext, if (SVGFrame) dirty_region = SVGFrame->GetCoveredRegion(); - PRBool result = mFrames.DestroyFrame(aPresContext, aOldFrame); + PRBool result = mFrames.DestroyFrame(GetPresContext(), aOldFrame); nsISVGOuterSVGFrame* outerSVGFrame = GetOuterSVGFrame(); NS_ASSERTION(outerSVGFrame, "no outer svg frame"); @@ -683,11 +668,9 @@ nsSVGOuterSVGFrame::RemoveFrame(nsPresContext* aPresContext, } NS_IMETHODIMP -nsSVGOuterSVGFrame::ReplaceFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aOldFrame, - nsIFrame* aNewFrame) +nsSVGOuterSVGFrame::ReplaceFrame(nsIAtom* aListName, + nsIFrame* aOldFrame, + nsIFrame* aNewFrame) { NS_NOTYETIMPLEMENTED("write me!"); return NS_ERROR_UNEXPECTED; diff --git a/mozilla/layout/svg/base/src/nsSVGTSpanFrame.cpp b/mozilla/layout/svg/base/src/nsSVGTSpanFrame.cpp index a4fc8055a98..79356838c50 100644 --- a/mozilla/layout/svg/base/src/nsSVGTSpanFrame.cpp +++ b/mozilla/layout/svg/base/src/nsSVGTSpanFrame.cpp @@ -85,22 +85,14 @@ private: public: // nsIFrame: - NS_IMETHOD AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList); - NS_IMETHOD InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList); - NS_IMETHOD RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame); - NS_IMETHOD ReplaceFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD ReplaceFrame(nsIAtom* aListName, nsIFrame* aOldFrame, nsIFrame* aNewFrame); NS_IMETHOD Init(nsPresContext* aPresContext, @@ -263,20 +255,15 @@ nsSVGTSpanFrame::Init(nsPresContext* aPresContext, } NS_IMETHODIMP -nsSVGTSpanFrame::AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsSVGTSpanFrame::AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList) { // append == insert at end: - return InsertFrames(aPresContext, aPresShell, aListName, - mFrames.LastChild(), aFrameList); + return InsertFrames(aListName, mFrames.LastChild(), aFrameList); } NS_IMETHODIMP -nsSVGTSpanFrame::InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsSVGTSpanFrame::InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList) { @@ -309,9 +296,7 @@ nsSVGTSpanFrame::InsertFrames(nsPresContext* aPresContext, } NS_IMETHODIMP -nsSVGTSpanFrame::RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsSVGTSpanFrame::RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame) { nsCOMPtr dirty_region; @@ -322,7 +307,7 @@ nsSVGTSpanFrame::RemoveFrame(nsPresContext* aPresContext, if (SVGFrame) dirty_region = SVGFrame->GetCoveredRegion(); - PRBool result = mFrames.DestroyFrame(aPresContext, aOldFrame); + PRBool result = mFrames.DestroyFrame(GetPresContext(), aOldFrame); nsISVGOuterSVGFrame* outerSVGFrame = GetOuterSVGFrame(); NS_ASSERTION(outerSVGFrame, "no outer svg frame"); @@ -345,9 +330,7 @@ nsSVGTSpanFrame::RemoveFrame(nsPresContext* aPresContext, } NS_IMETHODIMP -nsSVGTSpanFrame::ReplaceFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsSVGTSpanFrame::ReplaceFrame(nsIAtom* aListName, nsIFrame* aOldFrame, nsIFrame* aNewFrame) { diff --git a/mozilla/layout/svg/base/src/nsSVGTextFrame.cpp b/mozilla/layout/svg/base/src/nsSVGTextFrame.cpp index 7b0c35e6fe8..6a4ccd9872a 100644 --- a/mozilla/layout/svg/base/src/nsSVGTextFrame.cpp +++ b/mozilla/layout/svg/base/src/nsSVGTextFrame.cpp @@ -90,22 +90,14 @@ private: public: // nsIFrame: - NS_IMETHOD AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList); - NS_IMETHOD InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList); - NS_IMETHOD RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame); - NS_IMETHOD ReplaceFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD ReplaceFrame(nsIAtom* aListName, nsIFrame* aOldFrame, nsIFrame* aNewFrame); @@ -328,20 +320,15 @@ nsSVGTextFrame::DidSetStyleContext(nsPresContext* aPresContext) } NS_IMETHODIMP -nsSVGTextFrame::AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsSVGTextFrame::AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList) { // append == insert at end: - return InsertFrames(aPresContext, aPresShell, aListName, - mFrames.LastChild(), aFrameList); + return InsertFrames(aListName, mFrames.LastChild(), aFrameList); } NS_IMETHODIMP -nsSVGTextFrame::InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsSVGTextFrame::InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList) { @@ -374,9 +361,7 @@ nsSVGTextFrame::InsertFrames(nsPresContext* aPresContext, } NS_IMETHODIMP -nsSVGTextFrame::RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsSVGTextFrame::RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame) { nsCOMPtr dirty_region; @@ -387,7 +372,7 @@ nsSVGTextFrame::RemoveFrame(nsPresContext* aPresContext, if (SVGFrame) dirty_region = SVGFrame->GetCoveredRegion(); - PRBool result = mFrames.DestroyFrame(aPresContext, aOldFrame); + PRBool result = mFrames.DestroyFrame(GetPresContext(), aOldFrame); nsISVGOuterSVGFrame* outerSVGFrame = GetOuterSVGFrame(); NS_ASSERTION(outerSVGFrame, "no outer svg frame"); @@ -410,9 +395,7 @@ nsSVGTextFrame::RemoveFrame(nsPresContext* aPresContext, } NS_IMETHODIMP -nsSVGTextFrame::ReplaceFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsSVGTextFrame::ReplaceFrame(nsIAtom* aListName, nsIFrame* aOldFrame, nsIFrame* aNewFrame) { diff --git a/mozilla/layout/tables/nsTableCellFrame.cpp b/mozilla/layout/tables/nsTableCellFrame.cpp index ccef548af12..f0340d55f07 100644 --- a/mozilla/layout/tables/nsTableCellFrame.cpp +++ b/mozilla/layout/tables/nsTableCellFrame.cpp @@ -213,7 +213,7 @@ nsTableCellFrame::AttributeChanged(nsIContent* aChild, nsTableFrame* tableFrame = nsnull; nsresult rv = nsTableFrame::GetTableFrame(this, tableFrame); if ((NS_SUCCEEDED(rv)) && (tableFrame)) { - tableFrame->AttributeChangedFor(GetPresContext(), this, aChild, aAttribute); + tableFrame->AttributeChangedFor(this, aChild, aAttribute); } return NS_OK; } @@ -239,9 +239,7 @@ void nsTableCellFrame::SetPass1MaxElementWidth(nscoord aMaxWidth, } NS_IMETHODIMP -nsTableCellFrame::AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsTableCellFrame::AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList) { NS_PRECONDITION(PR_FALSE, "unsupported operation"); @@ -249,9 +247,7 @@ nsTableCellFrame::AppendFrames(nsPresContext* aPresContext, } NS_IMETHODIMP -nsTableCellFrame::InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsTableCellFrame::InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList) { @@ -260,9 +256,7 @@ nsTableCellFrame::InsertFrames(nsPresContext* aPresContext, } NS_IMETHODIMP -nsTableCellFrame::RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsTableCellFrame::RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame) { NS_PRECONDITION(PR_FALSE, "unsupported operation"); @@ -424,7 +418,7 @@ nsTableCellFrame::Paint(nsPresContext* aPresContext, // bottom and/or right portion of the cell is painted by translating // the rendering context. nsPoint offset; - GetCollapseOffset(aPresContext, offset); + GetCollapseOffset(offset); PRBool pushed = PR_FALSE; if ((0 != offset.x) || (0 != offset.y)) { aRenderingContext.PushState(); @@ -526,13 +520,13 @@ PRBool nsTableCellFrame::ParentDisablesSelection() const //override default beha // Align the cell's child frame within the cell -void nsTableCellFrame::VerticallyAlignChild(nsPresContext* aPresContext, - const nsHTMLReflowState& aReflowState, +void nsTableCellFrame::VerticallyAlignChild(const nsHTMLReflowState& aReflowState, nscoord aMaxAscent) { const nsStyleTextReset* textStyle = GetStyleTextReset(); /* XXX: remove tableFrame when border-collapse inherits */ - GET_PIXELS_TO_TWIPS(aPresContext, p2t); + nsPresContext* presContext = GetPresContext(); + GET_PIXELS_TO_TWIPS(presContext, p2t); nsMargin borderPadding = nsTableFrame::GetBorderPadding(aReflowState, p2t, this); nscoord topInset = borderPadding.top; @@ -585,7 +579,7 @@ void nsTableCellFrame::VerticallyAlignChild(nsPresContext* aPresContext // Align the middle of the child frame with the middle of the content area, kidYTop = (height - childHeight - bottomInset + topInset) / 2; kidYTop = nsTableFrame::RoundToPixel(kidYTop, - aPresContext->ScaledPixelsToTwips(), + presContext->ScaledPixelsToTwips(), eAlwaysRoundDown); } // if the content is larger than the cell height align from top @@ -604,7 +598,9 @@ void nsTableCellFrame::VerticallyAlignChild(nsPresContext* aPresContext nsContainerFrame::PositionChildViews(firstKid); } if (HasView()) { - nsContainerFrame::SyncFrameViewAfterReflow(aPresContext, this, GetView(), &desiredSize.mOverflowArea, 0); + nsContainerFrame::SyncFrameViewAfterReflow(presContext, this, + GetView(), + &desiredSize.mOverflowArea, 0); } } @@ -1184,33 +1180,30 @@ nsTableCellFrame::GetFrameName(nsAString& aResult) const } #endif -void nsTableCellFrame::SetCollapseOffsetX(nsPresContext* aPresContext, - nscoord aXOffset) +void nsTableCellFrame::SetCollapseOffsetX(nscoord aXOffset) { // Get the frame property (creating a point struct if necessary) - nsPoint* offset = (nsPoint*)nsTableFrame::GetProperty(aPresContext, this, nsLayoutAtoms::collapseOffsetProperty, aXOffset != 0); + nsPoint* offset = (nsPoint*)nsTableFrame::GetProperty(this, nsLayoutAtoms::collapseOffsetProperty, aXOffset != 0); if (offset) { offset->x = aXOffset; } } -void nsTableCellFrame::SetCollapseOffsetY(nsPresContext* aPresContext, - nscoord aYOffset) +void nsTableCellFrame::SetCollapseOffsetY(nscoord aYOffset) { // Get the property (creating a point struct if necessary) - nsPoint* offset = (nsPoint*)nsTableFrame::GetProperty(aPresContext, this, nsLayoutAtoms::collapseOffsetProperty, aYOffset != 0); + nsPoint* offset = (nsPoint*)nsTableFrame::GetProperty(this, nsLayoutAtoms::collapseOffsetProperty, aYOffset != 0); if (offset) { offset->y = aYOffset; } } -void nsTableCellFrame::GetCollapseOffset(nsPresContext* aPresContext, - nsPoint& aOffset) +void nsTableCellFrame::GetCollapseOffset(nsPoint& aOffset) { // See if the property is set - nsPoint* offset = (nsPoint*)nsTableFrame::GetProperty(aPresContext, this, nsLayoutAtoms::collapseOffsetProperty); + nsPoint* offset = (nsPoint*)nsTableFrame::GetProperty(this, nsLayoutAtoms::collapseOffsetProperty); if (offset) { aOffset = *offset; diff --git a/mozilla/layout/tables/nsTableCellFrame.h b/mozilla/layout/tables/nsTableCellFrame.h index c85a46d92a7..a200f3b69ec 100644 --- a/mozilla/layout/tables/nsTableCellFrame.h +++ b/mozilla/layout/tables/nsTableCellFrame.h @@ -100,18 +100,12 @@ public: // table cells contain an area frame which does most of the work, and // so these functions should never be called. They assert and return // NS_ERROR_NOT_IMPLEMENTED - NS_IMETHOD AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList); - NS_IMETHOD InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList); - NS_IMETHOD RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame); virtual nsIFrame* GetContentInsertionFrame() { @@ -161,8 +155,7 @@ public: NS_IMETHOD GetFrameName(nsAString& aResult) const; #endif - virtual void VerticallyAlignChild(nsPresContext* aPresContext, - const nsHTMLReflowState& aReflowState, + virtual void VerticallyAlignChild(const nsHTMLReflowState& aReflowState, nscoord aMaxAscent); PRBool HasVerticalAlignBaseline(); @@ -263,9 +256,9 @@ public: void SetLastBlockHeight(nscoord aValue); // The collapse offset is (0,0) except for cells originating in a row/col which is collapsed - void SetCollapseOffsetX(nsPresContext* aPresContext, nscoord aXOffset); - void SetCollapseOffsetY(nsPresContext* aPresContext, nscoord aYOffset); - void GetCollapseOffset(nsPresContext* aPresContext, nsPoint& aOffset); + void SetCollapseOffsetX(nscoord aXOffset); + void SetCollapseOffsetY(nscoord aYOffset); + void GetCollapseOffset(nsPoint& aOffset); nsTableCellFrame* GetNextCell() const; diff --git a/mozilla/layout/tables/nsTableColGroupFrame.cpp b/mozilla/layout/tables/nsTableColGroupFrame.cpp index d4c71ff6f85..3752d796549 100644 --- a/mozilla/layout/tables/nsTableColGroupFrame.cpp +++ b/mozilla/layout/tables/nsTableColGroupFrame.cpp @@ -97,8 +97,7 @@ void nsTableColGroupFrame::ResetColIndices(nsIFrame* aFirstColGroup, nsresult -nsTableColGroupFrame::AddColsToTable(nsPresContext& aPresContext, - PRInt32 aFirstColIndex, +nsTableColGroupFrame::AddColsToTable(PRInt32 aFirstColIndex, PRBool aResetSubsequentColIndices, nsIFrame* aFirstFrame, nsIFrame* aLastFrame) @@ -117,7 +116,7 @@ nsTableColGroupFrame::AddColsToTable(nsPresContext& aPresContext, ((nsTableColFrame*)kidFrame)->SetColIndex(colIndex); if (!foundLastFrame) { mColCount++; - tableFrame->InsertCol(aPresContext, (nsTableColFrame &)*kidFrame, colIndex); + tableFrame->InsertCol((nsTableColFrame &)*kidFrame, colIndex); } colIndex++; } @@ -184,7 +183,7 @@ nsTableColGroupFrame::SetInitialChildList(nsPresContext* aPresContext, if (!aChildList) { nsIFrame* firstChild; - tableFrame->CreateAnonymousColFrames(*aPresContext, this, GetSpan(), eColAnonymousColGroup, + tableFrame->CreateAnonymousColFrames(this, GetSpan(), eColAnonymousColGroup, PR_FALSE, nsnull, &firstChild); if (firstChild) { SetInitialChildList(aPresContext, aListName, firstChild); @@ -197,20 +196,16 @@ nsTableColGroupFrame::SetInitialChildList(nsPresContext* aPresContext, } NS_IMETHODIMP -nsTableColGroupFrame::AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsTableColGroupFrame::AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList) { mFrames.AppendFrames(this, aFrameList); - InsertColsReflow(*aPresContext, aPresShell, mColCount, aFrameList); + InsertColsReflow(mColCount, aFrameList); return NS_OK; } NS_IMETHODIMP -nsTableColGroupFrame::InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsTableColGroupFrame::InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrameIn, nsIFrame* aFrameList) { @@ -222,19 +217,17 @@ nsTableColGroupFrame::InsertFrames(nsPresContext* aPresContext, nsLayoutAtoms::tableColFrame); PRInt32 colIndex = (prevFrame) ? ((nsTableColFrame*)prevFrame)->GetColIndex() + 1 : 0; - InsertColsReflow(*aPresContext, aPresShell, colIndex, aFrameList, lastFrame); + InsertColsReflow(colIndex, aFrameList, lastFrame); return NS_OK; } void -nsTableColGroupFrame::InsertColsReflow(nsPresContext& aPresContext, - nsIPresShell& aPresShell, - PRInt32 aColIndex, +nsTableColGroupFrame::InsertColsReflow(PRInt32 aColIndex, nsIFrame* aFirstFrame, nsIFrame* aLastFrame) { - AddColsToTable(aPresContext, aColIndex, PR_TRUE, aFirstFrame, aLastFrame); + AddColsToTable(aColIndex, PR_TRUE, aFirstFrame, aLastFrame); nsTableFrame* tableFrame; nsTableFrame::GetTableFrame(this, tableFrame); @@ -244,12 +237,11 @@ nsTableColGroupFrame::InsertColsReflow(nsPresContext& aPresContext, tableFrame->SetNeedStrategyInit(PR_TRUE); // Generate a reflow command so we reflow the table - nsTableFrame::AppendDirtyReflowCommand(&aPresShell, tableFrame); + nsTableFrame::AppendDirtyReflowCommand(tableFrame); } void -nsTableColGroupFrame::RemoveChild(nsPresContext& aPresContext, - nsTableColFrame& aChild, +nsTableColGroupFrame::RemoveChild(nsTableColFrame& aChild, PRBool aResetSubsequentColIndices) { PRInt32 colIndex = 0; @@ -258,7 +250,7 @@ nsTableColGroupFrame::RemoveChild(nsPresContext& aPresContext, colIndex = aChild.GetColIndex(); nextChild = aChild.GetNextSibling(); } - if (mFrames.DestroyFrame(&aPresContext, (nsIFrame*)&aChild)) { + if (mFrames.DestroyFrame(GetPresContext(), (nsIFrame*)&aChild)) { mColCount--; if (aResetSubsequentColIndices) { if (nextChild) { // reset inside this and all following colgroups @@ -278,13 +270,11 @@ nsTableColGroupFrame::RemoveChild(nsPresContext& aPresContext, // XXX this could be optimized with much effort tableFrame->SetNeedStrategyInit(PR_TRUE); // Generate a reflow command so we reflow the table - nsTableFrame::AppendDirtyReflowCommand(aPresContext.PresShell(), tableFrame); + nsTableFrame::AppendDirtyReflowCommand(tableFrame); } NS_IMETHODIMP -nsTableColGroupFrame::RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsTableColGroupFrame::RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame) { if (!aOldFrame) return NS_OK; @@ -292,21 +282,21 @@ nsTableColGroupFrame::RemoveFrame(nsPresContext* aPresContext, if (nsLayoutAtoms::tableColFrame == aOldFrame->GetType()) { nsTableColFrame* colFrame = (nsTableColFrame*)aOldFrame; PRInt32 colIndex = colFrame->GetColIndex(); - RemoveChild(*aPresContext, *colFrame, PR_TRUE); + RemoveChild(*colFrame, PR_TRUE); nsTableFrame* tableFrame; nsTableFrame::GetTableFrame(this, tableFrame); if (!tableFrame) return NS_ERROR_NULL_POINTER; - tableFrame->RemoveCol(*aPresContext, this, colIndex, PR_TRUE, PR_TRUE); + tableFrame->RemoveCol(this, colIndex, PR_TRUE, PR_TRUE); // XXX This could probably be optimized with much effort tableFrame->SetNeedStrategyInit(PR_TRUE); // Generate a reflow command so we reflow the table - nsTableFrame::AppendDirtyReflowCommand(&aPresShell, tableFrame); + nsTableFrame::AppendDirtyReflowCommand(tableFrame); } else { - mFrames.DestroyFrame(aPresContext, aOldFrame); + mFrames.DestroyFrame(GetPresContext(), aOldFrame); } return NS_OK; @@ -375,7 +365,7 @@ NS_METHOD nsTableColGroupFrame::Reflow(nsPresContext* aPresContext, if (eReflowReason_Incremental == aReflowState.reason) { - rv = IncrementalReflow(aPresContext, aDesiredSize, aReflowState, aStatus); + rv = IncrementalReflow(aDesiredSize, aReflowState, aStatus); } for (kidFrame = mFrames.FirstChild(); kidFrame; @@ -404,8 +394,7 @@ NS_METHOD nsTableColGroupFrame::Reflow(nsPresContext* aPresContext, return rv; } -NS_METHOD nsTableColGroupFrame::IncrementalReflow(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, +NS_METHOD nsTableColGroupFrame::IncrementalReflow(nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus) { @@ -413,19 +402,18 @@ NS_METHOD nsTableColGroupFrame::IncrementalReflow(nsPresContext* aPresC // the col group is a target if its path has a reflow command nsHTMLReflowCommand* command = aReflowState.path->mReflowCommand; if (command) - IR_TargetIsMe(aPresContext, aDesiredSize, aReflowState, aStatus); + IR_TargetIsMe(aDesiredSize, aReflowState, aStatus); // see if the chidren are targets as well nsReflowPath::iterator iter = aReflowState.path->FirstChild(); nsReflowPath::iterator end = aReflowState.path->EndChildren(); for (; iter != end; ++iter) - IR_TargetIsChild(aPresContext, aDesiredSize, aReflowState, aStatus, *iter); + IR_TargetIsChild(aDesiredSize, aReflowState, aStatus, *iter); return NS_OK; } -NS_METHOD nsTableColGroupFrame::IR_TargetIsMe(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, +NS_METHOD nsTableColGroupFrame::IR_TargetIsMe(nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus) { @@ -438,7 +426,7 @@ NS_METHOD nsTableColGroupFrame::IR_TargetIsMe(nsPresContext* aPresConte switch (type) { case eReflowType_StyleChanged : - rv = IR_StyleChanged(aPresContext, aDesiredSize, aReflowState, aStatus); + rv = IR_StyleChanged(aDesiredSize, aReflowState, aStatus); break; case eReflowType_ContentChanged : @@ -455,8 +443,7 @@ NS_METHOD nsTableColGroupFrame::IR_TargetIsMe(nsPresContext* aPresConte return rv; } -NS_METHOD nsTableColGroupFrame::IR_StyleChanged(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, +NS_METHOD nsTableColGroupFrame::IR_StyleChanged(nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus) { @@ -471,8 +458,7 @@ NS_METHOD nsTableColGroupFrame::IR_StyleChanged(nsPresContext* aPresCon return rv; } -NS_METHOD nsTableColGroupFrame::IR_TargetIsChild(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, +NS_METHOD nsTableColGroupFrame::IR_TargetIsChild(nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus, nsIFrame * aNextFrame) @@ -481,11 +467,12 @@ NS_METHOD nsTableColGroupFrame::IR_TargetIsChild(nsPresContext* aPresCo // Pass along the reflow command nsHTMLReflowMetrics desiredSize(nsnull); - nsHTMLReflowState kidReflowState(aPresContext, aReflowState, aNextFrame, + nsPresContext* presContext = GetPresContext(); + nsHTMLReflowState kidReflowState(presContext, aReflowState, aNextFrame, nsSize(aReflowState.availableWidth, aReflowState.availableHeight)); - rv = ReflowChild(aNextFrame, aPresContext, desiredSize, kidReflowState, 0, 0, 0, aStatus); - aNextFrame->DidReflow(aPresContext, nsnull, NS_FRAME_REFLOW_FINISHED); + rv = ReflowChild(aNextFrame, presContext, desiredSize, kidReflowState, 0, 0, 0, aStatus); + aNextFrame->DidReflow(presContext, nsnull, NS_FRAME_REFLOW_FINISHED); if (NS_FAILED(rv)) return rv; diff --git a/mozilla/layout/tables/nsTableColGroupFrame.h b/mozilla/layout/tables/nsTableColGroupFrame.h index 6f28263cd8b..984719ded12 100644 --- a/mozilla/layout/tables/nsTableColGroupFrame.h +++ b/mozilla/layout/tables/nsTableColGroupFrame.h @@ -115,30 +115,22 @@ public: /** @see nsIFrame::AppendFrames, InsertFrames, RemoveFrame */ - NS_IMETHOD AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList); - NS_IMETHOD InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList); - NS_IMETHOD RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame); /** remove the column aChild from the column group, if requested renumber * the subsequent columns in this column group and all following column * groups. see also ResetColIndices for this - * @param aPresContext - the presentation context * @param aChild - the column frame that needs to be removed * @param aResetSubsequentColIndices - if true the columns that follow * after aChild will be reenumerated */ - void RemoveChild(nsPresContext& aPresContext, - nsTableColFrame& aChild, + void RemoveChild(nsTableColFrame& aChild, PRBool aResetSubsequentColIndices); /** @see nsIFrame::Paint @@ -179,7 +171,6 @@ public: /** Add column frames to the table storages: colframe cache and cellmap * this doesn't change the mFrames of the colgroup frame. - * @param aPresContext - the presentation context * @param aFirstColIndex - the index at which aFirstFrame should be inserted * into the colframe cache. * @param aResetSubsequentColIndices - the indices of the col frames @@ -193,8 +184,7 @@ public: * @result - if there is no table frame or the table frame is not * the first in flow it will return an error */ - nsresult AddColsToTable(nsPresContext& aPresContext, - PRInt32 aFirstColIndex, + nsresult AddColsToTable(PRInt32 aFirstColIndex, PRBool aResetSubsequentColIndices, nsIFrame* aFirstFrame, nsIFrame* aLastFrame = nsnull); @@ -263,33 +253,27 @@ public: protected: nsTableColGroupFrame(); - void InsertColsReflow(nsPresContext& aPresContext, - nsIPresShell& aPresShell, - PRInt32 aColIndex, + void InsertColsReflow(PRInt32 aColIndex, nsIFrame* aFirstFrame, nsIFrame* aLastFrame = nsnull); /** implement abstract method on nsHTMLContainerFrame */ virtual PRIntn GetSkipSides() const; - NS_IMETHOD IncrementalReflow(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, + NS_IMETHOD IncrementalReflow(nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus); - NS_IMETHOD IR_TargetIsMe(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, + NS_IMETHOD IR_TargetIsMe(nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus); - NS_IMETHOD IR_StyleChanged(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, + NS_IMETHOD IR_StyleChanged(nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus); - NS_IMETHOD IR_TargetIsChild(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, + NS_IMETHOD IR_TargetIsChild(nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus, nsIFrame * aNextFrame); diff --git a/mozilla/layout/tables/nsTableFrame.cpp b/mozilla/layout/tables/nsTableFrame.cpp index 9e5e4a607d3..992647bb3d2 100644 --- a/mozilla/layout/tables/nsTableFrame.cpp +++ b/mozilla/layout/tables/nsTableFrame.cpp @@ -339,11 +339,8 @@ nsTableFrame::RoundToPixel(nscoord aValue, // Helper function which marks aFrame as dirty and generates a reflow command nsresult -nsTableFrame::AppendDirtyReflowCommand(nsIPresShell* aPresShell, - nsIFrame* aFrame) +nsTableFrame::AppendDirtyReflowCommand(nsIFrame* aFrame) { - if (!aPresShell) return NS_ERROR_NULL_POINTER; - aFrame->AddStateBits(NS_FRAME_IS_DIRTY); // mark the table frame as dirty nsHTMLReflowCommand* reflowCmd; @@ -351,7 +348,7 @@ nsTableFrame::AppendDirtyReflowCommand(nsIPresShell* aPresShell, eReflowType_ReflowDirty); if (NS_SUCCEEDED(rv)) { // Add the reflow command - rv = aPresShell->AppendReflowCommand(reflowCmd); + rv = aFrame->GetPresContext()->PresShell()->AppendReflowCommand(reflowCmd); } return rv; @@ -448,12 +445,12 @@ nsTableFrame::SetInitialChildList(nsPresContext* aPresContext, if (!mPrevInFlow) { // process col groups first so that real cols get constructed before // anonymous ones due to cells in rows. - InsertColGroups(*aPresContext, 0, mColGroups.FirstChild()); - AppendRowGroups(*aPresContext, mFrames.FirstChild()); + InsertColGroups(0, mColGroups.FirstChild()); + AppendRowGroups(mFrames.FirstChild()); // calc collapsing borders if this is the default (row group, col group, child list) if (!aChildList && IsBorderCollapse()) { nsRect damageArea(0, 0, GetColCount(), GetRowCount()); - SetBCDamageArea(*aPresContext, damageArea); + SetBCDamageArea(damageArea); } } @@ -466,8 +463,7 @@ nsTableFrame::IsContainingBlock() const return PR_TRUE; } -void nsTableFrame::AttributeChangedFor(nsPresContext* aPresContext, - nsIFrame* aFrame, +void nsTableFrame::AttributeChangedFor(nsIFrame* aFrame, nsIContent* aContent, nsIAtom* aAttribute) { @@ -481,14 +477,14 @@ void nsTableFrame::AttributeChangedFor(nsPresContext* aPresContext, PRInt32 rowIndex, colIndex; cellFrame->GetRowIndex(rowIndex); cellFrame->GetColIndex(colIndex); - RemoveCell(*aPresContext, cellFrame, rowIndex); + RemoveCell(cellFrame, rowIndex); nsAutoVoidArray cells; cells.AppendElement(cellFrame); - InsertCells(*aPresContext, cells, rowIndex, colIndex - 1); + InsertCells(cells, rowIndex, colIndex - 1); // XXX This could probably be optimized with some effort SetNeedStrategyInit(PR_TRUE); - AppendDirtyReflowCommand(aPresContext->PresShell(), this); + AppendDirtyReflowCommand(this); } } } @@ -665,8 +661,7 @@ NS_IMETHODIMP nsTableFrame::AdjustRowIndices(nsIFrame* aRowGroup, } -void nsTableFrame::InsertColGroups(nsPresContext& aPresContext, - PRInt32 aStartColIndex, +void nsTableFrame::InsertColGroups(PRInt32 aStartColIndex, nsIFrame* aFirstFrame, nsIFrame* aLastFrame) { @@ -684,7 +679,7 @@ void nsTableFrame::InsertColGroups(nsPresContext& aPresContext, nsTableColGroupFrame* cgFrame = (nsTableColGroupFrame*)kidFrame; cgFrame->SetStartColumnIndex(colIndex); nsIFrame* firstCol = kidFrame->GetFirstChild(nsnull); - cgFrame->AddColsToTable(aPresContext, colIndex, PR_FALSE, firstCol); + cgFrame->AddColsToTable(colIndex, PR_FALSE, firstCol); PRInt32 numCols = cgFrame->GetColCount(); colIndex += numCols; } @@ -700,8 +695,7 @@ void nsTableFrame::InsertColGroups(nsPresContext& aPresContext, } } -void nsTableFrame::InsertCol(nsPresContext& aPresContext, - nsTableColFrame& aColFrame, +void nsTableFrame::InsertCol(nsTableColFrame& aColFrame, PRInt32 aColIndex) { mColFrames.InsertElementAt(&aColFrame, aColIndex); @@ -722,11 +716,11 @@ void nsTableFrame::InsertCol(nsPresContext& aPresContext, // remove the col from the eColGroupAnonymousCell col group nsTableColGroupFrame* lastColGroup = (nsTableColGroupFrame *)mColGroups.LastChild(); if (lastColGroup) { - lastColGroup->RemoveChild(aPresContext, *lastCol, PR_FALSE); + lastColGroup->RemoveChild(*lastCol, PR_FALSE); } // remove the col group if it is empty if (lastColGroup->GetColCount() <= 0) { - mColGroups.DestroyFrame(&aPresContext, (nsIFrame*)lastColGroup); + mColGroups.DestroyFrame(GetPresContext(), (nsIFrame*)lastColGroup); } removedFromCache = PR_TRUE; } @@ -740,12 +734,11 @@ void nsTableFrame::InsertCol(nsPresContext& aPresContext, // for now, just bail and recalc all of the collapsing borders if (IsBorderCollapse()) { nsRect damageArea(0, 0, PR_MAX(1, GetColCount()), PR_MAX(1, GetRowCount())); - SetBCDamageArea(aPresContext, damageArea); + SetBCDamageArea(damageArea); } } -void nsTableFrame::RemoveCol(nsPresContext& aPresContext, - nsTableColGroupFrame* aColGroupFrame, +void nsTableFrame::RemoveCol(nsTableColGroupFrame* aColGroupFrame, PRInt32 aColIndex, PRBool aRemoveFromCache, PRBool aRemoveFromCellMap) @@ -756,13 +749,13 @@ void nsTableFrame::RemoveCol(nsPresContext& aPresContext, if (aRemoveFromCellMap) { nsTableCellMap* cellMap = GetCellMap(); if (cellMap) { - CreateAnonymousColFrames(aPresContext, 1, eColAnonymousCell, PR_TRUE); + CreateAnonymousColFrames(1, eColAnonymousCell, PR_TRUE); } } // for now, just bail and recalc all of the collapsing borders if (IsBorderCollapse()) { nsRect damageArea(0, 0, GetColCount(), GetRowCount()); - SetBCDamageArea(aPresContext, damageArea); + SetBCDamageArea(damageArea); } } @@ -815,11 +808,11 @@ nscoord nsTableFrame::GetPreferredWidth() const // XXX this needs to be moved to nsCSSFrameConstructor nsTableColGroupFrame* -nsTableFrame::CreateAnonymousColGroupFrame(nsPresContext& aPresContext, - nsTableColGroupType aColGroupType) +nsTableFrame::CreateAnonymousColGroupFrame(nsTableColGroupType aColGroupType) { nsIContent* colGroupContent = GetContent(); - nsIPresShell *shell = aPresContext.PresShell(); + nsPresContext* presContext = GetPresContext(); + nsIPresShell *shell = presContext->PresShell(); nsRefPtr colGroupStyle; colGroupStyle = shell->StyleSet()->ResolvePseudoStyleFor(colGroupContent, @@ -830,14 +823,13 @@ nsTableFrame::CreateAnonymousColGroupFrame(nsPresContext& aPresContext, nsresult result = NS_NewTableColGroupFrame(shell, &newFrame); if (NS_SUCCEEDED(result) && newFrame) { ((nsTableColGroupFrame *)newFrame)->SetColType(aColGroupType); - newFrame->Init(&aPresContext, colGroupContent, this, colGroupStyle, nsnull); + newFrame->Init(presContext, colGroupContent, this, colGroupStyle, nsnull); } return (nsTableColGroupFrame *)newFrame; } void -nsTableFrame::CreateAnonymousColFrames(nsPresContext& aPresContext, - PRInt32 aNumColsToAdd, +nsTableFrame::CreateAnonymousColFrames(PRInt32 aNumColsToAdd, nsTableColType aColType, PRBool aDoAppend, nsIFrame* aPrevColIn) @@ -875,7 +867,7 @@ nsTableFrame::CreateAnonymousColFrames(nsPresContext& aPresContext, if (eColGroupContent != newColGroupType) { PRInt32 colIndex = (colGroupFrame) ? colGroupFrame->GetStartColumnIndex() + colGroupFrame->GetColCount() : 0; - colGroupFrame = CreateAnonymousColGroupFrame(aPresContext, newColGroupType); + colGroupFrame = CreateAnonymousColGroupFrame(newColGroupType); if (!colGroupFrame) { return; } @@ -886,15 +878,14 @@ nsTableFrame::CreateAnonymousColFrames(nsPresContext& aPresContext, nsIFrame* prevCol = (aDoAppend) ? colGroupFrame->GetChildList().LastChild() : aPrevColIn; nsIFrame* firstNewFrame; - CreateAnonymousColFrames(aPresContext, colGroupFrame, aNumColsToAdd, - aColType, PR_TRUE, prevCol, &firstNewFrame); + CreateAnonymousColFrames(colGroupFrame, aNumColsToAdd, aColType, + PR_TRUE, prevCol, &firstNewFrame); } // XXX this needs to be moved to nsCSSFrameConstructor // Right now it only creates the col frames at the end void -nsTableFrame::CreateAnonymousColFrames(nsPresContext& aPresContext, - nsTableColGroupFrame* aColGroupFrame, +nsTableFrame::CreateAnonymousColFrames(nsTableColGroupFrame* aColGroupFrame, PRInt32 aNumColsToAdd, nsTableColType aColType, PRBool aAddToColGroupAndTable, @@ -904,7 +895,8 @@ nsTableFrame::CreateAnonymousColFrames(nsPresContext& aPresContext, NS_PRECONDITION(aColGroupFrame, "null frame"); *aFirstNewFrame = nsnull; nsIFrame* lastColFrame = nsnull; - nsIPresShell *shell = aPresContext.PresShell(); + nsPresContext* presContext = GetPresContext(); + nsIPresShell *shell = presContext->PresShell(); // Get the last col frame nsIFrame* childFrame = aColGroupFrame->GetFirstChild(nsnull); @@ -944,9 +936,9 @@ nsTableFrame::CreateAnonymousColFrames(nsPresContext& aPresContext, nsIFrame* colFrame; NS_NewTableColFrame(shell, &colFrame); ((nsTableColFrame *) colFrame)->SetColType(aColType); - colFrame->Init(&aPresContext, iContent, aColGroupFrame, + colFrame->Init(presContext, iContent, aColGroupFrame, styleContext, nsnull); - colFrame->SetInitialChildList(&aPresContext, nsnull, nsnull); + colFrame->SetInitialChildList(presContext, nsnull, nsnull); // Add the col to the sibling chain if (lastColFrame) { @@ -973,14 +965,13 @@ nsTableFrame::CreateAnonymousColFrames(nsPresContext& aPresContext, startColIndex = colFrame->GetColIndex() + 1; } } - aColGroupFrame->AddColsToTable(aPresContext, startColIndex, PR_TRUE, + aColGroupFrame->AddColsToTable(startColIndex, PR_TRUE, *aFirstNewFrame, lastColFrame); } } void -nsTableFrame::AppendCell(nsPresContext& aPresContext, - nsTableCellFrame& aCellFrame, +nsTableFrame::AppendCell(nsTableCellFrame& aCellFrame, PRInt32 aRowIndex) { nsTableCellMap* cellMap = GetCellMap(); @@ -992,16 +983,15 @@ nsTableFrame::AppendCell(nsPresContext& aPresContext, PRInt32 numColsToAdd = numColsInMap - numColsInCache; if (numColsToAdd > 0) { // this sets the child list, updates the col cache and cell map - CreateAnonymousColFrames(aPresContext, numColsToAdd, eColAnonymousCell, PR_TRUE); + CreateAnonymousColFrames(numColsToAdd, eColAnonymousCell, PR_TRUE); } if (IsBorderCollapse()) { - SetBCDamageArea(aPresContext, damageArea); + SetBCDamageArea(damageArea); } } } -void nsTableFrame::InsertCells(nsPresContext& aPresContext, - nsVoidArray& aCellFrames, +void nsTableFrame::InsertCells(nsVoidArray& aCellFrames, PRInt32 aRowIndex, PRInt32 aColIndexBefore) { @@ -1014,18 +1004,17 @@ void nsTableFrame::InsertCells(nsPresContext& aPresContext, PRInt32 numColsToAdd = numColsInMap - numColsInCache; if (numColsToAdd > 0) { // this sets the child list, updates the col cache and cell map - CreateAnonymousColFrames(aPresContext, numColsToAdd, eColAnonymousCell, PR_TRUE); + CreateAnonymousColFrames(numColsToAdd, eColAnonymousCell, PR_TRUE); } if (IsBorderCollapse()) { - SetBCDamageArea(aPresContext, damageArea); + SetBCDamageArea(damageArea); } } } // this removes the frames from the col group and table, but not the cell map PRInt32 -nsTableFrame::DestroyAnonymousColFrames(nsPresContext& aPresContext, - PRInt32 aNumFrames) +nsTableFrame::DestroyAnonymousColFrames(PRInt32 aNumFrames) { // only remove cols that are of type eTypeAnonymous cell (they are at the end) PRInt32 endIndex = mColFrames.Count() - 1; @@ -1037,9 +1026,9 @@ nsTableFrame::DestroyAnonymousColFrames(nsPresContext& aPresContext, nsTableColGroupFrame* cgFrame = NS_STATIC_CAST(nsTableColGroupFrame*, colFrame->GetParent()); // remove the frame from the colgroup - cgFrame->RemoveChild(aPresContext, *colFrame, PR_FALSE); + cgFrame->RemoveChild(*colFrame, PR_FALSE); // remove the frame from the cache, but not the cell map - RemoveCol(aPresContext, nsnull, colX, PR_TRUE, PR_FALSE); + RemoveCol(nsnull, colX, PR_TRUE, PR_FALSE); numColsRemoved++; } else { @@ -1049,8 +1038,7 @@ nsTableFrame::DestroyAnonymousColFrames(nsPresContext& aPresContext, return (aNumFrames - numColsRemoved); } -void nsTableFrame::RemoveCell(nsPresContext& aPresContext, - nsTableCellFrame* aCellFrame, +void nsTableFrame::RemoveCell(nsTableCellFrame* aCellFrame, PRInt32 aRowIndex) { nsTableCellMap* cellMap = GetCellMap(); @@ -1060,7 +1048,7 @@ void nsTableFrame::RemoveCell(nsPresContext& aPresContext, PRInt32 numColsInMap = GetColCount(); // cell map's notion of num cols PRInt32 numColsInCache = mColFrames.Count(); if (numColsInCache > numColsInMap) { - PRInt32 numColsNotRemoved = DestroyAnonymousColFrames(aPresContext, numColsInCache - numColsInMap); + PRInt32 numColsNotRemoved = DestroyAnonymousColFrames(numColsInCache - numColsInMap); // if the cell map has fewer cols than the cache, correct it if (numColsNotRemoved > 0) { cellMap->AddColsAtEnd(numColsNotRemoved); @@ -1069,7 +1057,7 @@ void nsTableFrame::RemoveCell(nsPresContext& aPresContext, else NS_ASSERTION(numColsInCache == numColsInMap, "cell map has too many cols"); if (IsBorderCollapse()) { - SetBCDamageArea(aPresContext, damageArea); + SetBCDamageArea(damageArea); } } } @@ -1094,34 +1082,31 @@ nsTableFrame::GetStartRowIndex(nsTableRowGroupFrame& aRowGroupFrame) } // this cannot extend beyond a single row group -void nsTableFrame::AppendRows(nsPresContext& aPresContext, - nsTableRowGroupFrame& aRowGroupFrame, +void nsTableFrame::AppendRows(nsTableRowGroupFrame& aRowGroupFrame, PRInt32 aRowIndex, nsVoidArray& aRowFrames) { nsTableCellMap* cellMap = GetCellMap(); if (cellMap) { PRInt32 absRowIndex = GetStartRowIndex(aRowGroupFrame) + aRowIndex; - InsertRows(aPresContext, aRowGroupFrame, aRowFrames, absRowIndex, PR_TRUE); + InsertRows(aRowGroupFrame, aRowFrames, absRowIndex, PR_TRUE); } } PRInt32 -nsTableFrame::InsertRow(nsPresContext& aPresContext, - nsTableRowGroupFrame& aRowGroupFrame, +nsTableFrame::InsertRow(nsTableRowGroupFrame& aRowGroupFrame, nsIFrame& aRowFrame, PRInt32 aRowIndex, PRBool aConsiderSpans) { nsAutoVoidArray rows; rows.AppendElement(&aRowFrame); - return InsertRows(aPresContext, aRowGroupFrame, rows, aRowIndex, aConsiderSpans); + return InsertRows(aRowGroupFrame, rows, aRowIndex, aConsiderSpans); } // this cannot extend beyond a single row group PRInt32 -nsTableFrame::InsertRows(nsPresContext& aPresContext, - nsTableRowGroupFrame& aRowGroupFrame, +nsTableFrame::InsertRows(nsTableRowGroupFrame& aRowGroupFrame, nsVoidArray& aRowFrames, PRInt32 aRowIndex, PRBool aConsiderSpans) @@ -1143,8 +1128,7 @@ nsTableFrame::InsertRows(nsPresContext& aPresContext, numColsToAdd = numColsInMap - numColsInCache; if (numColsToAdd > 0) { // this sets the child list, updates the col cache and cell map - CreateAnonymousColFrames(aPresContext, numColsToAdd, eColAnonymousCell, - PR_TRUE); + CreateAnonymousColFrames(numColsToAdd, eColAnonymousCell, PR_TRUE); } if (aRowIndex < origNumRows) { AdjustRowIndices(aRowIndex, numNewRows); @@ -1156,7 +1140,7 @@ nsTableFrame::InsertRows(nsPresContext& aPresContext, rowFrame->SetRowIndex(aRowIndex + rowX); } if (IsBorderCollapse()) { - SetBCDamageArea(aPresContext, damageArea); + SetBCDamageArea(damageArea); } } #ifdef DEBUG_TABLE_CELLMAP @@ -1168,8 +1152,7 @@ nsTableFrame::InsertRows(nsPresContext& aPresContext, } // this cannot extend beyond a single row group -void nsTableFrame::RemoveRows(nsPresContext& aPresContext, - nsTableRowFrame& aFirstRowFrame, +void nsTableFrame::RemoveRows(nsTableRowFrame& aFirstRowFrame, PRInt32 aNumRowsToRemove, PRBool aConsiderSpans) { @@ -1202,7 +1185,7 @@ void nsTableFrame::RemoveRows(nsPresContext& aPresContext, PRInt32 numColsInMap = GetColCount(); // cell map's notion of num cols PRInt32 numColsInCache = mColFrames.Count(); if (numColsInCache > numColsInMap) { - PRInt32 numColsNotRemoved = DestroyAnonymousColFrames(aPresContext, numColsInCache - numColsInMap); + PRInt32 numColsNotRemoved = DestroyAnonymousColFrames(numColsInCache - numColsInMap); // if the cell map has fewer cols than the cache, correct it if (numColsNotRemoved > 0) { cellMap->AddColsAtEnd(numColsNotRemoved); @@ -1212,12 +1195,12 @@ void nsTableFrame::RemoveRows(nsPresContext& aPresContext, PRInt32 numAnonymousColsToAdd = numColsInMap - numColsInCache; if (numAnonymousColsToAdd > 0) { // this sets the child list, updates the col cache and cell map - CreateAnonymousColFrames(aPresContext, numAnonymousColsToAdd, + CreateAnonymousColFrames(numAnonymousColsToAdd, eColAnonymousCell, PR_TRUE); } } if (IsBorderCollapse()) { - SetBCDamageArea(aPresContext, damageArea); + SetBCDamageArea(damageArea); } } AdjustRowIndices(firstRowIndex, -aNumRowsToRemove); @@ -1227,14 +1210,13 @@ void nsTableFrame::RemoveRows(nsPresContext& aPresContext, #endif } -void nsTableFrame::AppendRowGroups(nsPresContext& aPresContext, - nsIFrame* aFirstRowGroupFrame) +void nsTableFrame::AppendRowGroups(nsIFrame* aFirstRowGroupFrame) { if (aFirstRowGroupFrame) { nsTableCellMap* cellMap = GetCellMap(); if (cellMap) { nsFrameList newList(aFirstRowGroupFrame); - InsertRowGroups(aPresContext, aFirstRowGroupFrame, newList.LastChild()); + InsertRowGroups(aFirstRowGroupFrame, newList.LastChild()); } } } @@ -1291,9 +1273,8 @@ nsTableFrame::CollectRows(nsIFrame* aFrame, } void -nsTableFrame::InsertRowGroups(nsPresContext& aPresContext, - nsIFrame* aFirstRowGroupFrame, - nsIFrame* aLastRowGroupFrame) +nsTableFrame::InsertRowGroups(nsIFrame* aFirstRowGroupFrame, + nsIFrame* aLastRowGroupFrame) { nsTableCellMap* cellMap = GetCellMap(); if (cellMap) { @@ -1326,7 +1307,7 @@ nsTableFrame::InsertRowGroups(nsPresContext& aPresContext, PRInt32 priorNumRows = priorRG->GetRowCount(); rowIndex = priorRG->GetStartRowIndex() + priorNumRows; } - InsertRows(aPresContext, *rgFrame, rows, rowIndex, PR_TRUE); + InsertRows(*rgFrame, rows, rowIndex, PR_TRUE); rows.Clear(); } } @@ -1401,8 +1382,7 @@ nsTableFrame::Paint(nsPresContext* aPresContext, if (IsBorderCollapse()) { GET_PIXELS_TO_TWIPS(aPresContext, p2t); BCPropertyData* propData = - (BCPropertyData*)nsTableFrame::GetProperty(aPresContext, - (nsIFrame*)this, + (BCPropertyData*)nsTableFrame::GetProperty((nsIFrame*)this, nsLayoutAtoms::tableBCProperty, PR_FALSE); if (propData) { @@ -1430,7 +1410,7 @@ nsTableFrame::Paint(nsPresContext* aPresContext, skipSides); } else { - PaintBCBorders(aPresContext, aRenderingContext, aDirtyRect); + PaintBCBorders(aRenderingContext, aDirtyRect); } } aFlags |= NS_PAINT_FLAG_TABLE_BG_PAINT; @@ -1649,8 +1629,7 @@ nsTableFrame::SetColumnDimensions(nscoord aHeight, // XXX this could be made more general to handle row modifications that change the // table height, but first we need to scrutinize every Invalidate static void -ProcessRowInserted(nsPresContext* aPresContext, - nsTableFrame& aTableFrame, +ProcessRowInserted(nsTableFrame& aTableFrame, PRBool aInvalidate, nscoord aNewHeight) { @@ -1898,7 +1877,7 @@ NS_METHOD nsTableFrame::Reflow(nsPresContext* aPresContext, // see if collapsing borders need to be calculated if (!mPrevInFlow && IsBorderCollapse() && NeedToCalcBCBorders()) { GET_TWIPS_TO_PIXELS(aPresContext, p2t); - CalcBCBorders(*aPresContext); + CalcBCBorders(); } aDesiredSize.width = aReflowState.availableWidth; @@ -1928,7 +1907,7 @@ NS_METHOD nsTableFrame::Reflow(nsPresContext* aPresContext, // reflow the children nsIFrame *lastReflowed; nsRect overflowArea; - ReflowChildren(aPresContext, reflowState, !HaveReflowedColGroups(), + ReflowChildren(reflowState, !HaveReflowedColGroups(), PR_FALSE, aStatus, lastReflowed, overflowArea); } @@ -1948,7 +1927,7 @@ NS_METHOD nsTableFrame::Reflow(nsPresContext* aPresContext, } case eReflowReason_Incremental: NS_ASSERTION(HadInitialReflow(), "intial reflow not called"); - rv = IncrementalReflow(aPresContext, aReflowState, aStatus); + rv = IncrementalReflow(aReflowState, aStatus); nextReason = eReflowReason_Resize; break; case eReflowReason_Resize: @@ -1997,7 +1976,7 @@ NS_METHOD nsTableFrame::Reflow(nsPresContext* aPresContext, nscoord availHeight = (willInitiateSpecialReflow) ? NS_UNCONSTRAINEDSIZE : aReflowState.availableHeight; - ReflowTable(aPresContext, aDesiredSize, aReflowState, availHeight, nextReason, + ReflowTable(aDesiredSize, aReflowState, availHeight, nextReason, lastChildReflowed, balanced, aStatus); reflowedChildren = PR_TRUE; } @@ -2010,7 +1989,7 @@ NS_METHOD nsTableFrame::Reflow(nsPresContext* aPresContext, ((nsHTMLReflowState&)aReflowState).mPercentHeightReflowInitiator = this; ((nsHTMLReflowState::ReflowStateFlags&)aReflowState.mFlags).mSpecialHeightReflow = PR_TRUE; - ReflowTable(aPresContext, aDesiredSize, aReflowState, aReflowState.availableHeight, + ReflowTable(aDesiredSize, aReflowState, aReflowState.availableHeight, nextReason, lastChildReflowed, balanced, aStatus); // restore the previous special height reflow initiator ((nsHTMLReflowState&)aReflowState).mPercentHeightReflowInitiator = specialReflowInitiator; @@ -2043,16 +2022,16 @@ NS_METHOD nsTableFrame::Reflow(nsPresContext* aPresContext, CalcDesiredHeight(aReflowState, aDesiredSize); } if (IsRowInserted()) { - ProcessRowInserted(aPresContext, *this, PR_TRUE, aDesiredSize.height); + ProcessRowInserted(*this, PR_TRUE, aDesiredSize.height); } nsMargin borderPadding = GetChildAreaOffset(&aReflowState); SetColumnDimensions(aDesiredSize.height, borderPadding); if (NeedToCollapseRows()) { - AdjustForCollapsingRows(aPresContext, aDesiredSize); + AdjustForCollapsingRows(aDesiredSize); } if (NeedToCollapseColumns()) { - AdjustForCollapsingCols(aPresContext, aDesiredSize); + AdjustForCollapsingCols(aDesiredSize); } // See if we need to calc max elem and/or preferred widths. This isn't done on @@ -2087,7 +2066,7 @@ NS_METHOD nsTableFrame::Reflow(nsPresContext* aPresContext, if (!aReflowState.mStyleDisplay->IsTableClip()) { // collapsed border may leak out - nsMargin bcMargin = GetBCMargin(aPresContext); + nsMargin bcMargin = GetBCMargin(); tableRect.Inflate(bcMargin); } aDesiredSize.mOverflowArea.UnionRect(aDesiredSize.mOverflowArea, tableRect); @@ -2125,8 +2104,7 @@ NS_METHOD nsTableFrame::Reflow(nsPresContext* aPresContext, } nsresult -nsTableFrame::ReflowTable(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, +nsTableFrame::ReflowTable(nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, nscoord aAvailHeight, nsReflowReason aReason, @@ -2142,11 +2120,11 @@ nsTableFrame::ReflowTable(nsPresContext* aPresContext, if (!mPrevInFlow) { if (NeedStrategyInit()) { mTableLayoutStrategy->Initialize(aReflowState); - BalanceColumnWidths(aPresContext, aReflowState); + BalanceColumnWidths(aReflowState); aDidBalance = PR_TRUE; } if (NeedStrategyBalance()) { - BalanceColumnWidths(aPresContext, aReflowState); + BalanceColumnWidths(aReflowState); aDidBalance = PR_TRUE; } haveReflowedColGroups = HaveReflowedColGroups(); @@ -2154,9 +2132,9 @@ nsTableFrame::ReflowTable(nsPresContext* aPresContext, // Constrain our reflow width to the computed table width (of the 1st in flow). // and our reflow height to our avail height minus border, padding, cellspacing aDesiredSize.width = GetDesiredWidth(); - nsTableReflowState reflowState(*aPresContext, aReflowState, *this, aReason, + nsTableReflowState reflowState(*GetPresContext(), aReflowState, *this, aReason, aDesiredSize.width, aAvailHeight); - ReflowChildren(aPresContext, reflowState, haveReflowedColGroups, PR_FALSE, + ReflowChildren(reflowState, haveReflowedColGroups, PR_FALSE, aStatus, aLastChildReflowed, aDesiredSize.mOverflowArea); if (eReflowReason_Resize == aReflowState.reason) { @@ -2208,8 +2186,7 @@ nsTableFrame::GetFirstBodyRowGroupFrame() // Table specific version that takes into account repeated header and footer // frames when continuing table frames void -nsTableFrame::PushChildren(nsPresContext* aPresContext, - nsIFrame* aFromChild, +nsTableFrame::PushChildren(nsIFrame* aFromChild, nsIFrame* aPrevSibling) { NS_PRECONDITION(nsnull != aFromChild, "null pointer"); @@ -2231,13 +2208,13 @@ nsTableFrame::PushChildren(nsPresContext* aPresContext, // When pushing and pulling frames we need to check for whether any // views need to be reparented. for (nsIFrame* f = aFromChild; f; f = f->GetNextSibling()) { - nsHTMLContainerFrame::ReparentFrameView(aPresContext, f, this, nextInFlow); + nsHTMLContainerFrame::ReparentFrameView(GetPresContext(), f, this, nextInFlow); } nextInFlow->mFrames.InsertFrames(mNextInFlow, prevSibling, aFromChild); } else { // Add the frames to our overflow list - SetOverflowFrames(aPresContext, aFromChild); + SetOverflowFrames(GetPresContext(), aFromChild); } } @@ -2278,8 +2255,7 @@ nsTableFrame::MoveOverflowToChildList(nsPresContext* aPresContext) } NS_METHOD -nsTableFrame::CollapseRowGroupIfNecessary(nsPresContext* aPresContext, - nsIFrame* aRowGroupFrame, +nsTableFrame::CollapseRowGroupIfNecessary(nsIFrame* aRowGroupFrame, const nscoord& aYTotalOffset, nscoord& aYGroupOffset, PRInt32& aRowX) { @@ -2311,7 +2287,7 @@ nsTableFrame::CollapseRowGroupIfNecessary(nsPresContext* aPresContext, nsTableCellFrame* cFrame = (nsTableCellFrame*)cellFrame; nsRect cRect = cFrame->GetRect(); cRect.height -= rowRect.height; - cFrame->SetCollapseOffsetY(aPresContext, -aYGroupOffset); + cFrame->SetCollapseOffsetY(-aYGroupOffset); cFrame->SetRect(cRect); } cellFrame = cellFrame->GetNextSibling(); @@ -2347,7 +2323,7 @@ nsTableFrame::CollapseRowGroupIfNecessary(nsPresContext* aPresContext, if (NS_STYLE_DISPLAY_TABLE_CELL == cellDisplay->mDisplay) { nsTableCellFrame* cFrame = (nsTableCellFrame*)cellFrame; // reset the offset as this row is not collapsed - cFrame->SetCollapseOffsetY(aPresContext, 0); + cFrame->SetCollapseOffsetY(0); } cellFrame = cellFrame->GetNextSibling(); } @@ -2367,8 +2343,7 @@ nsTableFrame::CollapseRowGroupIfNecessary(nsPresContext* aPresContext, // collapsing row groups, rows, col groups and cols are accounted for after both passes of // reflow so that it has no effect on the calculations of reflow. -NS_METHOD nsTableFrame::AdjustForCollapsingRows(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize) +NS_METHOD nsTableFrame::AdjustForCollapsingRows(nsHTMLReflowMetrics& aDesiredSize) { nscoord yGroupOffset = 0; // total offset among rows within a single row group nscoord yTotalOffset = 0; // total offset among all rows in all row groups @@ -2387,7 +2362,7 @@ NS_METHOD nsTableFrame::AdjustForCollapsingRows(nsPresContext* aPresContex nsIFrame* childFrame = (nsIFrame*)rowGroups.ElementAt(childX); nsTableRowGroupFrame* rgFrame = GetRowGroupFrame(childFrame); if (!rgFrame) continue; // skip foreign frame types - CollapseRowGroupIfNecessary(aPresContext, rgFrame, yTotalOffset, yGroupOffset, rowIndex); + CollapseRowGroupIfNecessary(rgFrame, yTotalOffset, yGroupOffset, rowIndex); yTotalOffset += yGroupOffset; yGroupOffset = 0; } @@ -2397,8 +2372,7 @@ NS_METHOD nsTableFrame::AdjustForCollapsingRows(nsPresContext* aPresContex return NS_OK; } -NS_METHOD nsTableFrame::AdjustForCollapsingCols(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize) +NS_METHOD nsTableFrame::AdjustForCollapsingCols(nsHTMLReflowMetrics& aDesiredSize) { nsTableCellMap* cellMap = GetCellMap(); if (!cellMap) return NS_OK; @@ -2443,13 +2417,13 @@ NS_METHOD nsTableFrame::AdjustForCollapsingCols(nsPresContext* aPresContex if (cellData->IsOrig()) { // the cell originates at (rowX, colX) cellFrame = cellData->GetCellFrame(); // reset the collapse offsets since they may have been collapsed previously - cellFrame->SetCollapseOffsetX(aPresContext, 0); - cellFrame->SetCollapseOffsetY(aPresContext, 0); + cellFrame->SetCollapseOffsetX(0); + cellFrame->SetCollapseOffsetY(0); nsRect cellRect = cellFrame->GetRect(); if (collapseGroup || collapseCol) { if (lastCell != cellFrame) { // do it only once if there is a row span cellRect.width -= colWidth; - cellFrame->SetCollapseOffsetX(aPresContext, -xOffset); + cellFrame->SetCollapseOffsetX(-xOffset); } } else { // the cell is not in a collapsed col but needs to move cellRect.x -= xOffset; @@ -2482,9 +2456,7 @@ NS_METHOD nsTableFrame::AdjustForCollapsingCols(nsPresContext* aPresContex } NS_IMETHODIMP -nsTableFrame::AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsTableFrame::AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList) { // Because we actually have two child lists, one for col group frames and one @@ -2512,13 +2484,13 @@ nsTableFrame::AppendFrames(nsPresContext* aPresContext, mColGroups.InsertFrame(nsnull, lastColGroup, f); } // Insert the colgroup and its cols into the table - InsertColGroups(*aPresContext, startColIndex, f, f); + InsertColGroups(startColIndex, f, f); } else if (IsRowGroup(display->mDisplay)) { // Append the new row group frame to the sibling chain mFrames.AppendFrame(nsnull, f); // insert the row group and its rows into the table - InsertRowGroups(*aPresContext, f, f); + InsertRowGroups(f, f); } else { // Nothing special to do, just add the frame to our child list mFrames.AppendFrame(nsnull, f); @@ -2533,15 +2505,13 @@ nsTableFrame::AppendFrames(nsPresContext* aPresContext, Dump(PR_TRUE, PR_TRUE, PR_TRUE); #endif SetNeedStrategyInit(PR_TRUE); // XXX assume the worse - AppendDirtyReflowCommand(&aPresShell, this); + AppendDirtyReflowCommand(this); return NS_OK; } NS_IMETHODIMP -nsTableFrame::InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsTableFrame::InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList) { @@ -2570,7 +2540,7 @@ nsTableFrame::InsertFrames(nsPresContext* aPresContext, startColIndex = prevColGroup->GetStartColumnIndex() + prevColGroup->GetColCount(); } } - InsertColGroups(*aPresContext, startColIndex, aFrameList, lastFrame); + InsertColGroups(startColIndex, aFrameList, lastFrame); SetNeedStrategyInit(PR_TRUE); } else if (IsRowGroup(display->mDisplay)) { nsFrameList newList(aFrameList); @@ -2578,7 +2548,7 @@ nsTableFrame::InsertFrames(nsPresContext* aPresContext, // Insert the frames in the sibling chain mFrames.InsertFrame(nsnull, aPrevFrame, aFrameList); - InsertRowGroups(*aPresContext, aFrameList, lastSibling); + InsertRowGroups(aFrameList, lastSibling); SetNeedStrategyInit(PR_TRUE); } else { // Just insert the frame and don't worry about reflowing it @@ -2586,15 +2556,13 @@ nsTableFrame::InsertFrames(nsPresContext* aPresContext, return NS_OK; } - AppendDirtyReflowCommand(&aPresShell, this); + AppendDirtyReflowCommand(this); return NS_OK; } NS_IMETHODIMP -nsTableFrame::RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsTableFrame::RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame) { // See what kind of frame we have @@ -2605,27 +2573,27 @@ nsTableFrame::RemoveFrame(nsPresContext* aPresContext, nsTableColGroupFrame* colGroup = (nsTableColGroupFrame*)aOldFrame; PRInt32 firstColIndex = colGroup->GetStartColumnIndex(); PRInt32 lastColIndex = firstColIndex + colGroup->GetColCount() - 1; - mColGroups.DestroyFrame(aPresContext, aOldFrame); + mColGroups.DestroyFrame(GetPresContext(), aOldFrame); nsTableColGroupFrame::ResetColIndices(nextColGroupFrame, firstColIndex); // remove the cols from the table PRInt32 colX; for (colX = lastColIndex; colX >= firstColIndex; colX--) { nsTableColFrame* colFrame = (nsTableColFrame*)mColFrames.SafeElementAt(colX); if (colFrame) { - RemoveCol(*aPresContext, colGroup, colX, PR_TRUE, PR_FALSE); + RemoveCol(colGroup, colX, PR_TRUE, PR_FALSE); } } PRInt32 numAnonymousColsToAdd = GetColCount() - mColFrames.Count(); if (numAnonymousColsToAdd > 0) { // this sets the child list, updates the col cache and cell map - CreateAnonymousColFrames(*aPresContext, numAnonymousColsToAdd, + CreateAnonymousColFrames(numAnonymousColsToAdd, eColAnonymousCell, PR_TRUE); } // XXX This could probably be optimized with much effort SetNeedStrategyInit(PR_TRUE); - AppendDirtyReflowCommand(aPresContext->PresShell(), this); + AppendDirtyReflowCommand(this); } else { nsTableRowGroupFrame* rgFrame = GetRowGroupFrame(aOldFrame); if (rgFrame) { @@ -2640,7 +2608,7 @@ nsTableFrame::RemoveFrame(nsPresContext* aPresContext, PRInt32 numColsInMap = GetColCount(); // cell map's notion of num cols PRInt32 numColsInCache = mColFrames.Count(); if (numColsInCache > numColsInMap) { - PRInt32 numColsNotRemoved = DestroyAnonymousColFrames(*aPresContext, numColsInCache - numColsInMap); + PRInt32 numColsNotRemoved = DestroyAnonymousColFrames(numColsInCache - numColsInMap); // if the cell map has fewer cols than the cache, correct it if (numColsNotRemoved > 0 && cellMap) { cellMap->AddColsAtEnd(numColsNotRemoved); @@ -2650,14 +2618,14 @@ nsTableFrame::RemoveFrame(nsPresContext* aPresContext, AdjustRowIndices(startRowIndex, -numRows); // remove the row group frame from the sibling chain - mFrames.DestroyFrame(aPresContext, aOldFrame); + mFrames.DestroyFrame(GetPresContext(), aOldFrame); // XXX This could probably be optimized with much effort SetNeedStrategyInit(PR_TRUE); - AppendDirtyReflowCommand(aPresContext->PresShell(), this); + AppendDirtyReflowCommand(this); } else { // Just remove the frame - mFrames.DestroyFrame(aPresContext, aOldFrame); + mFrames.DestroyFrame(GetPresContext(), aOldFrame); return NS_OK; } } @@ -2665,8 +2633,7 @@ nsTableFrame::RemoveFrame(nsPresContext* aPresContext, } NS_METHOD -nsTableFrame::IncrementalReflow(nsPresContext* aPresContext, - const nsHTMLReflowState& aReflowState, +nsTableFrame::IncrementalReflow(const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus) { // Constrain our reflow width to the computed table width. Note: this is @@ -2676,26 +2643,25 @@ nsTableFrame::IncrementalReflow(nsPresContext* aPresContext, nsTableFrame* table = (nsTableFrame*)GetFirstInFlow(); lastWidth = table->mRect.width; } - nsTableReflowState state(*aPresContext, aReflowState, *this, eReflowReason_Incremental, + nsTableReflowState state(*GetPresContext(), aReflowState, *this, eReflowReason_Incremental, lastWidth, aReflowState.availableHeight); // the table is a target if its path has a reflow command nsHTMLReflowCommand* command = aReflowState.path->mReflowCommand; if (command) - IR_TargetIsMe(aPresContext, state, aStatus); + IR_TargetIsMe(state, aStatus); // see if the chidren are targets as well nsReflowPath::iterator iter = aReflowState.path->FirstChild(); nsReflowPath::iterator end = aReflowState.path->EndChildren(); for (; iter != end; ++iter) - IR_TargetIsChild(aPresContext, state, aStatus, *iter); + IR_TargetIsChild(state, aStatus, *iter); return NS_OK; } NS_METHOD -nsTableFrame::IR_TargetIsMe(nsPresContext* aPresContext, - nsTableReflowState& aReflowState, +nsTableFrame::IR_TargetIsMe(nsTableReflowState& aReflowState, nsReflowStatus& aStatus) { nsresult rv = NS_OK; @@ -2706,7 +2672,7 @@ nsTableFrame::IR_TargetIsMe(nsPresContext* aPresContext, switch (type) { case eReflowType_StyleChanged : - rv = IR_StyleChanged(aPresContext, aReflowState, aStatus); + rv = IR_StyleChanged(aReflowState, aStatus); break; case eReflowType_ContentChanged : NS_ASSERTION(PR_FALSE, "illegal reflow type: ContentChanged"); @@ -2714,12 +2680,12 @@ nsTableFrame::IR_TargetIsMe(nsPresContext* aPresContext, break; case eReflowType_ReflowDirty: { // reflow the dirty children - nsTableReflowState reflowState(*aPresContext, aReflowState.reflowState, *this, eReflowReason_Initial, + nsTableReflowState reflowState(*GetPresContext(), aReflowState.reflowState, *this, eReflowReason_Initial, aReflowState.availSize.width, aReflowState.availSize.height); nsIFrame* lastReflowed; PRBool reflowedAtLeastOne; nsRect overflowArea; - ReflowChildren(aPresContext, reflowState, PR_FALSE, PR_TRUE, aStatus, + ReflowChildren(reflowState, PR_FALSE, PR_TRUE, aStatus, lastReflowed, overflowArea, &reflowedAtLeastOne); if (!reflowedAtLeastOne) // XXX For now assume the worse @@ -2735,15 +2701,14 @@ nsTableFrame::IR_TargetIsMe(nsPresContext* aPresContext, return rv; } -NS_METHOD nsTableFrame::IR_StyleChanged(nsPresContext* aPresContext, - nsTableReflowState& aReflowState, +NS_METHOD nsTableFrame::IR_StyleChanged(nsTableReflowState& aReflowState, nsReflowStatus& aStatus) { - nsTableReflowState reflowState(*aPresContext, aReflowState.reflowState, *this, eReflowReason_StyleChange, + nsTableReflowState reflowState(*GetPresContext(), aReflowState.reflowState, *this, eReflowReason_StyleChange, aReflowState.availSize.width, aReflowState.availSize.height); nsIFrame* lastReflowed; nsRect overflowArea; - nsresult rv = ReflowChildren(aPresContext, reflowState, PR_FALSE, PR_FALSE, aStatus, lastReflowed, overflowArea); + nsresult rv = ReflowChildren(reflowState, PR_FALSE, PR_FALSE, aStatus, lastReflowed, overflowArea); SetNeedStrategyInit(PR_TRUE); return rv; } @@ -2762,9 +2727,9 @@ nsTableFrame::GetBCBorder() const { nsMargin border(0, 0, 0, 0); nsPresContext *presContext = GetPresContext(); - GET_PIXELS_TO_TWIPS(presContext, p2t); + GET_PIXELS_TO_TWIPS(GetPresContext(), p2t); BCPropertyData* propData = - (BCPropertyData*)nsTableFrame::GetProperty(presContext, (nsIFrame*)this, nsLayoutAtoms::tableBCProperty, PR_FALSE); + (BCPropertyData*)nsTableFrame::GetProperty((nsIFrame*)this, nsLayoutAtoms::tableBCProperty, PR_FALSE); if (propData) { if (eCompatibility_NavQuirks != presContext->CompatibilityMode()) { nscoord smallHalf, largeHalf; @@ -2792,16 +2757,17 @@ nsTableFrame::GetBCBorder() const } nsMargin -nsTableFrame::GetBCMargin(nsPresContext* aPresContext) const +nsTableFrame::GetBCMargin() const { nsMargin overflow(0, 0, 0, 0); - GET_PIXELS_TO_TWIPS(aPresContext, p2t); + nsPresContext* presContext = GetPresContext(); + GET_PIXELS_TO_TWIPS(presContext, p2t); BCPropertyData* propData = - (BCPropertyData*)nsTableFrame::GetProperty(aPresContext, (nsIFrame*)this, + (BCPropertyData*)nsTableFrame::GetProperty((nsIFrame*)this, nsLayoutAtoms::tableBCProperty, PR_FALSE); if (propData) { - if (eCompatibility_NavQuirks != aPresContext->CompatibilityMode()) { + if (eCompatibility_NavQuirks != presContext->CompatibilityMode()) { nscoord smallHalf, largeHalf; DivideBCBorderSize(propData->mTopBorderWidth, smallHalf, largeHalf); @@ -2836,13 +2802,13 @@ nsTableFrame::GetChildAreaOffset(const nsHTMLReflowState* aReflowState) const { nsMargin offset(0,0,0,0); if (IsBorderCollapse()) { - nsPresContext *presContext = GetPresContext(); + nsPresContext* presContext = GetPresContext(); if (eCompatibility_NavQuirks == presContext->CompatibilityMode()) { nsTableFrame* firstInFlow = (nsTableFrame*)GetFirstInFlow(); if (!firstInFlow) ABORT1(offset); nscoord smallHalf, largeHalf; GET_PIXELS_TO_TWIPS(presContext, p2t); BCPropertyData* propData = - (BCPropertyData*)nsTableFrame::GetProperty(presContext, (nsIFrame*)firstInFlow, nsLayoutAtoms::tableBCProperty, PR_FALSE); + (BCPropertyData*)nsTableFrame::GetProperty((nsIFrame*)firstInFlow, nsLayoutAtoms::tableBCProperty, PR_FALSE); if (!propData) ABORT1(offset); DivideBCBorderSize(propData->mTopBorderWidth, smallHalf, largeHalf); @@ -2939,30 +2905,28 @@ nsTableFrame::RecoverState(nsTableReflowState& aReflowState, } void -nsTableFrame::InitChildReflowState(nsPresContext& aPresContext, - nsHTMLReflowState& aReflowState) +nsTableFrame::InitChildReflowState(nsHTMLReflowState& aReflowState) { nsMargin collapseBorder; nsMargin padding(0,0,0,0); nsMargin* pCollapseBorder = nsnull; + nsPresContext* presContext = GetPresContext(); if (IsBorderCollapse()) { nsTableRowGroupFrame* rgFrame = GetRowGroupFrame(aReflowState.frame); if (rgFrame) { - GET_PIXELS_TO_TWIPS(&aPresContext, p2t); + GET_PIXELS_TO_TWIPS(presContext, p2t); pCollapseBorder = rgFrame->GetBCBorderWidth(p2t, collapseBorder); } } - aReflowState.Init(&aPresContext, -1, -1, pCollapseBorder, &padding); + aReflowState.Init(presContext, -1, -1, pCollapseBorder, &padding); } NS_METHOD -nsTableFrame::IR_TargetIsChild(nsPresContext* aPresContext, - nsTableReflowState& aReflowState, +nsTableFrame::IR_TargetIsChild(nsTableReflowState& aReflowState, nsReflowStatus& aStatus, nsIFrame* aNextFrame) { - if (!aPresContext) ABORT1(NS_ERROR_NULL_POINTER); nsresult rv; // Recover the state as if aNextFrame is about to be reflowed RecoverState(aReflowState, aNextFrame); @@ -2974,18 +2938,19 @@ nsTableFrame::IR_TargetIsChild(nsPresContext* aPresContext, nsHTMLReflowMetrics desiredSize(PR_FALSE); nsSize kidAvailSize(aReflowState.availSize); - nsHTMLReflowState kidReflowState(aPresContext, aReflowState.reflowState, aNextFrame, + nsPresContext* presContext = GetPresContext(); + nsHTMLReflowState kidReflowState(presContext, aReflowState.reflowState, aNextFrame, kidAvailSize, aReflowState.reason); - InitChildReflowState(*aPresContext, kidReflowState); + InitChildReflowState(kidReflowState); - rv = ReflowChild(aNextFrame, aPresContext, desiredSize, kidReflowState, + rv = ReflowChild(aNextFrame, presContext, desiredSize, kidReflowState, aReflowState.x, aReflowState.y, 0, aStatus); // Place the row group frame. Don't use PlaceChild(), because it moves // the footer frame as well. We'll adjust the footer frame later on in // AdjustSiblingsAfterReflow() nsRect kidRect(aReflowState.x, aReflowState.y, desiredSize.width, desiredSize.height); - FinishReflowChild(aNextFrame, aPresContext, nsnull, desiredSize, aReflowState.x, aReflowState.y, 0); + FinishReflowChild(aNextFrame, presContext, nsnull, desiredSize, aReflowState.x, aReflowState.y, 0); // Adjust the running y-offset aReflowState.y += desiredSize.height + GetCellSpacingY(); @@ -3027,14 +2992,13 @@ nsTableFrame::IR_TargetIsChild(nsPresContext* aPresContext, // Position and size aKidFrame and update our reflow state. The origin of // aKidRect is relative to the upper-left origin of our frame -void nsTableFrame::PlaceChild(nsPresContext* aPresContext, - nsTableReflowState& aReflowState, +void nsTableFrame::PlaceChild(nsTableReflowState& aReflowState, nsIFrame* aKidFrame, nsHTMLReflowMetrics& aKidDesiredSize) { // Place and size the child - FinishReflowChild(aKidFrame, aPresContext, nsnull, aKidDesiredSize, + FinishReflowChild(aKidFrame, GetPresContext(), nsnull, aKidDesiredSize, aReflowState.x, aReflowState.y, 0); // Adjust the running y-offset @@ -3155,8 +3119,7 @@ IsRepeatable(nsTableRowGroupFrame& aHeaderOrFooter, // Reflow the children based on the avail size and reason in aReflowState // update aReflowMetrics a aStatus NS_METHOD -nsTableFrame::ReflowChildren(nsPresContext* aPresContext, - nsTableReflowState& aReflowState, +nsTableFrame::ReflowChildren(nsTableReflowState& aReflowState, PRBool aDoColGroups, PRBool aDirtyOnly, nsReflowStatus& aStatus, @@ -3171,7 +3134,8 @@ nsTableFrame::ReflowChildren(nsPresContext* aPresContext, nsresult rv = NS_OK; nscoord cellSpacingY = GetCellSpacingY(); - PRBool isPaginated = aPresContext->IsPaginated(); + nsPresContext* presContext = GetPresContext(); + PRBool isPaginated = presContext->IsPaginated(); aOverflowArea = nsRect (0, 0, 0, 0); @@ -3192,7 +3156,7 @@ nsTableFrame::ReflowChildren(nsPresContext* aPresContext, if (doReflowChild) { if (pageBreak) { - PushChildren(aPresContext, kidFrame, prevKidFrame); + PushChildren(kidFrame, prevKidFrame); aStatus = NS_FRAME_NOT_COMPLETE; break; } @@ -3221,9 +3185,9 @@ nsTableFrame::ReflowChildren(nsPresContext* aPresContext, if (childX < numRowGroups) { // Reflow the child into the available space - nsHTMLReflowState kidReflowState(aPresContext, aReflowState.reflowState, kidFrame, + nsHTMLReflowState kidReflowState(presContext, aReflowState.reflowState, kidFrame, kidAvailSize, aReflowState.reason); - InitChildReflowState(*aPresContext, kidReflowState); + InitChildReflowState(kidReflowState); // XXX fix up bad mComputedWidth for scroll frame kidReflowState.mComputedWidth = PR_MAX(kidReflowState.mComputedWidth, 0); @@ -3239,7 +3203,7 @@ nsTableFrame::ReflowChildren(nsPresContext* aPresContext, // needs to be recomputed. nsIFrame* kidNextInFlow = kidFrame->GetNextInFlow(); - rv = ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowState, + rv = ReflowChild(kidFrame, presContext, desiredSize, kidReflowState, aReflowState.x, aReflowState.y, 0, aStatus); haveReflowedRowGroup = PR_TRUE; @@ -3253,9 +3217,9 @@ nsTableFrame::ReflowChildren(nsPresContext* aPresContext, if (childX+1 < numRowGroups) { nsIFrame* nextRowGroupFrame = (nsIFrame*) rowGroups.ElementAt(childX +1); if (nextRowGroupFrame) { - PlaceChild(aPresContext, aReflowState, kidFrame, desiredSize); + PlaceChild(aReflowState, kidFrame, desiredSize); aStatus = NS_FRAME_NOT_COMPLETE; - PushChildren(aPresContext, nextRowGroupFrame, kidFrame); + PushChildren(nextRowGroupFrame, kidFrame); aLastChildReflowed = kidFrame; break; } @@ -3264,7 +3228,7 @@ nsTableFrame::ReflowChildren(nsPresContext* aPresContext, else { // we are not on top, push this rowgroup onto the next page if (prevKidFrame) { // we had a rowgroup before so push this aStatus = NS_FRAME_NOT_COMPLETE; - PushChildren(aPresContext, kidFrame, prevKidFrame); + PushChildren(kidFrame, prevKidFrame); aLastChildReflowed = prevKidFrame; break; } @@ -3282,7 +3246,7 @@ nsTableFrame::ReflowChildren(nsPresContext* aPresContext, } // Place the child - PlaceChild(aPresContext, aReflowState, kidFrame, desiredSize); + PlaceChild(aReflowState, kidFrame, desiredSize); // Remember where we just were in case we end up pushing children prevKidFrame = kidFrame; @@ -3295,8 +3259,8 @@ nsTableFrame::ReflowChildren(nsPresContext* aPresContext, // frame. This hooks the child into the flow nsIFrame* continuingFrame; - aPresContext->PresShell()->FrameConstructor()-> - CreateContinuingFrame(aPresContext, kidFrame, this, + presContext->PresShell()->FrameConstructor()-> + CreateContinuingFrame(presContext, kidFrame, this, &continuingFrame); // Add the continuing frame to the sibling list @@ -3307,18 +3271,18 @@ nsTableFrame::ReflowChildren(nsPresContext* aPresContext, // children to the next-in-flow nsIFrame* nextSibling = kidFrame->GetNextSibling(); if (nsnull != nextSibling) { - PushChildren(aPresContext, nextSibling, kidFrame); + PushChildren(nextSibling, kidFrame); } if (repeatedFooter) { kidAvailSize.height = repeatedFooterHeight; - nsHTMLReflowState footerReflowState(aPresContext, aReflowState.reflowState, repeatedFooter, + nsHTMLReflowState footerReflowState(presContext, aReflowState.reflowState, repeatedFooter, kidAvailSize, aReflowState.reason); - InitChildReflowState(*aPresContext, footerReflowState); + InitChildReflowState(footerReflowState); aReflowState.y += cellSpacingY; nsReflowStatus footerStatus; - rv = ReflowChild(repeatedFooter, aPresContext, desiredSize, footerReflowState, + rv = ReflowChild(repeatedFooter, presContext, desiredSize, footerReflowState, aReflowState.x, aReflowState.y, 0, footerStatus); - PlaceChild(aPresContext, aReflowState, repeatedFooter, desiredSize); + PlaceChild(aReflowState, repeatedFooter, desiredSize); } break; } @@ -3344,11 +3308,11 @@ nsTableFrame::ReflowChildren(nsPresContext* aPresContext, nsHTMLReflowMetrics kidMet(PR_FALSE); for (nsIFrame* kidFrame = mColGroups.FirstChild(); kidFrame; kidFrame = kidFrame->GetNextSibling()) { - nsHTMLReflowState kidReflowState(aPresContext, aReflowState.reflowState, kidFrame, + nsHTMLReflowState kidReflowState(presContext, aReflowState.reflowState, kidFrame, aReflowState.availSize, aReflowState.reason); nsReflowStatus cgStatus; - ReflowChild(kidFrame, aPresContext, kidMet, kidReflowState, 0, 0, 0, cgStatus); - FinishReflowChild(kidFrame, aPresContext, nsnull, kidMet, 0, 0, 0); + ReflowChild(kidFrame, presContext, kidMet, kidReflowState, 0, 0, 0, cgStatus); + FinishReflowChild(kidFrame, presContext, nsnull, kidMet, 0, 0, 0); } SetHaveReflowedColGroups(PR_TRUE); } @@ -3358,7 +3322,7 @@ nsTableFrame::ReflowChildren(nsPresContext* aPresContext, if (isPaginated && !mPrevInFlow && (NS_UNCONSTRAINEDSIZE == aReflowState.availSize.height)) { nsRect actualRect; nsRect adjRect; - aPresContext->GetPageDim(&actualRect, &adjRect); + presContext->GetPageDim(&actualRect, &adjRect); // don't repeat the thead or tfoot unless it is < 25% of the page height if (thead) { thead->SetRepeatable(IsRepeatable(*thead, actualRect.height)); @@ -3381,8 +3345,7 @@ nsTableFrame::ReflowChildren(nsPresContext* aPresContext, to assign widths to each column. */ // use the cell map to determine which cell is in which column. -void nsTableFrame::BalanceColumnWidths(nsPresContext* aPresContext, - const nsHTMLReflowState& aReflowState) +void nsTableFrame::BalanceColumnWidths(const nsHTMLReflowState& aReflowState) { NS_ASSERTION(!mPrevInFlow, "never ever call me on a continuing frame!"); @@ -4633,8 +4596,7 @@ CheckFixDamageArea(PRInt32 aNumRows, *******************************************************************************/ void -nsTableFrame::SetBCDamageArea(nsPresContext& aPresContext, - const nsRect& aValue) +nsTableFrame::SetBCDamageArea(const nsRect& aValue) { nsRect newRect(aValue); newRect.width = PR_MAX(1, newRect.width); @@ -4646,7 +4608,7 @@ nsTableFrame::SetBCDamageArea(nsPresContext& aPresContext, } SetNeedToCalcBCBorders(PR_TRUE); // Get the property - BCPropertyData* value = (BCPropertyData*)nsTableFrame::GetProperty(&aPresContext, this, nsLayoutAtoms::tableBCProperty, PR_TRUE); + BCPropertyData* value = (BCPropertyData*)nsTableFrame::GetProperty(this, nsLayoutAtoms::tableBCProperty, PR_TRUE); if (value) { // for now just construct a union of the new and old damage areas value->mDamageArea.UnionRect(value->mDamageArea, newRect); @@ -5795,7 +5757,7 @@ LimitBorderWidth(PRUint16 aWidth) // Calc the dominant border at every cell edge and corner within the current damage area void -nsTableFrame::CalcBCBorders(nsPresContext& aPresContext) +nsTableFrame::CalcBCBorders() { nsTableCellMap* tableCellMap = GetCellMap(); if (!tableCellMap) ABORT0(); PRInt32 numRows = GetRowCount(); @@ -5803,7 +5765,7 @@ nsTableFrame::CalcBCBorders(nsPresContext& aPresContext) // Get the property holding the table damage area and border widths BCPropertyData* propData = - (BCPropertyData*)nsTableFrame::GetProperty(&aPresContext, this, nsLayoutAtoms::tableBCProperty, PR_FALSE); + (BCPropertyData*)nsTableFrame::GetProperty(this, nsLayoutAtoms::tableBCProperty, PR_FALSE); if (!propData) ABORT0(); PRBool tableIsLTR = GetStyleVisibility()->mDirection == NS_STYLE_DIRECTION_LTR; @@ -5826,7 +5788,7 @@ nsTableFrame::CalcBCBorders(nsPresContext& aPresContext) for (PRUint32 sideX = NS_SIDE_TOP; sideX <= NS_SIDE_LEFT; sideX++) { tableBorderReset[sideX] = PR_FALSE; } - GET_TWIPS_TO_PIXELS(&aPresContext, t2p); + GET_TWIPS_TO_PIXELS(GetPresContext(), t2p); // vertical borders indexed in x-direction (cols) BCCellBorders lastVerBorders(damageArea.width + 1, damageArea.x); if (!lastVerBorders.borders) ABORT0(); @@ -6855,13 +6817,12 @@ BCHorizontalSeg::Start(BCMapBorderIterator& aIter, } void -nsTableFrame::PaintBCBorders(nsPresContext* aPresContext, - nsIRenderingContext& aRenderingContext, +nsTableFrame::PaintBCBorders(nsIRenderingContext& aRenderingContext, const nsRect& aDirtyRect) { nsMargin childAreaOffset = GetChildAreaOffset(nsnull); nsTableFrame* firstInFlow = (nsTableFrame*)GetFirstInFlow(); if (!firstInFlow) ABORT0(); - GET_PIXELS_TO_TWIPS(aPresContext, p2t); + GET_PIXELS_TO_TWIPS(GetPresContext(), p2t); PRInt32 startRowY = (mPrevInFlow) ? 0 : childAreaOffset.top; // y position of first row in damage area @@ -7644,12 +7605,11 @@ DestroyBCPropertyDataFunc(void* aFrame, } void* -nsTableFrame::GetProperty(nsPresContext* aPresContext, - nsIFrame* aFrame, +nsTableFrame::GetProperty(nsIFrame* aFrame, nsIAtom* aPropertyName, PRBool aCreateIfNecessary) { - nsPropertyTable *propTable = aPresContext->PropertyTable(); + nsPropertyTable *propTable = aFrame->GetPresContext()->PropertyTable(); void *value = propTable->GetProperty(aFrame, aPropertyName); if (value) { return (nsPoint*)value; // the property already exists diff --git a/mozilla/layout/tables/nsTableFrame.h b/mozilla/layout/tables/nsTableFrame.h index 279ab0e0e58..3b7a971429e 100644 --- a/mozilla/layout/tables/nsTableFrame.h +++ b/mozilla/layout/tables/nsTableFrame.h @@ -203,8 +203,7 @@ public: nsIFrame* aPrevInFlow); - static void* GetProperty(nsPresContext* aPresContext, - nsIFrame* aFrame, + static void* GetProperty(nsIFrame* aFrame, nsIAtom* aPropertyName, PRBool aCreateIfNecessary = PR_FALSE); @@ -231,8 +230,7 @@ public: virtual PRBool IsContainingBlock() const; - static nsresult AppendDirtyReflowCommand(nsIPresShell* aPresShell, - nsIFrame* aFrame); + static nsresult AppendDirtyReflowCommand(nsIFrame* aFrame); static void RePositionViews(nsIFrame* aFrame); @@ -243,26 +241,19 @@ public: /* * Notification that aAttribute has changed for content inside a table (cell, row, etc) */ - void AttributeChangedFor(nsPresContext* aPresContext, - nsIFrame* aFrame, + void AttributeChangedFor(nsIFrame* aFrame, nsIContent* aContent, nsIAtom* aAttribute); /** @see nsIFrame::Destroy */ NS_IMETHOD Destroy(nsPresContext* aPresContext); - NS_IMETHOD AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList); - NS_IMETHOD InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList); - NS_IMETHOD RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame); // Get the offset from the border box to the area where the row groups fit @@ -323,7 +314,7 @@ public: // get the area that the border leak out from the inner table frame into // the surrounding margin space - nsMargin GetBCMargin(nsPresContext* aPresContext) const; + nsMargin GetBCMargin() const; /** Get width of table + colgroup + col collapse: elements that * continue along the length of the whole left side. @@ -333,11 +324,9 @@ public: */ nscoord GetContinuousLeftBCBorderWidth(float aPixelsToTwips) const; - void SetBCDamageArea(nsPresContext& aPresContext, - const nsRect& aValue); + void SetBCDamageArea(const nsRect& aValue); - void PaintBCBorders(nsPresContext* aPresContext, - nsIRenderingContext& aRenderingContext, + void PaintBCBorders(nsIRenderingContext& aRenderingContext, const nsRect& aDirtyRect); NS_IMETHOD GetFrameForPoint(const nsPoint& aPoint, @@ -373,8 +362,7 @@ public: const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus); - nsresult ReflowTable(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize, + nsresult ReflowTable(nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, nscoord aAvailHeight, nsReflowReason aReason, @@ -464,29 +452,23 @@ public: nsTableColFrame* GetColFrame(PRInt32 aColIndex) const; /** Insert a col frame reference into the colframe cache and adapt the cellmap - * @param aPresContext - the presentation context * @param aColFrame - the column frame * @param aColIndex - index where the column should be inserted into the * colframe cache */ - void InsertCol(nsPresContext& aPresContext, - nsTableColFrame& aColFrame, + void InsertCol(nsTableColFrame& aColFrame, PRInt32 aColIndex); - nsTableColGroupFrame* CreateAnonymousColGroupFrame(nsPresContext& aPresContext, - nsTableColGroupType aType); + nsTableColGroupFrame* CreateAnonymousColGroupFrame(nsTableColGroupType aType); - PRInt32 DestroyAnonymousColFrames(nsPresContext& aPresContext, - PRInt32 aNumFrames); + PRInt32 DestroyAnonymousColFrames(PRInt32 aNumFrames); - void CreateAnonymousColFrames(nsPresContext& aPresContext, - PRInt32 aNumColsToAdd, + void CreateAnonymousColFrames(PRInt32 aNumColsToAdd, nsTableColType aColType, PRBool aDoAppend, nsIFrame* aPrevCol = nsnull); - void CreateAnonymousColFrames(nsPresContext& aPresContext, - nsTableColGroupFrame* aColGroupFrame, + void CreateAnonymousColFrames(nsTableColGroupFrame* aColGroupFrame, PRInt32 aNumColsToAdd, nsTableColType aColType, PRBool aAddToColGroupAndTable, @@ -496,55 +478,44 @@ public: /** empty the column frame cache */ void ClearColCache(); - virtual void AppendCell(nsPresContext& aPresContext, - nsTableCellFrame& aCellFrame, + virtual void AppendCell(nsTableCellFrame& aCellFrame, PRInt32 aRowIndex); - virtual void InsertCells(nsPresContext& aPresContext, - nsVoidArray& aCellFrames, + virtual void InsertCells(nsVoidArray& aCellFrames, PRInt32 aRowIndex, PRInt32 aColIndexBefore); - virtual void RemoveCell(nsPresContext& aPresContext, - nsTableCellFrame* aCellFrame, + virtual void RemoveCell(nsTableCellFrame* aCellFrame, PRInt32 aRowIndex); - void AppendRows(nsPresContext& aPresContext, - nsTableRowGroupFrame& aRowGroupFrame, + void AppendRows(nsTableRowGroupFrame& aRowGroupFrame, PRInt32 aRowIndex, nsVoidArray& aRowFrames); - PRInt32 InsertRow(nsPresContext& aPresContext, - nsTableRowGroupFrame& aRowGroupFrame, + PRInt32 InsertRow(nsTableRowGroupFrame& aRowGroupFrame, nsIFrame& aFrame, PRInt32 aRowIndex, PRBool aConsiderSpans); - PRInt32 InsertRows(nsPresContext& aPresContext, - nsTableRowGroupFrame& aRowGroupFrame, + PRInt32 InsertRows(nsTableRowGroupFrame& aRowGroupFrame, nsVoidArray& aFrames, PRInt32 aRowIndex, PRBool aConsiderSpans); - virtual void RemoveRows(nsPresContext& aPresContext, - nsTableRowFrame& aFirstRowFrame, + virtual void RemoveRows(nsTableRowFrame& aFirstRowFrame, PRInt32 aNumRowsToRemove, PRBool aConsiderSpans); - void AppendRowGroups(nsPresContext& aPresContext, - nsIFrame* aFirstRowGroupFrame); + void AppendRowGroups(nsIFrame* aFirstRowGroupFrame); - void InsertRowGroups(nsPresContext& aPresContext, - nsIFrame* aFirstRowGroupFrame, + void InsertRowGroups(nsIFrame* aFirstRowGroupFrame, nsIFrame* aLastRowGroupFrame); - void InsertColGroups(nsPresContext& aPresContext, - PRInt32 aColIndex, + void InsertColGroups(PRInt32 aColIndex, nsIFrame* aFirstFrame, nsIFrame* aLastFrame = nsnull); - virtual void RemoveCol(nsPresContext& aPresContext, - nsTableColGroupFrame* aColGroupFrame, + virtual void RemoveCol(nsTableColGroupFrame* aColGroupFrame, PRInt32 aColIndex, PRBool aRemoveFromCache, PRBool aRemoveFromCellMap); @@ -582,8 +553,7 @@ protected: /** destructor, responsible for mColumnLayoutData */ virtual ~nsTableFrame(); - void InitChildReflowState(nsPresContext& aPresContext, - nsHTMLReflowState& aReflowState); + void InitChildReflowState(nsHTMLReflowState& aReflowState); /** implement abstract method on nsHTMLContainerFrame */ virtual PRIntn GetSkipSides() const; @@ -611,8 +581,7 @@ public: protected: - NS_METHOD ReflowChildren(nsPresContext* aPresContext, - nsTableReflowState& aReflowState, + NS_METHOD ReflowChildren(nsTableReflowState& aReflowState, PRBool aDoColGroups, PRBool aDirtyOnly, nsReflowStatus& aStatus, @@ -629,32 +598,28 @@ protected: * * @see Reflow */ - NS_IMETHOD IncrementalReflow(nsPresContext* aPresContext, - const nsHTMLReflowState& aReflowState, + NS_IMETHOD IncrementalReflow(const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus); /** process an incremental reflow command targeted at a child of this frame. * @param aNextFrame the next frame in the reflow target chain * @see nsIFrameReflow::Reflow */ - NS_IMETHOD IR_TargetIsChild(nsPresContext* aPresContext, - nsTableReflowState& aReflowStatet, + NS_IMETHOD IR_TargetIsChild(nsTableReflowState& aReflowStatet, nsReflowStatus& aStatus, nsIFrame* aNextFrame); /** process an incremental reflow command targeted at this frame. * @see nsIFrameReflow::Reflow */ - NS_IMETHOD IR_TargetIsMe(nsPresContext* aPresContext, - nsTableReflowState& aReflowState, + NS_IMETHOD IR_TargetIsMe(nsTableReflowState& aReflowState, nsReflowStatus& aStatus); /** process a style changed notification. * @see nsIFrameReflow::Reflow * TODO: needs to be optimized for which attribute was actually changed. */ - NS_IMETHOD IR_StyleChanged(nsPresContext* aPresContext, - nsTableReflowState& aReflowState, + NS_IMETHOD IR_StyleChanged(nsTableReflowState& aReflowState, nsReflowStatus& aStatus); NS_IMETHOD AdjustSiblingsAfterReflow(nsTableReflowState& aReflowState, @@ -664,16 +629,13 @@ protected: nsresult RecoverState(nsTableReflowState& aReflowState, nsIFrame* aKidFrame); - NS_METHOD CollapseRowGroupIfNecessary(nsPresContext* aPresContext, - nsIFrame* aRowGroupFrame, + NS_METHOD CollapseRowGroupIfNecessary(nsIFrame* aRowGroupFrame, const nscoord& aYTotalOffset, nscoord& aYGroupOffset, PRInt32& aRowX); - NS_METHOD AdjustForCollapsingRows(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize); + NS_METHOD AdjustForCollapsingRows(nsHTMLReflowMetrics& aDesiredSize); - NS_METHOD AdjustForCollapsingCols(nsPresContext* aPresContext, - nsHTMLReflowMetrics& aDesiredSize); + NS_METHOD AdjustForCollapsingCols(nsHTMLReflowMetrics& aDesiredSize); // end incremental reflow methods @@ -709,26 +671,22 @@ protected: void DistributeHeightToRows(const nsHTMLReflowState& aReflowState, nscoord aAmount); - void PlaceChild(nsPresContext* aPresContext, - nsTableReflowState& aReflowState, + void PlaceChild(nsTableReflowState& aReflowState, nsIFrame* aKidFrame, nsHTMLReflowMetrics& aKidDesiredSize); /** assign widths for each column, taking into account the table content, the effective style, * the layout constraints, and the compatibility mode. - * @param aPresContext the presentation context * @param aTableStyle the resolved style for the table * @param aMaxSize the height and width constraints * @param aMaxElementSize the min size of the largest indivisible object */ - virtual void BalanceColumnWidths(nsPresContext* aPresContext, - const nsHTMLReflowState& aReflowState); + virtual void BalanceColumnWidths(const nsHTMLReflowState& aReflowState); nsIFrame* GetFirstBodyRowGroupFrame(); PRBool MoveOverflowToChildList(nsPresContext* aPresContext); - void PushChildren(nsPresContext *aPresContext, - nsIFrame* aFromChild, + void PushChildren(nsIFrame* aFromChild, nsIFrame* aPrevSibling); public: @@ -818,7 +776,7 @@ protected: void SetBorderCollapse(PRBool aValue); - void CalcBCBorders(nsPresContext& aPresContext); + void CalcBCBorders(); void ExpandBCDamageArea(nsRect& aRect) const; diff --git a/mozilla/layout/tables/nsTableOuterFrame.cpp b/mozilla/layout/tables/nsTableOuterFrame.cpp index fd646b3f024..88c0bf7238d 100644 --- a/mozilla/layout/tables/nsTableOuterFrame.cpp +++ b/mozilla/layout/tables/nsTableOuterFrame.cpp @@ -218,9 +218,7 @@ nsTableOuterFrame::SetInitialChildList(nsPresContext* aPresContext, } NS_IMETHODIMP -nsTableOuterFrame::AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsTableOuterFrame::AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList) { nsresult rv; @@ -242,7 +240,7 @@ nsTableOuterFrame::AppendFrames(nsPresContext* aPresContext, rv = NS_NewHTMLReflowCommand(&reflowCmd, this, eReflowType_ReflowDirty); if (NS_SUCCEEDED(rv)) - aPresShell.AppendReflowCommand(reflowCmd); + GetPresContext()->PresShell()->AppendReflowCommand(reflowCmd); } } else { @@ -254,20 +252,16 @@ nsTableOuterFrame::AppendFrames(nsPresContext* aPresContext, } NS_IMETHODIMP -nsTableOuterFrame::InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsTableOuterFrame::InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList) { NS_PRECONDITION(!aPrevFrame, "invalid previous frame"); - return AppendFrames(aPresContext, aPresShell, aListName, aFrameList); + return AppendFrames(aListName, aFrameList); } NS_IMETHODIMP -nsTableOuterFrame::RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsTableOuterFrame::RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame) { nsresult rv; @@ -290,7 +284,7 @@ nsTableOuterFrame::RemoveFrame(nsPresContext* aPresContext, // Remove the caption frame and destroy it if (mCaptionFrame && (mCaptionFrame == aOldFrame)) { - mCaptionFrame->Destroy(aPresContext); + mCaptionFrame->Destroy(GetPresContext()); mCaptionFrame = nsnull; mMinCaptionWidth = 0; } @@ -300,7 +294,7 @@ nsTableOuterFrame::RemoveFrame(nsPresContext* aPresContext, rv = NS_NewHTMLReflowCommand(&reflowCmd, this, eReflowType_ReflowDirty); if (NS_SUCCEEDED(rv)) - aPresShell.AppendReflowCommand(reflowCmd); + GetPresContext()->PresShell()->AppendReflowCommand(reflowCmd); return NS_OK; } @@ -449,7 +443,7 @@ nsTableOuterFrame::InitChildReflowState(nsPresContext& aPresContext, nsMargin* pCollapsePadding = nsnull; if ((aReflowState.frame == mInnerTableFrame) && (mInnerTableFrame->IsBorderCollapse())) { if (mInnerTableFrame->NeedToCalcBCBorders()) { - mInnerTableFrame->CalcBCBorders(aPresContext); + mInnerTableFrame->CalcBCBorders(); } collapseBorder = mInnerTableFrame->GetBCBorder(); pCollapseBorder = &collapseBorder; diff --git a/mozilla/layout/tables/nsTableOuterFrame.h b/mozilla/layout/tables/nsTableOuterFrame.h index 49bec561eb7..c8480986282 100644 --- a/mozilla/layout/tables/nsTableOuterFrame.h +++ b/mozilla/layout/tables/nsTableOuterFrame.h @@ -106,20 +106,14 @@ public: virtual nsIAtom* GetAdditionalChildListName(PRInt32 aIndex) const; - NS_IMETHOD AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList); - NS_IMETHOD InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList); - NS_IMETHOD RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame); virtual nsIFrame* GetContentInsertionFrame() { diff --git a/mozilla/layout/tables/nsTableRowFrame.cpp b/mozilla/layout/tables/nsTableRowFrame.cpp index 827249f48a7..cb1b1058935 100644 --- a/mozilla/layout/tables/nsTableRowFrame.cpp +++ b/mozilla/layout/tables/nsTableRowFrame.cpp @@ -210,9 +210,7 @@ nsTableRowFrame::Init(nsPresContext* aPresContext, NS_IMETHODIMP -nsTableRowFrame::AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsTableRowFrame::AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList) { // Append the frames @@ -225,7 +223,7 @@ nsTableRowFrame::AppendFrames(nsPresContext* aPresContext, childFrame = childFrame->GetNextSibling()) { if (IS_TABLE_CELL(childFrame->GetType())) { // Add the cell to the cell map - tableFrame->AppendCell(*aPresContext, (nsTableCellFrame&)*childFrame, GetRowIndex()); + tableFrame->AppendCell((nsTableCellFrame&)*childFrame, GetRowIndex()); // XXX this could be optimized with some effort tableFrame->SetNeedStrategyInit(PR_TRUE); } @@ -233,16 +231,14 @@ nsTableRowFrame::AppendFrames(nsPresContext* aPresContext, // Reflow the new frames. They're already marked dirty, so generate a reflow // command that tells us to reflow our dirty child frames - tableFrame->AppendDirtyReflowCommand(&aPresShell, this); + tableFrame->AppendDirtyReflowCommand(this); return NS_OK; } NS_IMETHODIMP -nsTableRowFrame::InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsTableRowFrame::InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList) { @@ -267,22 +263,20 @@ nsTableRowFrame::InsertFrames(nsPresContext* aPresContext, if (prevCellFrame) { prevCellFrame->GetColIndex(colIndex); } - tableFrame->InsertCells(*aPresContext, cellChildren, GetRowIndex(), colIndex); + tableFrame->InsertCells(cellChildren, GetRowIndex(), colIndex); // Insert the frames in the frame list mFrames.InsertFrames(nsnull, aPrevFrame, aFrameList); // Reflow the new frames. They're already marked dirty, so generate a reflow // command that tells us to reflow our dirty child frames - tableFrame->AppendDirtyReflowCommand(&aPresShell, this); + tableFrame->AppendDirtyReflowCommand(this); return NS_OK; } NS_IMETHODIMP -nsTableRowFrame::RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsTableRowFrame::RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame) { // Get the table frame @@ -294,19 +288,19 @@ nsTableRowFrame::RemoveFrame(nsPresContext* aPresContext, PRInt32 colIndex; cellFrame->GetColIndex(colIndex); // remove the cell from the cell map - tableFrame->RemoveCell(*aPresContext, cellFrame, GetRowIndex()); + tableFrame->RemoveCell(cellFrame, GetRowIndex()); // XXX this could be optimized with some effort tableFrame->SetNeedStrategyInit(PR_TRUE); // Remove the frame and destroy it - mFrames.DestroyFrame(aPresContext, aOldFrame); + mFrames.DestroyFrame(GetPresContext(), aOldFrame); // XXX This could probably be optimized with much effort tableFrame->SetNeedStrategyInit(PR_TRUE); // Generate a reflow command so we reflow the table itself. // Target the row so that it gets a dirty reflow before a resize reflow // in case another cell gets added to the row during a reflow coallesce. - tableFrame->AppendDirtyReflowCommand(&aPresShell, this); + tableFrame->AppendDirtyReflowCommand(this); } } @@ -391,7 +385,7 @@ nsTableRowFrame::DidResize(nsPresContext* aPresContext, //XXX nsReflowStatus status; //ReflowChild(cellFrame, aPresContext, desiredSize, kidReflowState, status); - cellFrame->VerticallyAlignChild(aPresContext, aReflowState, mMaxCellAscent); + cellFrame->VerticallyAlignChild(aReflowState, mMaxCellAscent); ConsiderChildOverflow(desiredSize.mOverflowArea, cellFrame); } } @@ -1316,7 +1310,7 @@ nsTableRowFrame::IR_TargetIsChild(nsPresContext* aPresContext, aDesiredSize.width = aReflowState.availableWidth; if (!aDesiredSize.mNothingChanged) { if (aDesiredSize.height == mRect.height) { // our height didn't change - cellFrame->VerticallyAlignChild(aPresContext, aReflowState, mMaxCellAscent); + cellFrame->VerticallyAlignChild(aReflowState, mMaxCellAscent); nsRect dirtyRect = cellFrame->GetRect(); dirtyRect.height = mRect.height; ConsiderChildOverflow(aDesiredSize.mOverflowArea, cellFrame); @@ -1472,7 +1466,7 @@ nsTableRowFrame::ReflowCellFrame(nsPresContext* aPresContext, // XXX What happens if this cell has 'vertical-align: baseline' ? // XXX Why is it assumed that the cell's ascent hasn't changed ? if (fullyComplete) { - aCellFrame->VerticallyAlignChild(aPresContext, aReflowState, mMaxCellAscent); + aCellFrame->VerticallyAlignChild(aReflowState, mMaxCellAscent); } aCellFrame->DidReflow(aPresContext, nsnull, NS_FRAME_REFLOW_FINISHED); @@ -1544,7 +1538,7 @@ nsTableRowFrame::SetUnpaginatedHeight(nsPresContext* aPresContext, { NS_ASSERTION(!mPrevInFlow, "program error"); // Get the property - nscoord* value = (nscoord*)nsTableFrame::GetProperty(aPresContext, this, nsLayoutAtoms::rowUnpaginatedHeightProperty, PR_TRUE); + nscoord* value = (nscoord*)nsTableFrame::GetProperty(this, nsLayoutAtoms::rowUnpaginatedHeightProperty, PR_TRUE); if (value) { *value = aValue; } @@ -1554,7 +1548,7 @@ nscoord nsTableRowFrame::GetUnpaginatedHeight(nsPresContext* aPresContext) { // See if the property is set - nscoord* value = (nscoord*)nsTableFrame::GetProperty(aPresContext, GetFirstInFlow(), nsLayoutAtoms::rowUnpaginatedHeightProperty); + nscoord* value = (nscoord*)nsTableFrame::GetProperty(GetFirstInFlow(), nsLayoutAtoms::rowUnpaginatedHeightProperty); if (value) return *value; else diff --git a/mozilla/layout/tables/nsTableRowFrame.h b/mozilla/layout/tables/nsTableRowFrame.h index 6318c3fd0b8..b5bb25bb4ad 100644 --- a/mozilla/layout/tables/nsTableRowFrame.h +++ b/mozilla/layout/tables/nsTableRowFrame.h @@ -75,18 +75,12 @@ public: nsStyleContext* aContext, nsIFrame* aPrevInFlow); - NS_IMETHOD AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList); - NS_IMETHOD InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList); - NS_IMETHOD RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame); /** instantiate a new instance of nsTableRowFrame. diff --git a/mozilla/layout/tables/nsTableRowGroupFrame.cpp b/mozilla/layout/tables/nsTableRowGroupFrame.cpp index 6cf3de79b4b..fcf6d02efa9 100644 --- a/mozilla/layout/tables/nsTableRowGroupFrame.cpp +++ b/mozilla/layout/tables/nsTableRowGroupFrame.cpp @@ -1327,9 +1327,7 @@ nsTableRowGroupFrame::IncrementalReflow(nsPresContext* aPresContext, } NS_IMETHODIMP -nsTableRowGroupFrame::AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsTableRowGroupFrame::AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList) { // collect the new row frames in an array @@ -1349,10 +1347,10 @@ nsTableRowGroupFrame::AppendFrames(nsPresContext* aPresContext, nsTableFrame* tableFrame = nsnull; nsTableFrame::GetTableFrame(this, tableFrame); if (tableFrame) { - tableFrame->AppendRows(*aPresContext, *this, rowIndex, rows); + tableFrame->AppendRows(*this, rowIndex, rows); // Reflow the new frames. They're already marked dirty, so generate a reflow // command that tells us to reflow our dirty child frames - nsTableFrame::AppendDirtyReflowCommand(&aPresShell, this); + nsTableFrame::AppendDirtyReflowCommand(this); if (tableFrame->RowIsSpannedInto(rowIndex)) { tableFrame->SetNeedStrategyInit(PR_TRUE); } @@ -1372,9 +1370,7 @@ nsTableRowGroupFrame::AppendFrames(nsPresContext* aPresContext, } NS_IMETHODIMP -nsTableRowGroupFrame::InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsTableRowGroupFrame::InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList) { @@ -1407,11 +1403,11 @@ nsTableRowGroupFrame::InsertFrames(nsPresContext* aPresContext, if (numRows > 0) { nsTableRowFrame* prevRow = (nsTableRowFrame *)nsTableFrame::GetFrameAtOrBefore(this, aPrevFrame, nsLayoutAtoms::tableRowFrame); PRInt32 rowIndex = (prevRow) ? prevRow->GetRowIndex() + 1 : startRowIndex; - tableFrame->InsertRows(*aPresContext, *this, rows, rowIndex, PR_TRUE); + tableFrame->InsertRows(*this, rows, rowIndex, PR_TRUE); // Reflow the new frames. They're already marked dirty, so generate a reflow // command that tells us to reflow our dirty child frames - nsTableFrame::AppendDirtyReflowCommand(&aPresShell, this); + nsTableFrame::AppendDirtyReflowCommand(this); if (tableFrame->RowIsSpannedInto(rowIndex) || tableFrame->RowHasSpanningCells(rowIndex + numRows - 1)) { tableFrame->SetNeedStrategyInit(PR_TRUE); @@ -1430,9 +1426,7 @@ nsTableRowGroupFrame::InsertFrames(nsPresContext* aPresContext, } NS_IMETHODIMP -nsTableRowGroupFrame::RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsTableRowGroupFrame::RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame) { nsTableFrame* tableFrame = nsnull; @@ -1440,16 +1434,16 @@ nsTableRowGroupFrame::RemoveFrame(nsPresContext* aPresContext, if (tableFrame) { if (nsLayoutAtoms::tableRowFrame == aOldFrame->GetType()) { // remove the rows from the table (and flag a rebalance) - tableFrame->RemoveRows(*aPresContext, (nsTableRowFrame &)*aOldFrame, 1, PR_TRUE); + tableFrame->RemoveRows((nsTableRowFrame &)*aOldFrame, 1, PR_TRUE); // XXX this could be optimized (see nsTableFrame::RemoveRows) tableFrame->SetNeedStrategyInit(PR_TRUE); // Because we haven't added any new frames we don't need to do a pass1 // reflow. Just generate a reflow command so we reflow the table - nsTableFrame::AppendDirtyReflowCommand(&aPresShell, this); + nsTableFrame::AppendDirtyReflowCommand(this); } } - mFrames.DestroyFrame(aPresContext, aOldFrame); + mFrames.DestroyFrame(GetPresContext(), aOldFrame); return NS_OK; } diff --git a/mozilla/layout/tables/nsTableRowGroupFrame.h b/mozilla/layout/tables/nsTableRowGroupFrame.h index 0607848f4e6..d97a2a78412 100644 --- a/mozilla/layout/tables/nsTableRowGroupFrame.h +++ b/mozilla/layout/tables/nsTableRowGroupFrame.h @@ -123,20 +123,14 @@ public: nsStyleContext* aContext, nsIFrame* aPrevInFlow); - NS_IMETHOD AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList); - NS_IMETHOD InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList); - NS_IMETHOD RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame); /** @see nsIFrame::Paint */ diff --git a/mozilla/layout/xul/base/src/nsBoxFrame.cpp b/mozilla/layout/xul/base/src/nsBoxFrame.cpp index 440acc0dd0d..dc681fe53ac 100644 --- a/mozilla/layout/xul/base/src/nsBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsBoxFrame.cpp @@ -1155,12 +1155,11 @@ nsBoxFrame::NeedsRecalc() } NS_IMETHODIMP -nsBoxFrame::RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsBoxFrame::RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame) { - nsBoxLayoutState state(aPresContext); + nsPresContext* presContext = GetPresContext(); + nsBoxLayoutState state(presContext); // remove the child frame mFrames.RemoveFrame(aOldFrame); @@ -1170,7 +1169,7 @@ nsBoxFrame::RemoveFrame(nsPresContext* aPresContext, mLayoutManager->ChildrenRemoved(this, state, aOldFrame); // destroy the child frame - aOldFrame->Destroy(aPresContext); + aOldFrame->Destroy(presContext); // mark us dirty and generate a reflow command MarkDirtyChildren(state); @@ -1179,13 +1178,11 @@ nsBoxFrame::RemoveFrame(nsPresContext* aPresContext, } NS_IMETHODIMP -nsBoxFrame::InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsBoxFrame::InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList) { - nsBoxLayoutState state(aPresContext); + nsBoxLayoutState state(GetPresContext()); // insert the child frames mFrames.InsertFrames(this, aPrevFrame, aFrameList); @@ -1208,12 +1205,10 @@ nsBoxFrame::InsertFrames(nsPresContext* aPresContext, NS_IMETHODIMP -nsBoxFrame::AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, +nsBoxFrame::AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList) { - nsBoxLayoutState state(aPresContext); + nsBoxLayoutState state(GetPresContext()); // append the new frames mFrames.AppendFrames(this, aFrameList); diff --git a/mozilla/layout/xul/base/src/nsBoxFrame.h b/mozilla/layout/xul/base/src/nsBoxFrame.h index 6002d969d2a..5a059533b5e 100644 --- a/mozilla/layout/xul/base/src/nsBoxFrame.h +++ b/mozilla/layout/xul/base/src/nsBoxFrame.h @@ -151,20 +151,14 @@ public: const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus); - NS_IMETHOD AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList); - NS_IMETHOD InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList); - NS_IMETHOD RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame); NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext, diff --git a/mozilla/layout/xul/base/src/nsMenuFrame.cpp b/mozilla/layout/xul/base/src/nsMenuFrame.cpp index b2fa8bd908c..6564f997f9a 100644 --- a/mozilla/layout/xul/base/src/nsMenuFrame.cpp +++ b/mozilla/layout/xul/base/src/nsMenuFrame.cpp @@ -1806,31 +1806,28 @@ nsMenuFrame::OnDestroyed() } NS_IMETHODIMP -nsMenuFrame::RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aOldFrame) +nsMenuFrame::RemoveFrame(nsIAtom* aListName, + nsIFrame* aOldFrame) { nsresult rv; if (mPopupFrames.ContainsFrame(aOldFrame)) { // Go ahead and remove this frame. - mPopupFrames.DestroyFrame(aPresContext, aOldFrame); - nsBoxLayoutState state(aPresContext); + nsPresContext* presContext = GetPresContext(); + mPopupFrames.DestroyFrame(presContext, aOldFrame); + nsBoxLayoutState state(presContext); rv = MarkDirtyChildren(state); } else { - rv = nsBoxFrame::RemoveFrame(aPresContext, aPresShell, aListName, aOldFrame); + rv = nsBoxFrame::RemoveFrame(aListName, aOldFrame); } return rv; } NS_IMETHODIMP -nsMenuFrame::InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aPrevFrame, - nsIFrame* aFrameList) +nsMenuFrame::InsertFrames(nsIAtom* aListName, + nsIFrame* aPrevFrame, + nsIFrame* aFrameList) { nsresult rv; @@ -1839,23 +1836,21 @@ nsMenuFrame::InsertFrames(nsPresContext* aPresContext, NS_ASSERTION(aFrameList->IsBoxFrame(),"Popup is not a box!!!"); mPopupFrames.InsertFrames(nsnull, nsnull, aFrameList); - nsBoxLayoutState state(aPresContext); + nsBoxLayoutState state(GetPresContext()); #ifdef DEBUG_LAYOUT SetDebug(state, aFrameList, mState & NS_STATE_CURRENTLY_IN_DEBUG); #endif rv = MarkDirtyChildren(state); } else { - rv = nsBoxFrame::InsertFrames(aPresContext, aPresShell, aListName, aPrevFrame, aFrameList); + rv = nsBoxFrame::InsertFrames(aListName, aPrevFrame, aFrameList); } return rv; } NS_IMETHODIMP -nsMenuFrame::AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aFrameList) +nsMenuFrame::AppendFrames(nsIAtom* aListName, + nsIFrame* aFrameList) { if (!aFrameList) return NS_OK; @@ -1867,13 +1862,13 @@ nsMenuFrame::AppendFrames(nsPresContext* aPresContext, NS_ASSERTION(aFrameList->IsBoxFrame(),"Popup is not a box!!!"); mPopupFrames.AppendFrames(nsnull, aFrameList); - nsBoxLayoutState state(aPresContext); + nsBoxLayoutState state(GetPresContext()); #ifdef DEBUG_LAYOUT SetDebug(state, aFrameList, mState & NS_STATE_CURRENTLY_IN_DEBUG); #endif rv = MarkDirtyChildren(state); } else { - rv = nsBoxFrame::AppendFrames(aPresContext, aPresShell, aListName, aFrameList); + rv = nsBoxFrame::AppendFrames(aListName, aFrameList); } return rv; diff --git a/mozilla/layout/xul/base/src/nsMenuFrame.h b/mozilla/layout/xul/base/src/nsMenuFrame.h index 2e32a22f655..3f660771da8 100644 --- a/mozilla/layout/xul/base/src/nsMenuFrame.h +++ b/mozilla/layout/xul/base/src/nsMenuFrame.h @@ -116,20 +116,14 @@ public: nsGUIEvent* aEvent, nsEventStatus* aEventStatus); - NS_IMETHOD AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList); - NS_IMETHOD InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList); - NS_IMETHOD RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame); // nsIMenuFrame Interface diff --git a/mozilla/layout/xul/base/src/nsRootBoxFrame.cpp b/mozilla/layout/xul/base/src/nsRootBoxFrame.cpp index 921e407d5b3..3fc7ae85f42 100644 --- a/mozilla/layout/xul/base/src/nsRootBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsRootBoxFrame.cpp @@ -81,18 +81,12 @@ public: NS_IMETHOD AddTooltipSupport(nsIContent* aNode); NS_IMETHOD RemoveTooltipSupport(nsIContent* aNode); - NS_IMETHOD AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList); - NS_IMETHOD InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList); - NS_IMETHOD RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame); NS_IMETHOD Reflow(nsPresContext* aPresContext, @@ -152,10 +146,8 @@ nsRootBoxFrame::nsRootBoxFrame(nsIPresShell* aShell):nsBoxFrame(aShell, PR_TRUE) } NS_IMETHODIMP -nsRootBoxFrame::AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aFrameList) +nsRootBoxFrame::AppendFrames(nsIAtom* aListName, + nsIFrame* aFrameList) { nsresult rv; @@ -170,18 +162,16 @@ nsRootBoxFrame::AppendFrames(nsPresContext* aPresContext, rv = NS_ERROR_FAILURE; } else { - rv = nsBoxFrame::AppendFrames(aPresContext, aPresShell, aListName, aFrameList); + rv = nsBoxFrame::AppendFrames(aListName, aFrameList); } return rv; } NS_IMETHODIMP -nsRootBoxFrame::InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aPrevFrame, - nsIFrame* aFrameList) +nsRootBoxFrame::InsertFrames(nsIAtom* aListName, + nsIFrame* aPrevFrame, + nsIFrame* aFrameList) { nsresult rv; @@ -191,17 +181,15 @@ nsRootBoxFrame::InsertFrames(nsPresContext* aPresContext, if (aPrevFrame) { rv = NS_ERROR_UNEXPECTED; } else { - rv = AppendFrames(aPresContext, aPresShell, aListName, aFrameList); + rv = AppendFrames(aListName, aFrameList); } return rv; } NS_IMETHODIMP -nsRootBoxFrame::RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aOldFrame) +nsRootBoxFrame::RemoveFrame(nsIAtom* aListName, + nsIFrame* aOldFrame) { nsresult rv; @@ -211,7 +199,7 @@ nsRootBoxFrame::RemoveFrame(nsPresContext* aPresContext, rv = NS_ERROR_INVALID_ARG; } else if (aOldFrame == mFrames.FirstChild()) { - rv = nsBoxFrame::RemoveFrame(aPresContext, aPresShell, aListName, aOldFrame); + rv = nsBoxFrame::RemoveFrame(aListName, aOldFrame); } else { rv = NS_ERROR_FAILURE; } diff --git a/mozilla/layout/xul/base/src/nsScrollBoxFrame.cpp b/mozilla/layout/xul/base/src/nsScrollBoxFrame.cpp index 13123657942..22a7e22deee 100644 --- a/mozilla/layout/xul/base/src/nsScrollBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsScrollBoxFrame.cpp @@ -130,7 +130,7 @@ nsScrollBoxFrame::Init(nsPresContext* aPresContext, aPrevInFlow); // Create the scrolling view - CreateScrollingView(aPresContext); + CreateScrollingView(); return rv; } @@ -142,13 +142,13 @@ nsScrollBoxFrame::SetInitialChildList(nsPresContext* aPresContext, nsresult rv = nsBoxFrame::SetInitialChildList(aPresContext, aListName, aChildList); - SetUpScrolledFrame(aPresContext); + SetUpScrolledFrame(); return rv; } void -nsScrollBoxFrame::SetUpScrolledFrame(nsPresContext* aPresContext) +nsScrollBoxFrame::SetUpScrolledFrame() { NS_ASSERTION(mFrames.GetLength() <= 1, "ScrollBoxes can only have 1 child!"); @@ -163,47 +163,41 @@ nsScrollBoxFrame::SetUpScrolledFrame(nsPresContext* aPresContext) } NS_IMETHODIMP -nsScrollBoxFrame::AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aFrameList) +nsScrollBoxFrame::AppendFrames(nsIAtom* aListName, + nsIFrame* aFrameList) { - nsresult rv = nsBoxFrame::AppendFrames(aPresContext, aPresShell, aListName, aFrameList); + nsresult rv = nsBoxFrame::AppendFrames(aListName, aFrameList); // make sure we only have 1 child. NS_ASSERTION(!mFrames.FirstChild()->GetNextSibling(), "Error ScrollBoxes can only have 1 child"); - SetUpScrolledFrame(aPresContext); + SetUpScrolledFrame(); return rv; } NS_IMETHODIMP -nsScrollBoxFrame::InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aPrevFrame, - nsIFrame* aFrameList) +nsScrollBoxFrame::InsertFrames(nsIAtom* aListName, + nsIFrame* aPrevFrame, + nsIFrame* aFrameList) { - nsresult rv = nsBoxFrame::InsertFrames(aPresContext, aPresShell, aListName, aPrevFrame, aFrameList); + nsresult rv = nsBoxFrame::InsertFrames(aListName, aPrevFrame, aFrameList); // make sure we only have 1 child. NS_ASSERTION(!mFrames.FirstChild()->GetNextSibling(), "Error ScrollBoxes can only have 1 child"); - SetUpScrolledFrame(aPresContext); + SetUpScrolledFrame(); return rv; } NS_IMETHODIMP -nsScrollBoxFrame::RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aOldFrame) +nsScrollBoxFrame::RemoveFrame(nsIAtom* aListName, + nsIFrame* aOldFrame) { - nsresult rv = nsBoxFrame::RemoveFrame(aPresContext, aPresShell, aListName, aOldFrame); + nsresult rv = nsBoxFrame::RemoveFrame(aListName, aOldFrame); - SetUpScrolledFrame(aPresContext); + SetUpScrolledFrame(); return rv; } @@ -221,9 +215,8 @@ nsScrollBoxFrame::CreateScrollingViewWidget(nsIView* aView, const nsStyleDisplay } nsresult -nsScrollBoxFrame::GetScrollingParentView(nsPresContext* aPresContext, - nsIFrame* aParent, - nsIView** aParentView) +nsScrollBoxFrame::GetScrollingParentView(nsIFrame* aParent, + nsIView** aParentView) { *aParentView = aParent->GetView(); NS_ASSERTION(*aParentView, "GetParentWithView failed"); @@ -243,7 +236,7 @@ nsScrollBoxFrame::GetMouseCapturer() const } nsresult -nsScrollBoxFrame::CreateScrollingView(nsPresContext* aPresContext) +nsScrollBoxFrame::CreateScrollingView() { //Get parent frame nsIFrame* parent = GetAncestorWithView(); @@ -251,7 +244,7 @@ nsScrollBoxFrame::CreateScrollingView(nsPresContext* aPresContext) // Get parent view nsIView* parentView = nsnull; - GetScrollingParentView(aPresContext, parent, &parentView); + GetScrollingParentView(parent, &parentView); // Get the view manager nsIViewManager* viewManager = parentView->GetViewManager(); @@ -263,7 +256,7 @@ nsScrollBoxFrame::CreateScrollingView(nsPresContext* aPresContext) // Initialize the scrolling view nsIView* view = scrollingView->View(); - SyncFrameViewProperties(aPresContext, this, mStyleContext, view); + SyncFrameViewProperties(GetPresContext(), this, mStyleContext, view); // Insert the view into the view hierarchy // XXX Put view last in document order until we know how to do better @@ -422,8 +415,6 @@ nsScrollBoxFrame::DoLayout(nsBoxLayoutState& aState) horizChanged = PR_TRUE; } - nsCOMPtr shell = aState.PresShell(); - // if either changed if (vertChanged || horizChanged) { @@ -432,23 +423,23 @@ nsScrollBoxFrame::DoLayout(nsBoxLayoutState& aState) if (mVerticalOverflow == mHorizontalOverflow) { // both either overflowed or underflowed. 1 event - PostScrollPortEvent(shell, mVerticalOverflow, nsScrollPortEvent::both); + PostScrollPortEvent(mVerticalOverflow, nsScrollPortEvent::both); } else { // one overflowed and one underflowed - PostScrollPortEvent(shell, mVerticalOverflow, nsScrollPortEvent::vertical); - PostScrollPortEvent(shell, mHorizontalOverflow, nsScrollPortEvent::horizontal); + PostScrollPortEvent(mVerticalOverflow, nsScrollPortEvent::vertical); + PostScrollPortEvent(mHorizontalOverflow, nsScrollPortEvent::horizontal); } } else if (vertChanged) // only one changed either vert or horiz - PostScrollPortEvent(shell, mVerticalOverflow, nsScrollPortEvent::vertical); + PostScrollPortEvent(mVerticalOverflow, nsScrollPortEvent::vertical); else - PostScrollPortEvent(shell, mHorizontalOverflow, nsScrollPortEvent::horizontal); + PostScrollPortEvent(mHorizontalOverflow, nsScrollPortEvent::horizontal); } return NS_OK; } void -nsScrollBoxFrame::PostScrollPortEvent(nsIPresShell* aShell, PRBool aOverflow, nsScrollPortEvent::orientType aType) +nsScrollBoxFrame::PostScrollPortEvent(PRBool aOverflow, nsScrollPortEvent::orientType aType) { if (!mContent) return; @@ -457,7 +448,7 @@ nsScrollBoxFrame::PostScrollPortEvent(nsIPresShell* aShell, PRBool aOverflow, ns NS_SCROLLPORT_OVERFLOW : NS_SCROLLPORT_UNDERFLOW); event->orient = aType; - aShell->PostDOMEvent(mContent, event); + GetPresContext()->PresShell()->PostDOMEvent(mContent, event); } diff --git a/mozilla/layout/xul/base/src/nsScrollBoxFrame.h b/mozilla/layout/xul/base/src/nsScrollBoxFrame.h index 699b7a1fb85..a4de54bd130 100644 --- a/mozilla/layout/xul/base/src/nsScrollBoxFrame.h +++ b/mozilla/layout/xul/base/src/nsScrollBoxFrame.h @@ -69,20 +69,14 @@ public: // Because there can be only one child frame, these two function return // NS_ERROR_FAILURE - NS_IMETHOD AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList); - NS_IMETHOD InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList); // This function returns NS_ERROR_NOT_IMPLEMENTED - NS_IMETHOD RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame); @@ -131,19 +125,18 @@ protected: // that sub-classes may control widget creation. virtual nsresult CreateScrollingViewWidget(nsIView* aView, const nsStyleDisplay* aDisplay); // Getting the view for scollframe may be overriden to provide a parent view for te scroll frame - virtual nsresult GetScrollingParentView(nsPresContext* aPresContext, - nsIFrame* aParent, + virtual nsresult GetScrollingParentView(nsIFrame* aParent, nsIView** aParentView); private: - nsresult CreateScrollingView(nsPresContext* aPresContext); + nsresult CreateScrollingView(); PRPackedBool mVerticalOverflow; PRPackedBool mHorizontalOverflow; protected: virtual PRBool NeedsClipWidget(); - virtual void PostScrollPortEvent(nsIPresShell* aShell, PRBool aOverflow, nsScrollPortEvent::orientType aType); - virtual void SetUpScrolledFrame(nsPresContext* aPresContext); + virtual void PostScrollPortEvent(PRBool aOverflow, nsScrollPortEvent::orientType aType); + virtual void SetUpScrolledFrame(); }; #endif /* nsScrollBoxFrame_h___ */ diff --git a/mozilla/layout/xul/base/src/nsSliderFrame.cpp b/mozilla/layout/xul/base/src/nsSliderFrame.cpp index d378ac19187..294293816c3 100644 --- a/mozilla/layout/xul/base/src/nsSliderFrame.cpp +++ b/mozilla/layout/xul/base/src/nsSliderFrame.cpp @@ -144,12 +144,10 @@ nsSliderFrame::Init(nsPresContext* aPresContext, } NS_IMETHODIMP -nsSliderFrame::RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aOldFrame) +nsSliderFrame::RemoveFrame(nsIAtom* aListName, + nsIFrame* aOldFrame) { - nsresult rv = nsBoxFrame::RemoveFrame(aPresContext, aPresShell, aListName, aOldFrame); + nsresult rv = nsBoxFrame::RemoveFrame(aListName, aOldFrame); PRInt32 start = GetChildCount(); if (start == 0) RemoveListener(); @@ -158,14 +156,12 @@ nsSliderFrame::RemoveFrame(nsPresContext* aPresContext, } NS_IMETHODIMP -nsSliderFrame::InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aPrevFrame, - nsIFrame* aFrameList) +nsSliderFrame::InsertFrames(nsIAtom* aListName, + nsIFrame* aPrevFrame, + nsIFrame* aFrameList) { PRInt32 start = GetChildCount(); - nsresult rv = nsBoxFrame::InsertFrames(aPresContext, aPresShell, aListName, aPrevFrame, aFrameList); + nsresult rv = nsBoxFrame::InsertFrames(aListName, aPrevFrame, aFrameList); if (start == 0) AddListener(); @@ -173,15 +169,13 @@ nsSliderFrame::InsertFrames(nsPresContext* aPresContext, } NS_IMETHODIMP -nsSliderFrame::AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, - nsIFrame* aFrameList) +nsSliderFrame::AppendFrames(nsIAtom* aListName, + nsIFrame* aFrameList) { // if we have no children and on was added then make sure we add the // listener PRInt32 start = GetChildCount(); - nsresult rv = nsBoxFrame::AppendFrames(aPresContext, aPresShell, aListName, aFrameList); + nsresult rv = nsBoxFrame::AppendFrames(aListName, aFrameList); if (start == 0) AddListener(); diff --git a/mozilla/layout/xul/base/src/nsSliderFrame.h b/mozilla/layout/xul/base/src/nsSliderFrame.h index 94e5dc60937..81ad61b2145 100644 --- a/mozilla/layout/xul/base/src/nsSliderFrame.h +++ b/mozilla/layout/xul/base/src/nsSliderFrame.h @@ -141,22 +141,14 @@ public: NS_IMETHOD DoLayout(nsBoxLayoutState& aBoxLayoutState); // nsIFrame overrides - - /** nsIFrame **/ - NS_IMETHOD AppendFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD AppendFrames(nsIAtom* aListName, nsIFrame* aFrameList); - NS_IMETHOD InsertFrames(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD InsertFrames(nsIAtom* aListName, nsIFrame* aPrevFrame, nsIFrame* aFrameList); - NS_IMETHOD RemoveFrame(nsPresContext* aPresContext, - nsIPresShell& aPresShell, - nsIAtom* aListName, + NS_IMETHOD RemoveFrame(nsIAtom* aListName, nsIFrame* aOldFrame); NS_IMETHOD Destroy(nsPresContext* aPresContext);