This commit is contained in:
kipp%netscape.com 1998-12-05 16:01:11 +00:00
Родитель f41c946598
Коммит a00a2855e8
8 изменённых файлов: 68 добавлений и 28 удалений

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

@ -71,10 +71,10 @@ nsBlockReflowContext::ComputeMarginsFor(nsIPresContext& aPresContext,
}
nsresult
nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame, const nsRect& aSpace)
nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame, const nsRect& aSpace,
nsReflowStatus& aFrameReflowStatus)
{
nsReflowStatus reflowStatus;
nsresult rv = NS_OK;
mFrame = aFrame;
mSpace = aSpace;
@ -127,8 +127,8 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame, const nsRect& aSpace)
// Let frame know that we are reflowing it
nsIHTMLReflow* htmlReflow;
nsresult rv = aFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow);
if (!NS_SUCCEEDED(rv)) {
rv = aFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow);
if (NS_FAILED(rv)) {
return rv;
}
htmlReflow->WillReflow(mPresContext);
@ -144,7 +144,8 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame, const nsRect& aSpace)
nscoord ty = y - mOuterReflowState.mBorderPadding.top;
aFrame->MoveTo(x, y);
mOuterReflowState.spaceManager->Translate(tx, ty);
htmlReflow->Reflow(mPresContext, mMetrics, reflowState, reflowStatus);
rv = htmlReflow->Reflow(mPresContext, mMetrics, reflowState,
aFrameReflowStatus);
mOuterReflowState.spaceManager->Translate(-tx, -ty);
aFrame->GetFrameState(state);
@ -163,12 +164,12 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame, const nsRect& aSpace)
aFrame->SetFrameState(state & ~NS_FRAME_FIRST_REFLOW);
}
if (!NS_INLINE_IS_BREAK_BEFORE(reflowStatus)) {
if (!NS_INLINE_IS_BREAK_BEFORE(aFrameReflowStatus)) {
// If frame is complete and has a next-in-flow, we need to delete
// them now. Do not do this when a break-before is signaled because
// the frame is going to get reflowed again (and may end up wanting
// a next-in-flow where it ends up).
if (NS_FRAME_IS_COMPLETE(reflowStatus)) {
if (NS_FRAME_IS_COMPLETE(aFrameReflowStatus)) {
nsIFrame* kidNextInFlow;
aFrame->GetNextInFlow(kidNextInFlow);
if (nsnull != kidNextInFlow) {
@ -183,7 +184,7 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame, const nsRect& aSpace)
}
}
return reflowStatus;
return rv;
}
/**

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

@ -47,7 +47,8 @@ public:
mCompactMarginWidth = aCompactMarginWidth;
}
nsresult ReflowBlock(nsIFrame* aFrame, const nsRect& aSpace);
nsresult ReflowBlock(nsIFrame* aFrame, const nsRect& aSpace,
nsReflowStatus& aReflowStatus);
PRBool PlaceBlock(PRBool aForceFit, PRBool aApplyTopMargin,
nscoord aPrevBottomMargin,

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

@ -18,6 +18,8 @@
*/
#include "nsLineBox.h"
#include "nsISpaceManager.h"
#include "nsIStyleContext.h"
#include "nsLineLayout.h"
#include "prprf.h"
nsLineBox::nsLineBox(nsIFrame* aFrame, PRInt32 aCount, PRUint16 flags)
@ -273,3 +275,19 @@ nsLineBox::UnplaceFloaters(nsISpaceManager* aSpaceManager)
}
}
}
#ifdef NS_DEBUG
PRBool
nsLineBox::CheckIsBlock() const
{
nsIFrame* frame = mFirstChild;
const nsStyleDisplay* display;
frame->GetStyleData(eStyleStruct_Display,
(const nsStyleStruct*&) display);
const nsStylePosition* position;
frame->GetStyleData(eStyleStruct_Position,
(const nsStyleStruct*&) position);
PRBool isBlock = nsLineLayout::TreatFrameAsBlock(display, position);
return isBlock == IsBlock();
}
#endif

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

@ -58,12 +58,12 @@ public:
return mCarriedOutBottomMargin;
}
nscoord GetCarriedOutMarginFlags() const {
return 0;/* XXX write me */
}
nscoord GetHeight() const { return mBounds.height; }
#ifdef NS_DEBUG
PRBool CheckIsBlock() const;
#endif
//----------------------------------------------------------------------
// XXX old junk
nsLineBox(nsIFrame* aFrame, PRInt32 aCount, PRUint16 flags);

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

