Changed Reflow() member function to take a reference to a nsIPresContext

instead of a pointer
This commit is contained in:
troy 1998-07-15 02:53:09 +00:00
Родитель 484b2fe44d
Коммит e8893481dd
68 изменённых файлов: 272 добавлений и 282 удалений

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

@ -419,7 +419,7 @@ public:
* you must <b>always</b> reflow at least one frame regardless of the
* available space
*/
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus) = 0;

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

@ -64,7 +64,7 @@ public:
*
* @see nsISpaceManager#Translate()
*/
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsISpaceManager* aSpaceManager,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,

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

@ -474,7 +474,7 @@ nsReflowStatus nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
aKidFrame->GetFrameState(kidFrameState);
NS_ASSERTION(kidFrameState & NS_FRAME_IN_REFLOW, "kid frame is not in reflow");
#endif
aKidFrame->Reflow(aPresContext, aDesiredSize, aReflowState, status);
aKidFrame->Reflow(*aPresContext, aDesiredSize, aReflowState, status);
if (NS_FRAME_IS_COMPLETE(status)) {
nsIFrame* kidNextInFlow;

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

@ -1058,7 +1058,7 @@ nsFrame::DidReflow(nsIPresContext& aPresContext,
return NS_OK;
}
NS_METHOD nsFrame::Reflow(nsIPresContext* aPresContext,
NS_METHOD nsFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)

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

@ -147,7 +147,7 @@ public:
NS_IMETHOD WillReflow(nsIPresContext& aPresContext);
NS_IMETHOD DidReflow(nsIPresContext& aPresContext,
nsDidReflowStatus aStatus);
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);

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