@ -71,10 +71,10 @@ nsBlockReflowContext::ComputeMarginsFor(nsIPresContext& aPresContext,
}
nsresult
nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame, const nsRect& aSpace)
nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame, const nsRect& aSpace,
nsReflowStatus& aFrameReflowStatus)
{
nsReflowStatus reflowStatus;
nsresult rv = NS_OK;
mFrame = aFrame;
mSpace = aSpace;
@ -127,8 +127,8 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame, const nsRect& aSpace)
// Let frame know that we are reflowing it
nsIHTMLReflow* htmlReflow;
nsresult rv = aFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow);
if (!NS_SUCCEEDED(rv)) {
rv = aFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow);
if (NS_FAILED(rv)) {
return rv;
}
htmlReflow->WillReflow(mPresContext);
@ -144,7 +144,8 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame, const nsRect& aSpace)
nscoord ty = y - mOuterReflowState.mBorderPadding.top;
aFrame->MoveTo(x, y);
mOuterReflowState.spaceManager->Translate(tx, ty);
htmlReflow->Reflow(mPresContext, mMetrics, reflowState, reflowStatus);
rv = htmlReflow->Reflow(mPresContext, mMetrics, reflowState,
aFrameReflowStatus);
mOuterReflowState.spaceManager->Translate(-tx, -ty);
aFrame->GetFrameState(state);
@ -163,12 +164,12 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame, const nsRect& aSpace)
aFrame->SetFrameState(state & ~NS_FRAME_FIRST_REFLOW);
}
if (!NS_INLINE_IS_BREAK_BEFORE(reflowStatus)) {
if (!NS_INLINE_IS_BREAK_BEFORE(aFrameReflowStatus)) {
// If frame is complete and has a next-in-flow, we need to delete
// them now. Do not do this when a break-before is signaled because
// the frame is going to get reflowed again (and may end up wanting
// a next-in-flow where it ends up).
if (NS_FRAME_IS_COMPLETE(reflowStatus)) {
if (NS_FRAME_IS_COMPLETE(aFrameReflowStatus)) {
nsIFrame* kidNextInFlow;
aFrame->GetNextInFlow(kidNextInFlow);
if (nsnull != kidNextInFlow) {
@ -183,7 +184,7 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame, const nsRect& aSpace)
}
}
return reflowStatus;
return rv;
}
/**

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

@ -47,7 +47,8 @@ public:
mCompactMarginWidth = aCompactMarginWidth;
}
nsresult ReflowBlock(nsIFrame* aFrame, const nsRect& aSpace);
nsresult ReflowBlock(nsIFrame* aFrame, const nsRect& aSpace,
nsReflowStatus& aReflowStatus);
PRBool PlaceBlock(PRBool aForceFit, PRBool aApplyTopMargin,
nscoord aPrevBottomMargin,

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

@ -18,6 +18,8 @@
*/
#include "nsLineBox.h"
#include "nsISpaceManager.h"
#include "nsIStyleContext.h"
#include "nsLineLayout.h"
#include "prprf.h"
nsLineBox::nsLineBox(nsIFrame* aFrame, PRInt32 aCount, PRUint16 flags)
@ -273,3 +275,19 @@ nsLineBox::UnplaceFloaters(nsISpaceManager* aSpaceManager)
}
}
}
#ifdef NS_DEBUG
PRBool
nsLineBox::CheckIsBlock() const
{
nsIFrame* frame = mFirstChild;
const nsStyleDisplay* display;
frame->GetStyleData(eStyleStruct_Display,
(const nsStyleStruct*&) display);
const nsStylePosition* position;
frame->GetStyleData(eStyleStruct_Position,
(const nsStyleStruct*&) position);
PRBool isBlock = nsLineLayout::TreatFrameAsBlock(display, position);
return isBlock == IsBlock();
}
#endif

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

@ -58,12 +58,12 @@ public:
return mCarriedOutBottomMargin;
}
nscoord GetCarriedOutMarginFlags() const {
return 0;/* XXX write me */
}
nscoord GetHeight() const { return mBounds.height; }
#ifdef NS_DEBUG
PRBool CheckIsBlock() const;
#endif
//----------------------------------------------------------------------
// XXX old junk
nsLineBox(nsIFrame* aFrame, PRInt32 aCount, PRUint16 flags);