@ -462,7 +462,7 @@ PresShell::ResizeReflow(nscoord aWidth, nscoord aHeight)
nsReflowStatus status;
nsReflowState reflowState(mRootFrame, reflowReason, maxSize);
mRootFrame->Reflow(mPresContext, desiredSize, reflowState, status);
mRootFrame->Reflow(*mPresContext, desiredSize, reflowState, status);
mRootFrame->SizeTo(desiredSize.width, desiredSize.height);
#ifdef NS_DEBUG
if (nsIFrame::GetVerifyTreeEnable()) {

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

@ -141,7 +141,7 @@ public:
// XXX implement regular reflow method too!
// nsIRunaround
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsISpaceManager* aSpaceManager,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
@ -1197,7 +1197,7 @@ nsCSSBlockFrame::GetLastContentOffset() const
#endif
NS_IMETHODIMP
nsCSSBlockFrame::Reflow(nsIPresContext* aPresContext,
nsCSSBlockFrame::Reflow(nsIPresContext& aPresContext,
nsISpaceManager* aSpaceManager,
nsReflowMetrics& aMetrics,
const nsReflowState& aReflowState,
@ -1223,7 +1223,7 @@ nsCSSBlockFrame::Reflow(nsIPresContext* aPresContext,
// Replace parent provided reflow state with our own significantly
// more extensive version.
nsCSSBlockReflowState state(aPresContext, aSpaceManager,
nsCSSBlockReflowState state(&aPresContext, aSpaceManager,
this, mStyleContext,
aReflowState, aMetrics,
PRBool(nsnull != aMetrics.maxElementSize));
@ -2203,7 +2203,7 @@ nsCSSBlockFrame::ReflowBlockFrame(nsCSSBlockReflowState& aState,
reflowState.reason = reason;
nsRect r;
aState.mSpaceManager->Translate(x, y);
rv = runAround->Reflow(aState.mPresContext, aState.mSpaceManager,
rv = runAround->Reflow(*aState.mPresContext, aState.mSpaceManager,
metrics, reflowState, r, reflowStatus);
aState.mSpaceManager->Translate(-x, -y);
metrics.width = r.width;
@ -2214,7 +2214,7 @@ nsCSSBlockFrame::ReflowBlockFrame(nsCSSBlockReflowState& aState,
else {
nsReflowState reflowState(aFrame, aState, availSize);
reflowState.reason = reason;
rv = aFrame->Reflow(aState.mPresContext, metrics, reflowState,
rv = aFrame->Reflow(*aState.mPresContext, metrics, reflowState,
reflowStatus);
}
if (NS_IS_REFLOW_ERROR(rv)) {
@ -3392,7 +3392,7 @@ nsCSSBlockFrame::ReflowFloater(nsIPresContext* aPresContext,
nsReflowStatus status;
aFloaterFrame->WillReflow(*aPresContext);
aFloaterFrame->Reflow(aPresContext, desiredSize, reflowState, status);
aFloaterFrame->Reflow(*aPresContext, desiredSize, reflowState, status);
aFloaterFrame->SizeTo(desiredSize.width, desiredSize.height);
//XXX aFloaterFrame->DidReflow(*aPresContext, NS_FRAME_REFLOW_FINISHED);

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

@ -67,7 +67,7 @@ public:
nsIStyleContext* aStyleContext,
nsIFrame*& aContinuingFrame);
#if XXX_not_yet
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);

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

@ -249,7 +249,7 @@ nsCSSInlineLayout::ReflowFrame(nsIFrame* aKidFrame,
(NS_OK == aKidFrame->QueryInterface(kIRunaroundIID,
(void**)&runAround))) {
nsRect r;
runAround->Reflow(mLineLayout.mPresContext, mLineLayout.mSpaceManager,
runAround->Reflow(*mLineLayout.mPresContext, mLineLayout.mSpaceManager,
aMetrics, aReflowState, r, rv);
aMetrics.width = r.width;
aMetrics.height = r.height;
@ -263,7 +263,7 @@ nsCSSInlineLayout::ReflowFrame(nsIFrame* aKidFrame,
aInlineAware = PR_TRUE;
}
else {
aKidFrame->Reflow(mLineLayout.mPresContext, aMetrics, aReflowState, rv);
aKidFrame->Reflow(*mLineLayout.mPresContext, aMetrics, aReflowState, rv);
aInlineAware = PR_FALSE;
}

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

@ -127,7 +127,7 @@ NS_IMETHODIMP nsHTMLReflowCommand::Dispatch(nsIPresContext& aPresContext,
nsReflowState reflowState(root, *this, aMaxSize);
nsReflowStatus status;
root->Reflow(&aPresContext, aDesiredSize, reflowState, status);
root->Reflow(aPresContext, aDesiredSize, reflowState, status);
}
return NS_OK;

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

@ -419,7 +419,7 @@ public:
* you must <b>always</b> reflow at least one frame regardless of the
* available space
*/
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus) = 0;

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

@ -50,7 +50,7 @@ NS_METHOD nsLeafFrame::Paint(nsIPresContext& aPresContext,
return NS_OK;
}
NS_METHOD nsLeafFrame::Reflow(nsIPresContext* aPresContext,
NS_METHOD nsLeafFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)
@ -61,8 +61,8 @@ NS_METHOD nsLeafFrame::Reflow(nsIPresContext* aPresContext,
// and if set use them instead of calling GetDesiredSize.
GetDesiredSize(aPresContext, aReflowState, aDesiredSize);
AddBordersAndPadding(aPresContext, aDesiredSize);
GetDesiredSize(&aPresContext, aReflowState, aDesiredSize);
AddBordersAndPadding(&aPresContext, aDesiredSize);
if (nsnull != aDesiredSize.maxElementSize) {
aDesiredSize.maxElementSize->width = aDesiredSize.width;
aDesiredSize.maxElementSize->height = aDesiredSize.height;

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

@ -32,7 +32,7 @@ public:
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect);
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);

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

@ -32,7 +32,7 @@ class nsObjectFrame : public nsObjectFrameSuper {
public:
nsObjectFrame(nsIContent* aContent, nsIFrame* aParentFrame);
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);
@ -170,13 +170,13 @@ nsObjectFrame::GetDesiredSize(nsIPresContext* aPresContext,
}
NS_IMETHODIMP
nsObjectFrame::Reflow(nsIPresContext* aPresContext,
nsObjectFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)
{
// Get our desired size
GetDesiredSize(aPresContext, aReflowState, aDesiredSize);
GetDesiredSize(&aPresContext, aReflowState, aDesiredSize);
// XXX deal with border and padding the usual way...wrap it up!
@ -184,7 +184,7 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext,
nsIView* view;
GetView(view);
if (nsnull == view) {
nsresult rv = CreateWidget(aPresContext, aDesiredSize.width,
nsresult rv = CreateWidget(&aPresContext, aDesiredSize.width,
aDesiredSize.height);
if (NS_OK != rv) {
return rv;

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

@ -64,7 +64,7 @@ void nsPageFrame::CreateFirstChild(nsIPresContext* aPresContext)
}
}
NS_METHOD nsPageFrame::Reflow(nsIPresContext* aPresContext,
NS_METHOD nsPageFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)
@ -95,7 +95,7 @@ NS_METHOD nsPageFrame::Reflow(nsIPresContext* aPresContext,
nsSize maxSize(aReflowState.maxSize.width, NS_UNCONSTRAINEDSIZE);
nsReflowState kidReflowState(mFirstChild, aReflowState, maxSize);
aStatus = ReflowChild(mFirstChild, aPresContext, aDesiredSize, kidReflowState);
aStatus = ReflowChild(mFirstChild, &aPresContext, aDesiredSize, kidReflowState);
// Place and size the child. Make sure the child is at least as
// tall as our max size (the containing window)
@ -111,7 +111,7 @@ NS_METHOD nsPageFrame::Reflow(nsIPresContext* aPresContext,
if (nsnull == mFirstChild) {
if (nsnull == mPrevInFlow) {
// Create the first child frame
CreateFirstChild(aPresContext);
CreateFirstChild(&aPresContext);
} else {
nsPageFrame* prevPage = (nsPageFrame*)mPrevInFlow;
@ -121,8 +121,8 @@ NS_METHOD nsPageFrame::Reflow(nsIPresContext* aPresContext,
// Create a continuing child of the previous page's last child
nsIStyleContext* kidSC;
prevLastChild->GetStyleContext(aPresContext, kidSC);
nsresult rv = prevLastChild->CreateContinuingFrame(aPresContext, this,
prevLastChild->GetStyleContext(&aPresContext, kidSC);
nsresult rv = prevLastChild->CreateContinuingFrame(&aPresContext, this,
kidSC, mFirstChild);
NS_RELEASE(kidSC);
@ -137,8 +137,8 @@ NS_METHOD nsPageFrame::Reflow(nsIPresContext* aPresContext,
nsReflowState kidReflowState(mFirstChild, aReflowState, aReflowState.maxSize);
// Get the child's desired size
mFirstChild->WillReflow(*aPresContext);
aStatus = ReflowChild(mFirstChild, aPresContext, aDesiredSize, kidReflowState);
mFirstChild->WillReflow(aPresContext);
aStatus = ReflowChild(mFirstChild, &aPresContext, aDesiredSize, kidReflowState);
mLastContentIsComplete = NS_FRAME_IS_COMPLETE(aStatus);
// Make sure the child is at least as tall as our max size (the containing window)
@ -149,7 +149,7 @@ NS_METHOD nsPageFrame::Reflow(nsIPresContext* aPresContext,
// Place and size the child
nsRect rect(0, 0, aDesiredSize.width, aDesiredSize.height);
mFirstChild->SetRect(rect);
mFirstChild->DidReflow(*aPresContext, NS_FRAME_REFLOW_FINISHED);
mFirstChild->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED);
// Is the frame complete?
if (NS_FRAME_IS_COMPLETE(aStatus)) {

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

@ -25,7 +25,7 @@ class nsPageFrame : public nsContainerFrame {
public:
nsPageFrame(nsIContent* aContent, nsIFrame* aParent);
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aMaxSize,
nsReflowStatus& aStatus);

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

@ -52,7 +52,7 @@ nsPlaceholderFrame::~nsPlaceholderFrame()
}
NS_IMETHODIMP
nsPlaceholderFrame::Reflow(nsIPresContext* aPresContext,
nsPlaceholderFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)
@ -100,11 +100,11 @@ nsPlaceholderFrame::Reflow(nsIPresContext* aPresContext,
nsBodyFrame::NewFrame(&mAnchoredItem, mContent, this);
// Use our style context for the pseudo-frame
mAnchoredItem->SetStyleContext(aPresContext, mStyleContext);
mAnchoredItem->SetStyleContext(&aPresContext, mStyleContext);
} else {
// Create the anchored item
nsIContentDelegate* delegate = mContent->GetDelegate(aPresContext);
nsresult rv = delegate->CreateFrame(aPresContext, mContent,
nsIContentDelegate* delegate = mContent->GetDelegate(&aPresContext);
nsresult rv = delegate->CreateFrame(&aPresContext, mContent,
mGeometricParent, mStyleContext,
mAnchoredItem);
NS_RELEASE(delegate);
@ -114,7 +114,7 @@ nsPlaceholderFrame::Reflow(nsIPresContext* aPresContext,
}
// Notify our containing block that there's a new floater
container->AddFloater(aPresContext, aReflowState, mAnchoredItem, this);
container->AddFloater(&aPresContext, aReflowState, mAnchoredItem, this);
} else {
// XXX This causes anchored-items sizes to get fixed up; this is
@ -124,12 +124,12 @@ nsPlaceholderFrame::Reflow(nsIPresContext* aPresContext,
nsReflowMetrics desiredSize(nsnull);
nsReflowState reflowState(mAnchoredItem, aReflowState, aReflowState.maxSize,
eReflowReason_Resize);
mAnchoredItem->WillReflow(*aPresContext);
mAnchoredItem->WillReflow(aPresContext);
mAnchoredItem->Reflow(aPresContext, desiredSize, reflowState, aStatus);
mAnchoredItem->SizeTo(desiredSize.width, desiredSize.height);
//XXXdeprecated container->PlaceFloater(aPresContext, mAnchoredItem, this);
mAnchoredItem->DidReflow(*aPresContext, NS_FRAME_REFLOW_FINISHED);
mAnchoredItem->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED);
}
return nsFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);

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

@ -34,7 +34,7 @@ public:
nsIFrame* GetAnchoredItem() const {return mAnchoredItem;}
// nsIFrame overrides
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);

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

@ -49,7 +49,7 @@ nsAbsoluteFrame::~nsAbsoluteFrame()
{
}
NS_IMETHODIMP nsAbsoluteFrame::Reflow(nsIPresContext* aPresContext,
NS_IMETHODIMP nsAbsoluteFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)
@ -61,13 +61,13 @@ NS_IMETHODIMP nsAbsoluteFrame::Reflow(nsIPresContext* aPresContext,
nsBodyFrame::NewFrame(&mFrame, mContent, this);
// Use our style context for the pseudo-frame
mFrame->SetStyleContext(aPresContext, mStyleContext);
mFrame->SetStyleContext(&aPresContext, mStyleContext);
} else {
// Ask the content delegate to create the frame
nsIContentDelegate* delegate = mContent->GetDelegate(aPresContext);
nsIContentDelegate* delegate = mContent->GetDelegate(&aPresContext);
nsresult rv = delegate->CreateFrame(aPresContext, mContent, this,
nsresult rv = delegate->CreateFrame(&aPresContext, mContent, this,
mStyleContext, mFrame);
NS_RELEASE(delegate);
if (NS_OK != rv) {

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

@ -38,7 +38,7 @@ public:
nsIFrame* GetAbsoluteFrame() const {return mFrame;}
// nsIFrame overrides
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);

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

@ -87,7 +87,7 @@ nsBodyFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
/////////////////////////////////////////////////////////////////////////////
// nsIFrame
NS_METHOD nsBodyFrame::Reflow(nsIPresContext* aPresContext,
NS_METHOD nsBodyFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)
@ -106,7 +106,7 @@ NS_METHOD nsBodyFrame::Reflow(nsIPresContext* aPresContext,
}
#endif
//XXX NS_ASSERTION(eReflowReason_Initial == aReflowState.reason, "bad reason");
CreateColumnFrame(aPresContext);
CreateColumnFrame(&aPresContext);
}
else {
//XXX remove this code and uncomment the assertion when the table code plays nice
@ -154,7 +154,7 @@ NS_METHOD nsBodyFrame::Reflow(nsIPresContext* aPresContext,
mySpacing->CalcBorderPaddingFor(this, borderPadding);
// Compute the child frame's max size
nsSize kidMaxSize = GetColumnAvailSpace(aPresContext, borderPadding,
nsSize kidMaxSize = GetColumnAvailSpace(&aPresContext, borderPadding,
aReflowState.maxSize);
mSpaceManager->Translate(borderPadding.left, borderPadding.top);
@ -169,7 +169,7 @@ NS_METHOD nsBodyFrame::Reflow(nsIPresContext* aPresContext,
nsReflowState reflowState(mFirstChild, aReflowState, kidMaxSize);
nsRect desiredRect;
mFirstChild->WillReflow(*aPresContext);
mFirstChild->WillReflow(aPresContext);
mFirstChild->MoveTo(borderPadding.left, borderPadding.top);
mFirstChild->QueryInterface(kIRunaroundIID, (void**)&reflowRunaround);
reflowRunaround->Reflow(aPresContext, mSpaceManager, aDesiredSize,
@ -206,7 +206,7 @@ NS_METHOD nsBodyFrame::Reflow(nsIPresContext* aPresContext,
#endif
// Reflow any absolutely positioned frames that need reflowing
ReflowAbsoluteItems(aPresContext, aReflowState);
ReflowAbsoluteItems(&aPresContext, aReflowState);
// Return our desired size
ComputeDesiredSize(desiredRect, aReflowState.maxSize, borderPadding, aDesiredSize);
@ -535,7 +535,7 @@ void nsBodyFrame::ReflowAbsoluteItems(nsIPresContext* aPresContext,
nsReflowState reflowState(absoluteFrame, aReflowState, availSize,
reflowReason);
nsReflowStatus status;
absoluteFrame->Reflow(aPresContext, desiredSize, reflowState, status);
absoluteFrame->Reflow(*aPresContext, desiredSize, reflowState, status);
// Figure out what size to actually use. If we let the child choose its
// size, then use what the child requested. Otherwise, use the value

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

@ -39,7 +39,7 @@ public:
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);

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

@ -72,7 +72,7 @@ public:
HRuleFrame(nsIContent* aContent,
nsIFrame* aParentFrame);
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);
@ -228,7 +228,7 @@ HRuleFrame::Paint(nsIPresContext& aPresContext,
}
NS_IMETHODIMP
HRuleFrame::Reflow(nsIPresContext* aPresContext,
HRuleFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)
@ -239,13 +239,13 @@ HRuleFrame::Reflow(nsIPresContext* aPresContext,
// and if set use them instead of calling GetDesiredSize.
GetDesiredSize(aPresContext, aReflowState, aDesiredSize);
AddBordersAndPadding(aPresContext, aDesiredSize);
GetDesiredSize(&aPresContext, aReflowState, aDesiredSize);
AddBordersAndPadding(&aPresContext, aDesiredSize);
// HR's do not impact the max-element-size, otherwise tables behave
// badly. This makes sense they are springy.
if (nsnull != aDesiredSize.maxElementSize) {
nscoord onePixel = nscoord(aPresContext->GetPixelsToTwips());
nscoord onePixel = nscoord(aPresContext.GetPixelsToTwips());
aDesiredSize.maxElementSize->width = onePixel;
aDesiredSize.maxElementSize->height = onePixel;
}

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

@ -127,7 +127,7 @@ NS_IMETHODIMP nsHTMLReflowCommand::Dispatch(nsIPresContext& aPresContext,
nsReflowState reflowState(root, *this, aMaxSize);
nsReflowStatus status;
root->Reflow(&aPresContext, aDesiredSize, reflowState, status);
root->Reflow(aPresContext, aDesiredSize, reflowState, status);
}
return NS_OK;

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

@ -50,7 +50,7 @@ NS_METHOD nsLeafFrame::Paint(nsIPresContext& aPresContext,
return NS_OK;
}
NS_METHOD nsLeafFrame::Reflow(nsIPresContext* aPresContext,
NS_METHOD nsLeafFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)
@ -61,8 +61,8 @@ NS_METHOD nsLeafFrame::Reflow(nsIPresContext* aPresContext,
// and if set use them instead of calling GetDesiredSize.
GetDesiredSize(aPresContext, aReflowState, aDesiredSize);
AddBordersAndPadding(aPresContext, aDesiredSize);
GetDesiredSize(&aPresContext, aReflowState, aDesiredSize);
AddBordersAndPadding(&aPresContext, aDesiredSize);
if (nsnull != aDesiredSize.maxElementSize) {
aDesiredSize.maxElementSize->width = aDesiredSize.width;
aDesiredSize.maxElementSize->height = aDesiredSize.height;

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

@ -32,7 +32,7 @@ public:
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect);
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);

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

@ -32,7 +32,7 @@ class nsObjectFrame : public nsObjectFrameSuper {
public:
nsObjectFrame(nsIContent* aContent, nsIFrame* aParentFrame);
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);
@ -170,13 +170,13 @@ nsObjectFrame::GetDesiredSize(nsIPresContext* aPresContext,
}
NS_IMETHODIMP
nsObjectFrame::Reflow(nsIPresContext* aPresContext,
nsObjectFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)
{
// Get our desired size
GetDesiredSize(aPresContext, aReflowState, aDesiredSize);
GetDesiredSize(&aPresContext, aReflowState, aDesiredSize);
// XXX deal with border and padding the usual way...wrap it up!
@ -184,7 +184,7 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext,
nsIView* view;
GetView(view);
if (nsnull == view) {
nsresult rv = CreateWidget(aPresContext, aDesiredSize.width,
nsresult rv = CreateWidget(&aPresContext, aDesiredSize.width,
aDesiredSize.height);
if (NS_OK != rv) {
return rv;

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

@ -64,7 +64,7 @@ void nsPageFrame::CreateFirstChild(nsIPresContext* aPresContext)
}
}
NS_METHOD nsPageFrame::Reflow(nsIPresContext* aPresContext,
NS_METHOD nsPageFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)
@ -95,7 +95,7 @@ NS_METHOD nsPageFrame::Reflow(nsIPresContext* aPresContext,
nsSize maxSize(aReflowState.maxSize.width, NS_UNCONSTRAINEDSIZE);
nsReflowState kidReflowState(mFirstChild, aReflowState, maxSize);
aStatus = ReflowChild(mFirstChild, aPresContext, aDesiredSize, kidReflowState);
aStatus = ReflowChild(mFirstChild, &aPresContext, aDesiredSize, kidReflowState);
// Place and size the child. Make sure the child is at least as
// tall as our max size (the containing window)
@ -111,7 +111,7 @@ NS_METHOD nsPageFrame::Reflow(nsIPresContext* aPresContext,
if (nsnull == mFirstChild) {
if (nsnull == mPrevInFlow) {
// Create the first child frame
CreateFirstChild(aPresContext);
CreateFirstChild(&aPresContext);
} else {
nsPageFrame* prevPage = (nsPageFrame*)mPrevInFlow;
@ -121,8 +121,8 @@ NS_METHOD nsPageFrame::Reflow(nsIPresContext* aPresContext,
// Create a continuing child of the previous page's last child
nsIStyleContext* kidSC;
prevLastChild->GetStyleContext(aPresContext, kidSC);
nsresult rv = prevLastChild->CreateContinuingFrame(aPresContext, this,
prevLastChild->GetStyleContext(&aPresContext, kidSC);
nsresult rv = prevLastChild->CreateContinuingFrame(&aPresContext, this,
kidSC, mFirstChild);
NS_RELEASE(kidSC);
@ -137,8 +137,8 @@ NS_METHOD nsPageFrame::Reflow(nsIPresContext* aPresContext,
nsReflowState kidReflowState(mFirstChild, aReflowState, aReflowState.maxSize);
// Get the child's desired size
mFirstChild->WillReflow(*aPresContext);
aStatus = ReflowChild(mFirstChild, aPresContext, aDesiredSize, kidReflowState);
mFirstChild->WillReflow(aPresContext);
aStatus = ReflowChild(mFirstChild, &aPresContext, aDesiredSize, kidReflowState);
mLastContentIsComplete = NS_FRAME_IS_COMPLETE(aStatus);
// Make sure the child is at least as tall as our max size (the containing window)
@ -149,7 +149,7 @@ NS_METHOD nsPageFrame::Reflow(nsIPresContext* aPresContext,
// Place and size the child
nsRect rect(0, 0, aDesiredSize.width, aDesiredSize.height);
mFirstChild->SetRect(rect);
mFirstChild->DidReflow(*aPresContext, NS_FRAME_REFLOW_FINISHED);
mFirstChild->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED);
// Is the frame complete?
if (NS_FRAME_IS_COMPLETE(aStatus)) {

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

@ -25,7 +25,7 @@ class nsPageFrame : public nsContainerFrame {
public:
nsPageFrame(nsIContent* aContent, nsIFrame* aParent);
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aMaxSize,
nsReflowStatus& aStatus);

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

@ -52,7 +52,7 @@ nsPlaceholderFrame::~nsPlaceholderFrame()
}
NS_IMETHODIMP
nsPlaceholderFrame::Reflow(nsIPresContext* aPresContext,
nsPlaceholderFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)
@ -100,11 +100,11 @@ nsPlaceholderFrame::Reflow(nsIPresContext* aPresContext,
nsBodyFrame::NewFrame(&mAnchoredItem, mContent, this);
// Use our style context for the pseudo-frame
mAnchoredItem->SetStyleContext(aPresContext, mStyleContext);
mAnchoredItem->SetStyleContext(&aPresContext, mStyleContext);
} else {
// Create the anchored item
nsIContentDelegate* delegate = mContent->GetDelegate(aPresContext);
nsresult rv = delegate->CreateFrame(aPresContext, mContent,
nsIContentDelegate* delegate = mContent->GetDelegate(&aPresContext);
nsresult rv = delegate->CreateFrame(&aPresContext, mContent,
mGeometricParent, mStyleContext,
mAnchoredItem);
NS_RELEASE(delegate);
@ -114,7 +114,7 @@ nsPlaceholderFrame::Reflow(nsIPresContext* aPresContext,
}
// Notify our containing block that there's a new floater
container->AddFloater(aPresContext, aReflowState, mAnchoredItem, this);
container->AddFloater(&aPresContext, aReflowState, mAnchoredItem, this);
} else {
// XXX This causes anchored-items sizes to get fixed up; this is
@ -124,12 +124,12 @@ nsPlaceholderFrame::Reflow(nsIPresContext* aPresContext,
nsReflowMetrics desiredSize(nsnull);
nsReflowState reflowState(mAnchoredItem, aReflowState, aReflowState.maxSize,
eReflowReason_Resize);
mAnchoredItem->WillReflow(*aPresContext);
mAnchoredItem->WillReflow(aPresContext);
mAnchoredItem->Reflow(aPresContext, desiredSize, reflowState, aStatus);
mAnchoredItem->SizeTo(desiredSize.width, desiredSize.height);
//XXXdeprecated container->PlaceFloater(aPresContext, mAnchoredItem, this);
mAnchoredItem->DidReflow(*aPresContext, NS_FRAME_REFLOW_FINISHED);
mAnchoredItem->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED);
}
return nsFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);

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

@ -34,7 +34,7 @@ public:
nsIFrame* GetAnchoredItem() const {return mAnchoredItem;}
// nsIFrame overrides
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);

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

@ -41,7 +41,7 @@ class RootFrame : public nsContainerFrame {
public:
RootFrame(nsIContent* aContent);
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);
@ -56,7 +56,7 @@ class RootContentFrame : public nsContainerFrame {
public:
RootContentFrame(nsIContent* aContent, nsIFrame* aParent);
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);
@ -80,7 +80,7 @@ RootFrame::RootFrame(nsIContent* aContent)
{
}
NS_METHOD RootFrame::Reflow(nsIPresContext* aPresContext,
NS_METHOD RootFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)
@ -115,8 +115,8 @@ NS_METHOD RootFrame::Reflow(nsIPresContext* aPresContext,
NS_ASSERTION(eReflowReason_Initial == aReflowState.reason, "unexpected reflow reason");
mFirstChild = new RootContentFrame(mContent, this);
mChildCount = 1;
nsIStyleContext* style = aPresContext->ResolvePseudoStyleContextFor(nsHTMLAtoms::rootContentPseudo, this);
mFirstChild->SetStyleContext(aPresContext,style);
nsIStyleContext* style = aPresContext.ResolvePseudoStyleContextFor(nsHTMLAtoms::rootContentPseudo, this);
mFirstChild->SetStyleContext(&aPresContext,style);
NS_RELEASE(style);
}
}
@ -127,13 +127,13 @@ NS_METHOD RootFrame::Reflow(nsIPresContext* aPresContext,
nsReflowMetrics desiredSize(nsnull);
nsReflowState kidReflowState(mFirstChild, aReflowState, aReflowState.maxSize);
mFirstChild->WillReflow(*aPresContext);
aStatus = ReflowChild(mFirstChild, aPresContext, desiredSize, kidReflowState);
mFirstChild->WillReflow(aPresContext);
aStatus = ReflowChild(mFirstChild, &aPresContext, desiredSize, kidReflowState);
// Place and size the child
nsRect rect(0, 0, desiredSize.width, desiredSize.height);
mFirstChild->SetRect(rect);
mFirstChild->DidReflow(*aPresContext, NS_FRAME_REFLOW_FINISHED);
mFirstChild->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED);
mLastContentOffset = ((RootContentFrame*)mFirstChild)->GetLastContentOffset();
}
@ -289,7 +289,7 @@ void RootContentFrame::CreateFirstChild(nsIPresContext* aPresContext)
// XXX Hack
#define PAGE_SPACING_TWIPS 100
NS_METHOD RootContentFrame::Reflow(nsIPresContext* aPresContext,
NS_METHOD RootContentFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)
@ -321,8 +321,8 @@ NS_METHOD RootContentFrame::Reflow(nsIPresContext* aPresContext,
// Dispatch the reflow command to our child frame. Allow it to be as high
// as it wants
mFirstChild->WillReflow(*aPresContext);
aStatus = ReflowChild(mFirstChild, aPresContext, aDesiredSize, kidReflowState);
mFirstChild->WillReflow(aPresContext);
aStatus = ReflowChild(mFirstChild, &aPresContext, aDesiredSize, kidReflowState);
// Place and size the child. Make sure the child is at least as
// tall as our max size (the containing window)
@ -332,7 +332,7 @@ NS_METHOD RootContentFrame::Reflow(nsIPresContext* aPresContext,
nsRect rect(0, 0, aDesiredSize.width, aDesiredSize.height);
mFirstChild->SetRect(rect);
mFirstChild->DidReflow(*aPresContext, NS_FRAME_REFLOW_FINISHED);
mFirstChild->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED);
} else {
nsReflowReason reflowReason = aReflowState.reason;
@ -341,20 +341,20 @@ NS_METHOD RootContentFrame::Reflow(nsIPresContext* aPresContext,
if (nsnull == mFirstChild) {
// No, create the first child frame
reflowReason = eReflowReason_Initial;
CreateFirstChild(aPresContext);
CreateFirstChild(&aPresContext);
}
// Resize our frames
if (nsnull != mFirstChild) {
if (aPresContext->IsPaginated()) {
if (aPresContext.IsPaginated()) {
nscoord y = PAGE_SPACING_TWIPS;
nsReflowMetrics kidSize(aDesiredSize.maxElementSize);
// Compute the size of each page and the x coordinate within
// ourselves that the pages will be placed at.
nsSize pageSize(aPresContext->GetPageWidth(),
aPresContext->GetPageHeight());
nsIDeviceContext *dx = aPresContext->GetDeviceContext();
nsSize pageSize(aPresContext.GetPageWidth(),
aPresContext.GetPageHeight());
nsIDeviceContext *dx = aPresContext.GetDeviceContext();
PRInt32 extra = aReflowState.maxSize.width - PAGE_SPACING_TWIPS*2 -
pageSize.width - NS_TO_INT_ROUND(dx->GetScrollBarWidth());
NS_RELEASE(dx);
@ -376,12 +376,12 @@ NS_METHOD RootContentFrame::Reflow(nsIPresContext* aPresContext,
// Place and size the page. If the page is narrower than our
// max width then center it horizontally
kidFrame->WillReflow(*aPresContext);
kidFrame->WillReflow(aPresContext);
kidFrame->MoveTo(x, y);
status = ReflowChild(kidFrame, aPresContext, kidSize,
status = ReflowChild(kidFrame, &aPresContext, kidSize,
kidReflowState);
kidFrame->SetRect(nsRect(x, y, kidSize.width, kidSize.height));
kidFrame->DidReflow(*aPresContext, NS_FRAME_REFLOW_FINISHED);
kidFrame->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED);
y += kidSize.height;
// Leave a slight gap between the pages
@ -397,9 +397,9 @@ NS_METHOD RootContentFrame::Reflow(nsIPresContext* aPresContext,
// The page isn't complete and it doesn't have a next-in-flow so
// create a continuing page
nsIStyleContext* kidSC;
kidFrame->GetStyleContext(aPresContext, kidSC);
kidFrame->GetStyleContext(&aPresContext, kidSC);
nsIFrame* continuingPage;
nsresult rv = kidFrame->CreateContinuingFrame(aPresContext, this,
nsresult rv = kidFrame->CreateContinuingFrame(&aPresContext, this,
kidSC, continuingPage);
NS_RELEASE(kidSC);
reflowReason = eReflowReason_Initial;
@ -436,8 +436,8 @@ NS_METHOD RootContentFrame::Reflow(nsIPresContext* aPresContext,
// Get the child's desired size. Our child's desired height is our
// desired size
mFirstChild->WillReflow(*aPresContext);
aStatus = ReflowChild(mFirstChild, aPresContext, aDesiredSize, kidReflowState);
mFirstChild->WillReflow(aPresContext);
aStatus = ReflowChild(mFirstChild, &aPresContext, aDesiredSize, kidReflowState);
NS_ASSERTION(NS_FRAME_IS_COMPLETE(aStatus), "bad status");
// Place and size the child. Make sure the child is at least as
@ -449,7 +449,7 @@ NS_METHOD RootContentFrame::Reflow(nsIPresContext* aPresContext,
// Place and size the child
nsRect rect(0, 0, aDesiredSize.width, aDesiredSize.height);
mFirstChild->SetRect(rect);
mFirstChild->DidReflow(*aPresContext, NS_FRAME_REFLOW_FINISHED);
mFirstChild->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED);
}
}
else {

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

@ -35,7 +35,7 @@ class nsScrollBodyFrame : public nsContainerFrame {
public:
nsScrollBodyFrame(nsIContent* aContent, nsIFrame* aParent);
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);
@ -95,7 +95,7 @@ nsScrollBodyFrame::CreateFirstChild(nsIPresContext* aPresContext)
#define PAGE_SPACING 100
NS_IMETHODIMP
nsScrollBodyFrame::Reflow(nsIPresContext* aPresContext,
nsScrollBodyFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)
@ -130,8 +130,8 @@ nsScrollBodyFrame::Reflow(nsIPresContext* aPresContext,
// Dispatch the reflow command to our child frame. Allow it to be as high
// as it wants
mFirstChild->WillReflow(*aPresContext);
aStatus = ReflowChild(mFirstChild, aPresContext, aDesiredSize, kidReflowState);
mFirstChild->WillReflow(aPresContext);
aStatus = ReflowChild(mFirstChild, &aPresContext, aDesiredSize, kidReflowState);
// Place and size the child. Make sure the child is at least as
// tall as our max size (the containing window)
@ -141,22 +141,22 @@ nsScrollBodyFrame::Reflow(nsIPresContext* aPresContext,
nsRect rect(0, 0, aDesiredSize.width, aDesiredSize.height);
mFirstChild->SetRect(rect);
mFirstChild->DidReflow(*aPresContext, NS_FRAME_REFLOW_FINISHED);
mFirstChild->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED);
} else {
// Do we have any children?
if (nsnull == mFirstChild) {
// No, create the first child frame
CreateFirstChild(aPresContext);
CreateFirstChild(&aPresContext);
}
// Resize our frames
if (nsnull != mFirstChild) {
if (aPresContext->IsPaginated()) {
if (aPresContext.IsPaginated()) {
nscoord y = PAGE_SPACING;
nsReflowMetrics kidSize(aDesiredSize.maxElementSize);
nsSize pageSize(aPresContext->GetPageWidth(),
aPresContext->GetPageHeight());
nsSize pageSize(aPresContext.GetPageWidth(),
aPresContext.GetPageHeight());
// Tile the pages vertically
for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; ) {
@ -166,18 +166,18 @@ nsScrollBodyFrame::Reflow(nsIPresContext* aPresContext,
// Place and size the page. If the page is narrower than our
// max width then center it horizontally
nsIDeviceContext *dx = aPresContext->GetDeviceContext();
nsIDeviceContext *dx = aPresContext.GetDeviceContext();
PRInt32 extra = aReflowState.maxSize.width - kidSize.width -
NS_TO_INT_ROUND(dx->GetScrollBarWidth());
NS_RELEASE(dx);
nscoord x = extra > 0 ? extra / 2 : 0;
kidFrame->WillReflow(*aPresContext);
kidFrame->WillReflow(aPresContext);
kidFrame->MoveTo(x, y);
status = ReflowChild(kidFrame, aPresContext, kidSize, kidReflowState);
status = ReflowChild(kidFrame, &aPresContext, kidSize, kidReflowState);
kidFrame->SetRect(nsRect(x, y, kidSize.width, kidSize.height));
kidFrame->DidReflow(*aPresContext, NS_FRAME_REFLOW_FINISHED);
kidFrame->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED);
y += kidSize.height;
// Leave a slight gap between the pages
@ -193,9 +193,9 @@ nsScrollBodyFrame::Reflow(nsIPresContext* aPresContext,
// The page isn't complete and it doesn't have a next-in-flow so
// create a continuing page
nsIStyleContext* kidSC;
kidFrame->GetStyleContext(aPresContext, kidSC);
kidFrame->GetStyleContext(&aPresContext, kidSC);
nsIFrame* continuingPage;
nsresult rv = kidFrame->CreateContinuingFrame(aPresContext, this,
nsresult rv = kidFrame->CreateContinuingFrame(&aPresContext, this,
kidSC, continuingPage);
NS_RELEASE(kidSC);
@ -226,8 +226,8 @@ nsScrollBodyFrame::Reflow(nsIPresContext* aPresContext,
// Get the child's desired size. Our child's desired height is our
// desired size
mFirstChild->WillReflow(*aPresContext);
aStatus = ReflowChild(mFirstChild, aPresContext, aDesiredSize, kidReflowState);
mFirstChild->WillReflow(aPresContext);
aStatus = ReflowChild(mFirstChild, &aPresContext, aDesiredSize, kidReflowState);
NS_ASSERTION(NS_FRAME_IS_COMPLETE(aStatus), "bad status");
#if 0
@ -241,7 +241,7 @@ nsScrollBodyFrame::Reflow(nsIPresContext* aPresContext,
// Place and size the child
nsRect rect(0, 0, aDesiredSize.width, aDesiredSize.height);
mFirstChild->SetRect(rect);
mFirstChild->DidReflow(*aPresContext, NS_FRAME_REFLOW_FINISHED);
mFirstChild->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED);
}
}
else {
@ -304,7 +304,7 @@ class nsScrollInnerFrame : public nsContainerFrame {
public:
nsScrollInnerFrame(nsIContent* aContent, nsIFrame* aParent);
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);
@ -320,7 +320,7 @@ nsScrollInnerFrame::nsScrollInnerFrame(nsIContent* aContent, nsIFrame* aParent)
}
NS_IMETHODIMP
nsScrollInnerFrame::Reflow(nsIPresContext* aPresContext,
nsScrollInnerFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)
@ -378,7 +378,7 @@ nsScrollInnerFrame::Reflow(nsIPresContext* aPresContext,
// Allow the child frame to be as wide as our max width (minus a
// scroll bar width), and as high as it wants to be.
nsSize maxSize;
nsIDeviceContext* dc = aPresContext->GetDeviceContext();
nsIDeviceContext* dc = aPresContext.GetDeviceContext();
maxSize.width = aReflowState.maxSize.width -
NS_TO_INT_ROUND(dc->GetScrollBarWidth());
NS_RELEASE(dc);
@ -387,15 +387,15 @@ nsScrollInnerFrame::Reflow(nsIPresContext* aPresContext,
// Reflow the child
nsReflowMetrics kidMetrics(aDesiredSize.maxElementSize);
nsReflowState kidReflowState(mFirstChild, aReflowState, maxSize);
mFirstChild->WillReflow(*aPresContext);
aStatus = ReflowChild(mFirstChild, aPresContext, kidMetrics,
mFirstChild->WillReflow(aPresContext);
aStatus = ReflowChild(mFirstChild, &aPresContext, kidMetrics,
kidReflowState);
NS_ASSERTION(NS_FRAME_IS_COMPLETE(aStatus), "bad status");
// Place and size the child
nsRect rect(0, 0, kidMetrics.width, kidMetrics.height);
mFirstChild->SetRect(rect);
mFirstChild->DidReflow(*aPresContext, NS_FRAME_REFLOW_FINISHED);
mFirstChild->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED);
// Determine our size. Our width is our maxWidth and our height is
// either our child's height or our maxHeight if our maxHeight is
@ -436,7 +436,7 @@ class nsScrollOuterFrame : public nsHTMLContainerFrame {
public:
nsScrollOuterFrame(nsIContent* aContent, nsIFrame* aParent);
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);
@ -454,7 +454,7 @@ nsScrollOuterFrame::nsScrollOuterFrame(nsIContent* aContent, nsIFrame* aParent)
//XXX incremental reflow pass through
NS_IMETHODIMP
nsScrollOuterFrame::Reflow(nsIPresContext* aPresContext,
nsScrollOuterFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)
@ -479,7 +479,7 @@ nsScrollOuterFrame::Reflow(nsIPresContext* aPresContext,
// Get style size and determine how much area is available for the
// child (the scroll inner frame) to layout into.
nsSize maxSize, styleSize;
PRIntn sf = nsCSSLayout::GetStyleSize(aPresContext, aReflowState,
PRIntn sf = nsCSSLayout::GetStyleSize(&aPresContext, aReflowState,
styleSize);
if (NS_SIZE_HAS_WIDTH & sf) {
maxSize.width = styleSize.width - lr;
@ -496,8 +496,8 @@ nsScrollOuterFrame::Reflow(nsIPresContext* aPresContext,
// Reflow the child and get its desired size
nsReflowState kidReflowState(mFirstChild, aReflowState, maxSize);
mFirstChild->WillReflow(*aPresContext);
aStatus = ReflowChild(mFirstChild, aPresContext, aDesiredSize,
mFirstChild->WillReflow(aPresContext);
aStatus = ReflowChild(mFirstChild, &aPresContext, aDesiredSize,
kidReflowState);
NS_ASSERTION(NS_FRAME_IS_COMPLETE(aStatus), "bad status");
@ -505,7 +505,7 @@ nsScrollOuterFrame::Reflow(nsIPresContext* aPresContext,
nsRect rect(borderPadding.left, borderPadding.top,
aDesiredSize.width, aDesiredSize.height);
mFirstChild->SetRect(rect);
mFirstChild->DidReflow(*aPresContext, NS_FRAME_REFLOW_FINISHED);
mFirstChild->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED);
// The scroll outer frame either shrink wraps around it's single
// child OR uses the style width/height.

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

@ -108,7 +108,7 @@ public:
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect);
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);
@ -140,7 +140,7 @@ public:
/**
* @see nsIFrame::Reflow
*/
NS_IMETHOD Reflow(nsIPresContext* aCX,
NS_IMETHOD Reflow(nsIPresContext& aCX,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);
@ -284,34 +284,34 @@ nsHTMLIFrameOuterFrame::Paint(nsIPresContext& aPresContext,
}
NS_IMETHODIMP
nsHTMLIFrameOuterFrame::Reflow(nsIPresContext* aPresContext,
nsHTMLIFrameOuterFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)
{
// Always get the size so that the caller knows how big we are
GetDesiredSize(aPresContext, aReflowState, aDesiredSize);
GetDesiredSize(&aPresContext, aReflowState, aDesiredSize);
if (nsnull == mFirstChild) {
mFirstChild = new nsHTMLIFrameInnerFrame(mContent, this);
mChildCount = 1;
}
nscoord borderWidth = GetBorderWidth(*aPresContext);
nscoord borderWidth = GetBorderWidth(aPresContext);
nscoord borderWidth2 = 2 * borderWidth;
nsSize innerSize(aDesiredSize.width - borderWidth2, aDesiredSize.height - borderWidth2);
// Reflow the child and get its desired size
nsReflowState kidReflowState(mFirstChild, aReflowState, innerSize);
mFirstChild->WillReflow(*aPresContext);
mFirstChild->WillReflow(aPresContext);
nsReflowMetrics ignore(nsnull);
aStatus = ReflowChild(mFirstChild, aPresContext, ignore, kidReflowState);
aStatus = ReflowChild(mFirstChild, &aPresContext, ignore, kidReflowState);
NS_ASSERTION(NS_FRAME_IS_COMPLETE(aStatus), "bad status");
// Place and size the child
nsRect rect(borderWidth, borderWidth, innerSize.width, innerSize.height);
mFirstChild->SetRect(rect);
mFirstChild->DidReflow(*aPresContext, NS_FRAME_REFLOW_FINISHED);
mFirstChild->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED);
// XXX what should the max-element-size of an iframe be? Shouldn't
// iframe's normally shrink wrap around their content when they
@ -547,7 +547,7 @@ nsHTMLIFrameInnerFrame::Embed(nsIDocumentWidget* aDocViewer,
}
NS_IMETHODIMP
nsHTMLIFrameInnerFrame::Reflow(nsIPresContext* aPresContext,
nsHTMLIFrameInnerFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)

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

@ -107,7 +107,7 @@ public:
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect);
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);
@ -458,7 +458,7 @@ nsInputButtonFrame::MouseClicked(nsIPresContext* aPresContext)
}
NS_METHOD
nsInputButtonFrame::Reflow(nsIPresContext* aPresContext,
nsInputButtonFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)
@ -466,8 +466,8 @@ nsInputButtonFrame::Reflow(nsIPresContext* aPresContext,
if ((kButtonTag_Input == GetButtonTagType()) &&
(kButton_Image == GetButtonType())) {
nsSize ignore;
GetDesiredSize(aPresContext, aReflowState, aDesiredSize, ignore);
AddBordersAndPadding(aPresContext, aDesiredSize);
GetDesiredSize(&aPresContext, aReflowState, aDesiredSize, ignore);
AddBordersAndPadding(&aPresContext, aDesiredSize);
if (nsnull != aDesiredSize.maxElementSize) {
aDesiredSize.maxElementSize->width = aDesiredSize.width;
aDesiredSize.maxElementSize->height = aDesiredSize.height;

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

@ -148,7 +148,7 @@ nsInputFileFrame::SizeTo(nscoord aWidth, nscoord aHeight)
// XXX hey chris: nsInlineFrame doesn't implement this anymore; this
// needs to be reworked to deal with the new inline frame code
NS_IMETHODIMP nsInputFileFrame::Reflow(nsIPresContext* aCX,
NS_IMETHODIMP nsInputFileFrame::Reflow(nsIPresContext& aCX,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)
@ -162,13 +162,13 @@ NS_IMETHODIMP nsInputFileFrame::Reflow(nsIPresContext* aCX,
NS_ASSERTION(2 == numChildren, "nsInputFile must contain 2 children");
nsInput* childContent;
if (nsnull == mStyleContext) {
GetStyleContext(aCX, mStyleContext);
GetStyleContext(&aCX, mStyleContext);
}
for (int i = 0; i < numChildren; i++) {
childContent = (nsInput *)content->ChildAt(i);
// Use this style context for the children. They will not modify it.
// XXX When IStyleContext provides an api for cloning/inheriting, it could be used instead.
childContent->CreateFrame(aCX, this, mStyleContext, childFrame);
childContent->CreateFrame(&aCX, this, mStyleContext, childFrame);
if (0 == i) {
mFirstChild = childFrame;
PRInt32 contentIndex;

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

@ -31,7 +31,7 @@ class nsString;
class nsInputFileFrame : public nsCSSInlineFrame {
public:
nsInputFileFrame(nsIContent* aContent, nsIFrame* aParentFrame);
NS_IMETHOD Reflow(nsIPresContext* aCX,
NS_IMETHOD Reflow(nsIPresContext& aCX,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);

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

@ -223,7 +223,7 @@ nsInputFrame::DidReflow(nsIPresContext& aPresContext,
}
NS_METHOD
nsInputFrame::Reflow(nsIPresContext* aPresContext,
nsInputFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)
@ -236,7 +236,7 @@ nsInputFrame::Reflow(nsIPresContext* aPresContext,
// make sure the style context is set
if (nsnull == mStyleContext) {
GetStyleContext(aPresContext, mStyleContext);
GetStyleContext(&aPresContext, mStyleContext);
}
nsresult result =
NSRepository::CreateInstance(kViewCID, nsnull, kIViewIID,
@ -246,10 +246,10 @@ nsInputFrame::Reflow(nsIPresContext* aPresContext,
aStatus = NS_FRAME_NOT_COMPLETE;
return result;
}
nsIPresShell *presShell = aPresContext->GetShell(); // need to release
nsIPresShell *presShell = aPresContext.GetShell(); // need to release
nsIViewManager *viewMan = presShell->GetViewManager(); // need to release
GetDesiredSize(aPresContext, aReflowState, aDesiredSize, mWidgetSize);
GetDesiredSize(&aPresContext, aReflowState, aDesiredSize, mWidgetSize);
//nsRect boundBox(0, 0, mWidgetSize.width, mWidgetSize.height);
nsRect boundBox(0, 0, aDesiredSize.width, aDesiredSize.height);
@ -261,7 +261,7 @@ nsInputFrame::Reflow(nsIPresContext* aPresContext,
parWithView->GetView(parView);
const nsIID& id = GetCID();
nsWidgetInitData* initData = GetWidgetInitData(*aPresContext); // needs to be deleted
nsWidgetInitData* initData = GetWidgetInitData(aPresContext); // needs to be deleted
// initialize the view as hidden since we don't know the (x,y) until Paint
result = view->Init(viewMan, boundBox, parView, &id, initData,
nsnull, 0, nsnull,
@ -296,7 +296,7 @@ nsInputFrame::Reflow(nsIPresContext* aPresContext,
NS_IF_RELEASE(presShell);
}
else {
GetDesiredSize(aPresContext, aReflowState, aDesiredSize, mWidgetSize);
GetDesiredSize(&aPresContext, aReflowState, aDesiredSize, mWidgetSize);
// If we are being reflowed and have a view, hide the view until
// we are told to paint (which is when our location will have

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

@ -111,7 +111,7 @@ public:
* Respond to the request to resize and/or reflow
* @see nsIFrame::Reflow
*/
NS_IMETHOD Reflow(nsIPresContext* aCX,
NS_IMETHOD Reflow(nsIPresContext& aCX,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);

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

@ -214,13 +214,11 @@ nsTableFrame* nsTableCellFrame::GetTableFrame()
/**
*/
NS_METHOD nsTableCellFrame::Reflow(nsIPresContext* aPresContext,
NS_METHOD nsTableCellFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)
{
NS_PRECONDITION(nsnull!=aPresContext, "bad arg");
#ifdef NS_DEBUG
//PreReflowCheck();
#endif
@ -269,7 +267,7 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext* aPresContext,
// get frame, creating one if needed
if (nsnull==mFirstChild)
{
CreatePsuedoFrame(aPresContext);
CreatePsuedoFrame(&aPresContext);
}
// reduce available space by insets, if we're in a constrained situation
@ -290,9 +288,9 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext* aPresContext,
kidSize.width=kidSize.height=kidSize.ascent=kidSize.descent=0;
SetPriorAvailWidth(aReflowState.maxSize.width);
nsReflowState kidReflowState(mFirstChild, aReflowState, availSize);
mFirstChild->WillReflow(*aPresContext);
mFirstChild->WillReflow(aPresContext);
mFirstChild->MoveTo(leftInset, topInset);
aStatus = ReflowChild(mFirstChild, aPresContext, kidSize, kidReflowState);
aStatus = ReflowChild(mFirstChild, &aPresContext, kidSize, kidReflowState);
if (PR_TRUE==gsDebug || PR_TRUE==gsDebugNT)
{

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

@ -54,7 +54,7 @@ public:
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect);
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);

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

@ -55,12 +55,11 @@ NS_METHOD nsTableColFrame::Paint(nsIPresContext& aPresContext,
}
NS_METHOD nsTableColFrame::Reflow(nsIPresContext* aPresContext,
NS_METHOD nsTableColFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)
{
NS_ASSERTION(nsnull!=aPresContext, "bad arg");
aDesiredSize.width=0;
aDesiredSize.height=0;
if (nsnull!=aDesiredSize.maxElementSize)

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

@ -34,7 +34,7 @@ public:
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect);
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);

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

@ -52,12 +52,11 @@ NS_METHOD nsTableColGroupFrame::Paint(nsIPresContext& aPresContext,
}
// TODO: content changed notifications
NS_METHOD nsTableColGroupFrame::Reflow(nsIPresContext* aPresContext,
NS_METHOD nsTableColGroupFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)
{
NS_ASSERTION(nsnull!=aPresContext, "bad arg");
NS_ASSERTION(nsnull!=mContent, "bad state -- null content for frame");
if (nsnull == mFirstChild)
@ -76,22 +75,22 @@ NS_METHOD nsTableColGroupFrame::Reflow(nsIPresContext* aPresContext,
// Resolve style
nsIStyleContextPtr kidSC =
aPresContext->ResolveStyleContextFor(kid, this, PR_TRUE);
aPresContext.ResolveStyleContextFor(kid, this, PR_TRUE);
const nsStyleSpacing* kidSpacing = (const nsStyleSpacing*)
kidSC->GetStyleData(eStyleStruct_Spacing);
// Create a child frame
nsIContentDelegate* kidDel = nsnull;
kidDel = kid->GetDelegate(aPresContext);
nsresult rv = kidDel->CreateFrame(aPresContext, kid, this, kidSC,
kidDel = kid->GetDelegate(&aPresContext);
nsresult rv = kidDel->CreateFrame(&aPresContext, kid, this, kidSC,
kidFrame);
NS_RELEASE(kidDel);
// give the child frame a chance to reflow, even though we know it'll have 0 size
nsReflowMetrics kidSize(nsnull);
nsReflowState kidReflowState(kidFrame, aReflowState, nsSize(0,0), eReflowReason_Initial);
kidFrame->WillReflow(*aPresContext);
nsReflowStatus status = ReflowChild(kidFrame,aPresContext, kidSize,
kidFrame->WillReflow(aPresContext);
nsReflowStatus status = ReflowChild(kidFrame,&aPresContext, kidSize,
kidReflowState);
// note that DidReflow is called as the result of some ancestor firing off a DidReflow above me
kidFrame->SetRect(nsRect(0,0,0,0));
@ -111,7 +110,7 @@ NS_METHOD nsTableColGroupFrame::Reflow(nsIPresContext* aPresContext,
kidIndex++;
}
// now that I have all my COL children, adjust their style
SetStyleContextForFirstPass(aPresContext);
SetStyleContextForFirstPass(&aPresContext);
}
aDesiredSize.width=0;
aDesiredSize.height=0;

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

@ -45,7 +45,7 @@ public:
* don't play directly in the rendering game. They do however
* maintain important state that effects table and cell layout.
*/
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);

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

@ -525,7 +525,7 @@ void nsTableFrame::EnsureColumns(nsIPresContext* aPresContext,
lastColGroup->AppendChild (col, PR_FALSE);
}
NS_RELEASE(lastColGroup); // ADDREF: lastColGroup--
lastColGroupFrame->Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
lastColGroupFrame->Reflow(*aPresContext, aDesiredSize, aReflowState, aStatus);
}
}
@ -1136,12 +1136,11 @@ nsresult nsTableFrame::AdjustSiblingsAfterReflow(nsIPresContext* aPresCo
*/
/* Layout the entire inner table. */
NS_METHOD nsTableFrame::Reflow(nsIPresContext* aPresContext,
NS_METHOD nsTableFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)
{
NS_PRECONDITION(nsnull != aPresContext, "null arg");
if (gsDebug==PR_TRUE)
{
printf("-----------------------------------------------------------------\n");
@ -1167,7 +1166,7 @@ NS_METHOD nsTableFrame::Reflow(nsIPresContext* aPresContext,
nsMargin myBorderPadding;
mySpacing->CalcBorderPaddingFor(this, myBorderPadding);
InnerTableReflowState state(aPresContext, aReflowState, myBorderPadding);
InnerTableReflowState state(&aPresContext, aReflowState, myBorderPadding);
nsIFrame* target;
aReflowState.reflowCommand->GetTarget(target);
@ -1187,21 +1186,21 @@ NS_METHOD nsTableFrame::Reflow(nsIPresContext* aPresContext,
nsReflowMetrics desiredSize(nsnull);
// XXX Correctly compute the available space...
nsReflowState kidReflowState(kidFrame, aReflowState, aReflowState.maxSize);
kidFrame->WillReflow(*aPresContext);
aStatus = ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowState);
kidFrame->WillReflow(aPresContext);
aStatus = ReflowChild(kidFrame, &aPresContext, desiredSize, kidReflowState);
// Resize the row group frame
nsRect kidRect;
kidFrame->GetRect(kidRect);
kidFrame->SizeTo(desiredSize.width, desiredSize.height);
#if 1
#if 0
// XXX For the time being just fall through and treat it like a
// pass 2 reflow...
mPass = kPASS_SECOND;
#else
// XXX Hack...
AdjustSiblingsAfterReflow(aPresContext, state, kidFrame, desiredSize.height -
AdjustSiblingsAfterReflow(&aPresContext, state, kidFrame, desiredSize.height -
oldKidRect.height);
aDesiredSize.width = mRect.width;
aDesiredSize.height = state.y + myBorderPadding.top + myBorderPadding.bottom;
@ -1214,22 +1213,22 @@ NS_METHOD nsTableFrame::Reflow(nsIPresContext* aPresContext,
if (PR_FALSE==IsFirstPassValid())
{ // we treat the table as if we've never seen the layout data before
mPass = kPASS_FIRST;
aStatus = ResizeReflowPass1(aPresContext, aDesiredSize, aReflowState, aStatus);
aStatus = ResizeReflowPass1(&aPresContext, aDesiredSize, aReflowState, aStatus);
// check result
}
mPass = kPASS_SECOND;
// assign column widths, and assign aMaxElementSize->width
BalanceColumnWidths(aPresContext, aReflowState, aReflowState.maxSize,
BalanceColumnWidths(&aPresContext, aReflowState, aReflowState.maxSize,
aDesiredSize.maxElementSize);
// assign table width
SetTableWidth(aPresContext);
SetTableWidth(&aPresContext);
// Constrain our reflow width to the computed table width
nsReflowState reflowState(aReflowState);
reflowState.maxSize.width = mRect.width;
aStatus = ResizeReflowPass2(aPresContext, aDesiredSize, reflowState, 0, 0);
aStatus = ResizeReflowPass2(&aPresContext, aDesiredSize, reflowState, 0, 0);
mPass = kPASS_UNDEFINED;
}

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

@ -104,7 +104,7 @@ public:
* @see BalanceColumnWidths
* @see nsIFrame::Reflow
*/
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);

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

@ -282,7 +282,7 @@ nsresult nsTableOuterFrame::IncrementalReflow(nsIPresContext* aPresContext,
kidReflowState.maxSize.width = aState.innerTableMaxSize.width;
}
mInnerTableFrame->SetReflowPass(nsTableFrame::kPASS_INCREMENTAL);
kidFrame->Reflow(aPresContext, kidSize, kidReflowState, aStatus);
kidFrame->Reflow(*aPresContext, kidSize, kidReflowState, aStatus);
// Place the child frame after taking into account its margin
nsRect kidRect (kidMargin.left, aState.y, kidSize.width, kidSize.height);
@ -370,7 +370,7 @@ nscoord nsTableOuterFrame::GetTableWidth(const nsReflowState& aReflowState)
* inner table no longer fits and has to be reflowed again this time with s
* smaller available height
*/
NS_METHOD nsTableOuterFrame::Reflow(nsIPresContext* aPresContext,
NS_METHOD nsTableOuterFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)
@ -392,10 +392,10 @@ NS_METHOD nsTableOuterFrame::Reflow(nsIPresContext* aPresContext,
aStatus = NS_FRAME_COMPLETE;
// Initialize our local reflow state
OuterTableReflowState state(aPresContext, aReflowState);
OuterTableReflowState state(&aPresContext, aReflowState);
if (eReflowReason_Incremental == aReflowState.reason) {
IncrementalReflow(aPresContext, state, aDesiredSize, aReflowState, aStatus);
IncrementalReflow(&aPresContext, state, aDesiredSize, aReflowState, aStatus);
// Return our desired rect
aDesiredSize.width = state.innerTableMaxSize.width;
@ -406,7 +406,7 @@ NS_METHOD nsTableOuterFrame::Reflow(nsIPresContext* aPresContext,
// or there are none so we'll create them now
MoveOverflowToChildList();
if (nsnull == mFirstChild) {
nsresult result = CreateChildFrames(aPresContext);
nsresult result = CreateChildFrames(&aPresContext);
if (NS_OK != result) {
return result;
}
@ -419,7 +419,7 @@ NS_METHOD nsTableOuterFrame::Reflow(nsIPresContext* aPresContext,
nsReflowState captionReflowState(mCaptionFrame, aReflowState,
nsSize(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE),
eReflowReason_Initial);
mCaptionFrame->WillReflow(*aPresContext);
mCaptionFrame->WillReflow(aPresContext);
mCaptionFrame->Reflow(aPresContext, captionSize, captionReflowState, aStatus);
mMinCaptionWidth = maxElementSize.width;
}
@ -444,8 +444,8 @@ NS_METHOD nsTableOuterFrame::Reflow(nsIPresContext* aPresContext,
nsReflowState innerReflowState(mInnerTableFrame, aReflowState,
nsSize(tableWidth, aReflowState.maxSize.height));
nsReflowMetrics innerSize(aDesiredSize.maxElementSize);
mInnerTableFrame->WillReflow(*aPresContext);
aStatus = ReflowChild(mInnerTableFrame, aPresContext, innerSize,
mInnerTableFrame->WillReflow(aPresContext);
aStatus = ReflowChild(mInnerTableFrame, &aPresContext, innerSize,
innerReflowState);
// Table's max element size is the MAX of the caption's max element size
@ -480,7 +480,7 @@ NS_METHOD nsTableOuterFrame::Reflow(nsIPresContext* aPresContext,
nsReflowMetrics captionSize(nsnull);
nsReflowStatus captionStatus;
mCaptionFrame->WillReflow(*aPresContext);
mCaptionFrame->WillReflow(aPresContext);
mCaptionFrame->MoveTo(captionMargin.left, captionY);
mCaptionFrame->Reflow(aPresContext, captionSize, captionReflowState,
captionStatus);

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

@ -54,7 +54,7 @@ public:
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect);
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);

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

@ -795,7 +795,7 @@ nsresult nsTableRowFrame::IncrementalReflow(nsIPresContext* aPresContext,
* This method stacks cells horizontally according to HTML 4.0 rules.
*/
NS_METHOD
nsTableRowFrame::Reflow(nsIPresContext* aPresContext,
nsTableRowFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)
@ -820,7 +820,7 @@ nsTableRowFrame::Reflow(nsIPresContext* aPresContext,
// Initialize our automatic state object
nsTableFrame* tableFrame;
mContentParent->GetContentParent((nsIFrame*&)tableFrame);
RowReflowState state(aPresContext, aReflowState, tableFrame);
RowReflowState state(&aPresContext, aReflowState, tableFrame);
// Do the reflow
nsresult result;
@ -828,17 +828,17 @@ nsTableRowFrame::Reflow(nsIPresContext* aPresContext,
switch (aReflowState.reason) {
case eReflowReason_Initial:
NS_ASSERTION(nsnull == mFirstChild, "unexpected reflow reason");
result = InitialReflow(aPresContext, state, aDesiredSize);
result = InitialReflow(&aPresContext, state, aDesiredSize);
GetMinRowSpan();
FixMinCellHeight();
break;
case eReflowReason_Resize:
result = ResizeReflow(aPresContext, state, aDesiredSize);
result = ResizeReflow(&aPresContext, state, aDesiredSize);
break;
case eReflowReason_Incremental:
result = IncrementalReflow(aPresContext, state, aDesiredSize);
result = IncrementalReflow(&aPresContext, state, aDesiredSize);
break;
}

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

@ -78,7 +78,7 @@ public:
* @see nsTableFrame::BalanceColumnWidths
* @see nsTableFrame::ShrinkWrapChildren
*/
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);

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

@ -1032,7 +1032,7 @@ nsresult nsTableRowGroupFrame::AdjustSiblingsAfterReflow(nsIPresContext* aP
* Rows are responsible for layout of their children.
*/
NS_METHOD
nsTableRowGroupFrame::Reflow(nsIPresContext* aPresContext,
nsTableRowGroupFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)
@ -1050,7 +1050,7 @@ nsTableRowGroupFrame::Reflow(nsIPresContext* aPresContext,
aDesiredSize.maxElementSize->height = 0;
}
RowGroupReflowState state(aPresContext, aReflowState);
RowGroupReflowState state(&aPresContext, aReflowState);
if (eReflowReason_Incremental == aReflowState.reason) {
nsIFrame* target;
@ -1072,8 +1072,8 @@ nsTableRowGroupFrame::Reflow(nsIPresContext* aPresContext,
// XXX Correctly compute the available space...
nsReflowState kidReflowState(kidFrame, aReflowState, aReflowState.maxSize);
nsReflowMetrics desiredSize(nsnull);
kidFrame->WillReflow(*aPresContext);
aStatus = ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowState);
kidFrame->WillReflow(aPresContext);
aStatus = ReflowChild(kidFrame, &aPresContext, desiredSize, kidReflowState);
// Resize the row frame
nsRect kidRect;
@ -1081,7 +1081,7 @@ nsTableRowGroupFrame::Reflow(nsIPresContext* aPresContext,
kidFrame->SizeTo(desiredSize.width, desiredSize.height);
// Adjust the frames that follow...
AdjustSiblingsAfterReflow(aPresContext, state, kidFrame, desiredSize.height -
AdjustSiblingsAfterReflow(&aPresContext, state, kidFrame, desiredSize.height -
oldKidRect.height);
// Return of desired size
@ -1098,7 +1098,7 @@ nsTableRowGroupFrame::Reflow(nsIPresContext* aPresContext,
// Reflow the existing frames
if (nsnull != mFirstChild) {
reflowMappedOK = ReflowMappedChildren(aPresContext, state, aDesiredSize.maxElementSize);
reflowMappedOK = ReflowMappedChildren(&aPresContext, state, aDesiredSize.maxElementSize);
if (PR_FALSE == reflowMappedOK) {
aStatus = NS_FRAME_NOT_COMPLETE;
}
@ -1114,10 +1114,10 @@ nsTableRowGroupFrame::Reflow(nsIPresContext* aPresContext,
}
} else if (NextChildOffset() < mContent->ChildCount()) {
// Try and pull-up some children from a next-in-flow
if (PullUpChildren(aPresContext, state, aDesiredSize.maxElementSize)) {
if (PullUpChildren(&aPresContext, state, aDesiredSize.maxElementSize)) {
// If we still have unmapped children then create some new frames
if (NextChildOffset() < mContent->ChildCount()) {
aStatus = ReflowUnmappedChildren(aPresContext, state, aDesiredSize.maxElementSize);
aStatus = ReflowUnmappedChildren(&aPresContext, state, aDesiredSize.maxElementSize);
}
} else {
// We were unable to pull-up all the existing frames from the
@ -1144,7 +1144,7 @@ nsTableRowGroupFrame::Reflow(nsIPresContext* aPresContext,
aDesiredSize.height = state.y;
// shrink wrap rows to height of tallest cell in that row
ShrinkWrapChildren(aPresContext, aDesiredSize);
ShrinkWrapChildren(&aPresContext, aDesiredSize);
}
#ifdef NS_DEBUG

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

@ -71,7 +71,7 @@ public:
*
* @see nsIFrame::Reflow
*/
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);

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

@ -68,7 +68,7 @@ public:
FixedSizeFrame(nsIContent* aContent,
nsIFrame* aParentFrame);
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);
@ -110,7 +110,7 @@ FixedSizeFrame::FixedSizeFrame(nsIContent* aContent,
{
}
NS_METHOD FixedSizeFrame::Reflow(nsIPresContext* aPresContext,
NS_METHOD FixedSizeFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)

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

@ -214,13 +214,11 @@ nsTableFrame* nsTableCellFrame::GetTableFrame()
/**
*/
NS_METHOD nsTableCellFrame::Reflow(nsIPresContext* aPresContext,
NS_METHOD nsTableCellFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)
{
NS_PRECONDITION(nsnull!=aPresContext, "bad arg");
#ifdef NS_DEBUG
//PreReflowCheck();
#endif
@ -269,7 +267,7 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext* aPresContext,
// get frame, creating one if needed
if (nsnull==mFirstChild)
{
CreatePsuedoFrame(aPresContext);
CreatePsuedoFrame(&aPresContext);
}
// reduce available space by insets, if we're in a constrained situation
@ -290,9 +288,9 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext* aPresContext,
kidSize.width=kidSize.height=kidSize.ascent=kidSize.descent=0;
SetPriorAvailWidth(aReflowState.maxSize.width);
nsReflowState kidReflowState(mFirstChild, aReflowState, availSize);
mFirstChild->WillReflow(*aPresContext);
mFirstChild->WillReflow(aPresContext);
mFirstChild->MoveTo(leftInset, topInset);
aStatus = ReflowChild(mFirstChild, aPresContext, kidSize, kidReflowState);
aStatus = ReflowChild(mFirstChild, &aPresContext, kidSize, kidReflowState);
if (PR_TRUE==gsDebug || PR_TRUE==gsDebugNT)
{

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

@ -54,7 +54,7 @@ public:
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect);
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);

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

@ -55,12 +55,11 @@ NS_METHOD nsTableColFrame::Paint(nsIPresContext& aPresContext,
}
NS_METHOD nsTableColFrame::Reflow(nsIPresContext* aPresContext,
NS_METHOD nsTableColFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)
{
NS_ASSERTION(nsnull!=aPresContext, "bad arg");
aDesiredSize.width=0;
aDesiredSize.height=0;
if (nsnull!=aDesiredSize.maxElementSize)

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

@ -34,7 +34,7 @@ public:
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect);
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);

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

@ -52,12 +52,11 @@ NS_METHOD nsTableColGroupFrame::Paint(nsIPresContext& aPresContext,
}
// TODO: content changed notifications
NS_METHOD nsTableColGroupFrame::Reflow(nsIPresContext* aPresContext,
NS_METHOD nsTableColGroupFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)
{
NS_ASSERTION(nsnull!=aPresContext, "bad arg");
NS_ASSERTION(nsnull!=mContent, "bad state -- null content for frame");
if (nsnull == mFirstChild)
@ -76,22 +75,22 @@ NS_METHOD nsTableColGroupFrame::Reflow(nsIPresContext* aPresContext,
// Resolve style
nsIStyleContextPtr kidSC =
aPresContext->ResolveStyleContextFor(kid, this, PR_TRUE);
aPresContext.ResolveStyleContextFor(kid, this, PR_TRUE);
const nsStyleSpacing* kidSpacing = (const nsStyleSpacing*)
kidSC->GetStyleData(eStyleStruct_Spacing);
// Create a child frame
nsIContentDelegate* kidDel = nsnull;
kidDel = kid->GetDelegate(aPresContext);
nsresult rv = kidDel->CreateFrame(aPresContext, kid, this, kidSC,
kidDel = kid->GetDelegate(&aPresContext);
nsresult rv = kidDel->CreateFrame(&aPresContext, kid, this, kidSC,
kidFrame);
NS_RELEASE(kidDel);
// give the child frame a chance to reflow, even though we know it'll have 0 size
nsReflowMetrics kidSize(nsnull);
nsReflowState kidReflowState(kidFrame, aReflowState, nsSize(0,0), eReflowReason_Initial);
kidFrame->WillReflow(*aPresContext);
nsReflowStatus status = ReflowChild(kidFrame,aPresContext, kidSize,
kidFrame->WillReflow(aPresContext);
nsReflowStatus status = ReflowChild(kidFrame,&aPresContext, kidSize,
kidReflowState);
// note that DidReflow is called as the result of some ancestor firing off a DidReflow above me
kidFrame->SetRect(nsRect(0,0,0,0));
@ -111,7 +110,7 @@ NS_METHOD nsTableColGroupFrame::Reflow(nsIPresContext* aPresContext,
kidIndex++;
}
// now that I have all my COL children, adjust their style
SetStyleContextForFirstPass(aPresContext);
SetStyleContextForFirstPass(&aPresContext);
}
aDesiredSize.width=0;
aDesiredSize.height=0;

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

@ -45,7 +45,7 @@ public:
* don't play directly in the rendering game. They do however
* maintain important state that effects table and cell layout.
*/
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);

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

@ -525,7 +525,7 @@ void nsTableFrame::EnsureColumns(nsIPresContext* aPresContext,
lastColGroup->AppendChild (col, PR_FALSE);
}
NS_RELEASE(lastColGroup); // ADDREF: lastColGroup--
lastColGroupFrame->Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
lastColGroupFrame->Reflow(*aPresContext, aDesiredSize, aReflowState, aStatus);
}
}
@ -1136,12 +1136,11 @@ nsresult nsTableFrame::AdjustSiblingsAfterReflow(nsIPresContext* aPresCo
*/
/* Layout the entire inner table. */
NS_METHOD nsTableFrame::Reflow(nsIPresContext* aPresContext,
NS_METHOD nsTableFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)
{
NS_PRECONDITION(nsnull != aPresContext, "null arg");
if (gsDebug==PR_TRUE)
{
printf("-----------------------------------------------------------------\n");
@ -1167,7 +1166,7 @@ NS_METHOD nsTableFrame::Reflow(nsIPresContext* aPresContext,
nsMargin myBorderPadding;
mySpacing->CalcBorderPaddingFor(this, myBorderPadding);
InnerTableReflowState state(aPresContext, aReflowState, myBorderPadding);
InnerTableReflowState state(&aPresContext, aReflowState, myBorderPadding);
nsIFrame* target;
aReflowState.reflowCommand->GetTarget(target);
@ -1187,21 +1186,21 @@ NS_METHOD nsTableFrame::Reflow(nsIPresContext* aPresContext,
nsReflowMetrics desiredSize(nsnull);
// XXX Correctly compute the available space...
nsReflowState kidReflowState(kidFrame, aReflowState, aReflowState.maxSize);
kidFrame->WillReflow(*aPresContext);
aStatus = ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowState);
kidFrame->WillReflow(aPresContext);
aStatus = ReflowChild(kidFrame, &aPresContext, desiredSize, kidReflowState);
// Resize the row group frame
nsRect kidRect;
kidFrame->GetRect(kidRect);
kidFrame->SizeTo(desiredSize.width, desiredSize.height);
#if 1
#if 0
// XXX For the time being just fall through and treat it like a
// pass 2 reflow...
mPass = kPASS_SECOND;
#else
// XXX Hack...
AdjustSiblingsAfterReflow(aPresContext, state, kidFrame, desiredSize.height -
AdjustSiblingsAfterReflow(&aPresContext, state, kidFrame, desiredSize.height -
oldKidRect.height);
aDesiredSize.width = mRect.width;
aDesiredSize.height = state.y + myBorderPadding.top + myBorderPadding.bottom;
@ -1214,22 +1213,22 @@ NS_METHOD nsTableFrame::Reflow(nsIPresContext* aPresContext,
if (PR_FALSE==IsFirstPassValid())
{ // we treat the table as if we've never seen the layout data before
mPass = kPASS_FIRST;
aStatus = ResizeReflowPass1(aPresContext, aDesiredSize, aReflowState, aStatus);
aStatus = ResizeReflowPass1(&aPresContext, aDesiredSize, aReflowState, aStatus);
// check result
}
mPass = kPASS_SECOND;
// assign column widths, and assign aMaxElementSize->width
BalanceColumnWidths(aPresContext, aReflowState, aReflowState.maxSize,
BalanceColumnWidths(&aPresContext, aReflowState, aReflowState.maxSize,
aDesiredSize.maxElementSize);
// assign table width
SetTableWidth(aPresContext);
SetTableWidth(&aPresContext);
// Constrain our reflow width to the computed table width
nsReflowState reflowState(aReflowState);
reflowState.maxSize.width = mRect.width;
aStatus = ResizeReflowPass2(aPresContext, aDesiredSize, reflowState, 0, 0);
aStatus = ResizeReflowPass2(&aPresContext, aDesiredSize, reflowState, 0, 0);
mPass = kPASS_UNDEFINED;
}

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

@ -104,7 +104,7 @@ public:
* @see BalanceColumnWidths
* @see nsIFrame::Reflow
*/
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);

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

@ -282,7 +282,7 @@ nsresult nsTableOuterFrame::IncrementalReflow(nsIPresContext* aPresContext,
kidReflowState.maxSize.width = aState.innerTableMaxSize.width;
}
mInnerTableFrame->SetReflowPass(nsTableFrame::kPASS_INCREMENTAL);
kidFrame->Reflow(aPresContext, kidSize, kidReflowState, aStatus);
kidFrame->Reflow(*aPresContext, kidSize, kidReflowState, aStatus);
// Place the child frame after taking into account its margin
nsRect kidRect (kidMargin.left, aState.y, kidSize.width, kidSize.height);
@ -370,7 +370,7 @@ nscoord nsTableOuterFrame::GetTableWidth(const nsReflowState& aReflowState)
* inner table no longer fits and has to be reflowed again this time with s
* smaller available height
*/
NS_METHOD nsTableOuterFrame::Reflow(nsIPresContext* aPresContext,
NS_METHOD nsTableOuterFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)
@ -392,10 +392,10 @@ NS_METHOD nsTableOuterFrame::Reflow(nsIPresContext* aPresContext,
aStatus = NS_FRAME_COMPLETE;
// Initialize our local reflow state
OuterTableReflowState state(aPresContext, aReflowState);
OuterTableReflowState state(&aPresContext, aReflowState);
if (eReflowReason_Incremental == aReflowState.reason) {
IncrementalReflow(aPresContext, state, aDesiredSize, aReflowState, aStatus);
IncrementalReflow(&aPresContext, state, aDesiredSize, aReflowState, aStatus);
// Return our desired rect
aDesiredSize.width = state.innerTableMaxSize.width;
@ -406,7 +406,7 @@ NS_METHOD nsTableOuterFrame::Reflow(nsIPresContext* aPresContext,
// or there are none so we'll create them now
MoveOverflowToChildList();
if (nsnull == mFirstChild) {
nsresult result = CreateChildFrames(aPresContext);
nsresult result = CreateChildFrames(&aPresContext);
if (NS_OK != result) {
return result;
}
@ -419,7 +419,7 @@ NS_METHOD nsTableOuterFrame::Reflow(nsIPresContext* aPresContext,
nsReflowState captionReflowState(mCaptionFrame, aReflowState,
nsSize(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE),
eReflowReason_Initial);
mCaptionFrame->WillReflow(*aPresContext);
mCaptionFrame->WillReflow(aPresContext);
mCaptionFrame->Reflow(aPresContext, captionSize, captionReflowState, aStatus);
mMinCaptionWidth = maxElementSize.width;
}
@ -444,8 +444,8 @@ NS_METHOD nsTableOuterFrame::Reflow(nsIPresContext* aPresContext,
nsReflowState innerReflowState(mInnerTableFrame, aReflowState,
nsSize(tableWidth, aReflowState.maxSize.height));
nsReflowMetrics innerSize(aDesiredSize.maxElementSize);
mInnerTableFrame->WillReflow(*aPresContext);
aStatus = ReflowChild(mInnerTableFrame, aPresContext, innerSize,
mInnerTableFrame->WillReflow(aPresContext);
aStatus = ReflowChild(mInnerTableFrame, &aPresContext, innerSize,
innerReflowState);
// Table's max element size is the MAX of the caption's max element size
@ -480,7 +480,7 @@ NS_METHOD nsTableOuterFrame::Reflow(nsIPresContext* aPresContext,
nsReflowMetrics captionSize(nsnull);
nsReflowStatus captionStatus;
mCaptionFrame->WillReflow(*aPresContext);
mCaptionFrame->WillReflow(aPresContext);
mCaptionFrame->MoveTo(captionMargin.left, captionY);
mCaptionFrame->Reflow(aPresContext, captionSize, captionReflowState,
captionStatus);

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

@ -54,7 +54,7 @@ public:
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect);
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);

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

@ -795,7 +795,7 @@ nsresult nsTableRowFrame::IncrementalReflow(nsIPresContext* aPresContext,
* This method stacks cells horizontally according to HTML 4.0 rules.
*/
NS_METHOD
nsTableRowFrame::Reflow(nsIPresContext* aPresContext,
nsTableRowFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)
@ -820,7 +820,7 @@ nsTableRowFrame::Reflow(nsIPresContext* aPresContext,
// Initialize our automatic state object
nsTableFrame* tableFrame;
mContentParent->GetContentParent((nsIFrame*&)tableFrame);
RowReflowState state(aPresContext, aReflowState, tableFrame);
RowReflowState state(&aPresContext, aReflowState, tableFrame);
// Do the reflow
nsresult result;
@ -828,17 +828,17 @@ nsTableRowFrame::Reflow(nsIPresContext* aPresContext,
switch (aReflowState.reason) {
case eReflowReason_Initial:
NS_ASSERTION(nsnull == mFirstChild, "unexpected reflow reason");
result = InitialReflow(aPresContext, state, aDesiredSize);
result = InitialReflow(&aPresContext, state, aDesiredSize);
GetMinRowSpan();
FixMinCellHeight();
break;
case eReflowReason_Resize:
result = ResizeReflow(aPresContext, state, aDesiredSize);
result = ResizeReflow(&aPresContext, state, aDesiredSize);
break;
case eReflowReason_Incremental:
result = IncrementalReflow(aPresContext, state, aDesiredSize);
result = IncrementalReflow(&aPresContext, state, aDesiredSize);
break;
}

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

@ -78,7 +78,7 @@ public:
* @see nsTableFrame::BalanceColumnWidths
* @see nsTableFrame::ShrinkWrapChildren
*/
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);

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

@ -1032,7 +1032,7 @@ nsresult nsTableRowGroupFrame::AdjustSiblingsAfterReflow(nsIPresContext* aP
* Rows are responsible for layout of their children.
*/
NS_METHOD
nsTableRowGroupFrame::Reflow(nsIPresContext* aPresContext,
nsTableRowGroupFrame::Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus)
@ -1050,7 +1050,7 @@ nsTableRowGroupFrame::Reflow(nsIPresContext* aPresContext,
aDesiredSize.maxElementSize->height = 0;
}
RowGroupReflowState state(aPresContext, aReflowState);
RowGroupReflowState state(&aPresContext, aReflowState);
if (eReflowReason_Incremental == aReflowState.reason) {
nsIFrame* target;
@ -1072,8 +1072,8 @@ nsTableRowGroupFrame::Reflow(nsIPresContext* aPresContext,
// XXX Correctly compute the available space...
nsReflowState kidReflowState(kidFrame, aReflowState, aReflowState.maxSize);
nsReflowMetrics desiredSize(nsnull);
kidFrame->WillReflow(*aPresContext);
aStatus = ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowState);
kidFrame->WillReflow(aPresContext);
aStatus = ReflowChild(kidFrame, &aPresContext, desiredSize, kidReflowState);
// Resize the row frame
nsRect kidRect;
@ -1081,7 +1081,7 @@ nsTableRowGroupFrame::Reflow(nsIPresContext* aPresContext,
kidFrame->SizeTo(desiredSize.width, desiredSize.height);
// Adjust the frames that follow...
AdjustSiblingsAfterReflow(aPresContext, state, kidFrame, desiredSize.height -
AdjustSiblingsAfterReflow(&aPresContext, state, kidFrame, desiredSize.height -
oldKidRect.height);
// Return of desired size
@ -1098,7 +1098,7 @@ nsTableRowGroupFrame::Reflow(nsIPresContext* aPresContext,
// Reflow the existing frames
if (nsnull != mFirstChild) {
reflowMappedOK = ReflowMappedChildren(aPresContext, state, aDesiredSize.maxElementSize);
reflowMappedOK = ReflowMappedChildren(&aPresContext, state, aDesiredSize.maxElementSize);
if (PR_FALSE == reflowMappedOK) {
aStatus = NS_FRAME_NOT_COMPLETE;
}
@ -1114,10 +1114,10 @@ nsTableRowGroupFrame::Reflow(nsIPresContext* aPresContext,
}
} else if (NextChildOffset() < mContent->ChildCount()) {
// Try and pull-up some children from a next-in-flow
if (PullUpChildren(aPresContext, state, aDesiredSize.maxElementSize)) {
if (PullUpChildren(&aPresContext, state, aDesiredSize.maxElementSize)) {
// If we still have unmapped children then create some new frames
if (NextChildOffset() < mContent->ChildCount()) {
aStatus = ReflowUnmappedChildren(aPresContext, state, aDesiredSize.maxElementSize);
aStatus = ReflowUnmappedChildren(&aPresContext, state, aDesiredSize.maxElementSize);
}
} else {
// We were unable to pull-up all the existing frames from the
@ -1144,7 +1144,7 @@ nsTableRowGroupFrame::Reflow(nsIPresContext* aPresContext,
aDesiredSize.height = state.y;
// shrink wrap rows to height of tallest cell in that row
ShrinkWrapChildren(aPresContext, aDesiredSize);
ShrinkWrapChildren(&aPresContext, aDesiredSize);
}
#ifdef NS_DEBUG

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

@ -71,7 +71,7 @@ public:
*
* @see nsIFrame::Reflow
*/
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsReflowMetrics& aDesiredSize,
const nsReflowState& aReflowState,
nsReflowStatus& aStatus);