Removed skid marks; implement FindTextRuns again

This commit is contained in:
kipp@netscape.com
1998-10-09 23:46:02 +00:00
parent 0b45343351
commit b2c5b6c94e
22 changed files with 184 additions and 432 deletions

View File

@@ -36,10 +36,6 @@ public:
const nsRect& aDirtyRect); const nsRect& aDirtyRect);
// nsIHTMLReflow // nsIHTMLReflow
#if 0
NS_IMETHOD FindTextRuns(nsLineLayout& aLineLayout,
nsIReflowCommand* aReflowCommand);
#endif
NS_IMETHOD Reflow(nsIPresContext& aPresContext, NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize, nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState, const nsHTMLReflowState& aReflowState,
@@ -85,16 +81,6 @@ BRFrame::Paint(nsIPresContext& aPresContext,
return NS_OK; return NS_OK;
} }
#if 0
NS_IMETHODIMP
BRFrame::FindTextRuns(nsLineLayout& aLineLayout,
nsIReflowCommand* aReflowCommand)
{
aLineLayout.EndTextRun();
return NS_OK;
}
#endif
NS_IMETHODIMP NS_IMETHODIMP
BRFrame::Reflow(nsIPresContext& aPresContext, BRFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aMetrics, nsHTMLReflowMetrics& aMetrics,

View File

@@ -314,9 +314,7 @@ public:
nsresult StyleChangedReflow(nsBlockReflowState& aState); nsresult StyleChangedReflow(nsBlockReflowState& aState);
#if 0
nsresult FindTextRuns(nsBlockReflowState& aState); nsresult FindTextRuns(nsBlockReflowState& aState);
#endif
nsresult ChildIncrementalReflow(nsBlockReflowState& aState); nsresult ChildIncrementalReflow(nsBlockReflowState& aState);
@@ -414,10 +412,6 @@ public:
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const; NS_IMETHOD List(FILE* out, PRInt32 aIndent) const;
// nsIHTMLReflow // nsIHTMLReflow
#if 0
NS_IMETHOD FindTextRuns(nsLineLayout& aLineLayout,
nsIReflowCommand* aReflowCommand);
#endif
NS_IMETHOD Reflow(nsIPresContext& aPresContext, NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aMetrics, nsHTMLReflowMetrics& aMetrics,
const nsHTMLReflowState& aReflowState, const nsHTMLReflowState& aReflowState,
@@ -847,16 +841,6 @@ BulletFrame::Reflow(nsIPresContext& aPresContext,
return NS_OK; return NS_OK;
} }
#if 0
NS_IMETHODIMP
BulletFrame::FindTextRuns(nsLineLayout& aLineLayout,
nsIReflowCommand* aReflowCommand)
{
aLineLayout.EndTextRun();
return NS_OK;
}
#endif
//---------------------------------------------------------------------- //----------------------------------------------------------------------
#define LINE_IS_DIRTY 0x1 #define LINE_IS_DIRTY 0x1
@@ -1304,7 +1288,6 @@ nsBlockReflowState::nsBlockReflowState(nsIPresContext& aPresContext,
// coordinate system origin for later. // coordinate system origin for later.
mSpaceManager->Translate(mBorderPadding.left, mBorderPadding.top); mSpaceManager->Translate(mBorderPadding.left, mBorderPadding.top);
mSpaceManager->GetTranslation(mSpaceManagerX, mSpaceManagerY); mSpaceManager->GetTranslation(mSpaceManagerX, mSpaceManagerY);
frame->ListTag(stdout); printf(": BEGIN: BP=%d,%d,%d,%d spaceManager=%d,%d\n", mBorderPadding, mSpaceManagerX, mSpaceManagerY);
mPresContext = aPresContext; mPresContext = aPresContext;
mBlock = (nsBlockFrame*) frame; mBlock = (nsBlockFrame*) frame;
@@ -1371,7 +1354,6 @@ frame->ListTag(stdout); printf(": BEGIN: BP=%d,%d,%d,%d spaceManager=%d,%d\n", m
nsBlockReflowState::~nsBlockReflowState() nsBlockReflowState::~nsBlockReflowState()
{ {
frame->ListTag(stdout); printf(": END\n");
// Restore the coordinate system // Restore the coordinate system
mSpaceManager->Translate(-mBorderPadding.left, -mBorderPadding.top); mSpaceManager->Translate(-mBorderPadding.left, -mBorderPadding.top);
@@ -1415,7 +1397,6 @@ nsBlockReflowState::GetAvailableSpace()
// Compute the bounding rect of the available space, i.e. space // Compute the bounding rect of the available space, i.e. space
// between any left and right floaters. // between any left and right floaters.
mCurrentBand.ComputeAvailSpaceRect(); mCurrentBand.ComputeAvailSpaceRect();
mBlock->ListTag(stdout); printf(": availSpace=%d,%d,%d,%d\n", mCurrentBand.availSpace);
NS_FRAME_LOG(NS_FRAME_TRACE_CALLS, NS_FRAME_LOG(NS_FRAME_TRACE_CALLS,
("nsBlockReflowState::GetAvailableSpace: band={%d,%d,%d,%d} count=%d", ("nsBlockReflowState::GetAvailableSpace: band={%d,%d,%d,%d} count=%d",
@@ -2122,13 +2103,11 @@ nsBlockFrame::AppendNewFrames(nsIPresContext& aPresContext,
nsresult nsresult
nsBlockFrame::InitialReflow(nsBlockReflowState& aState) nsBlockFrame::InitialReflow(nsBlockReflowState& aState)
{ {
#if 0
// Generate text-run information // Generate text-run information
nsresult rv = FindTextRuns(aState); nsresult rv = FindTextRuns(aState);
if (NS_OK != rv) { if (NS_OK != rv) {
return rv; return rv;
} }
#endif
// Reflow everything // Reflow everything
aState.GetAvailableSpace(); aState.GetAvailableSpace();
@@ -2182,13 +2161,11 @@ nsBlockFrame::FrameAppendedReflow(nsBlockReflowState& aState)
// impacted line will be marked dirty // impacted line will be marked dirty
AppendNewFrames(aState.mPresContext, firstAppendedFrame); AppendNewFrames(aState.mPresContext, firstAppendedFrame);
#if 0
// Generate text-run information // Generate text-run information
rv = FindTextRuns(aState); rv = FindTextRuns(aState);
if (NS_OK != rv) { if (NS_OK != rv) {
return rv; return rv;
} }
#endif
// Recover our reflow state // Recover our reflow state
LineData* firstDirtyLine = mLines; LineData* firstDirtyLine = mLines;
@@ -2245,7 +2222,6 @@ nsBlockFrame::FrameAppendedReflow(nsBlockReflowState& aState)
return ReflowLinesAt(aState, firstDirtyLine); return ReflowLinesAt(aState, firstDirtyLine);
} }
#if 0
// XXX keep the text-run data in the first-in-flow of the block // XXX keep the text-run data in the first-in-flow of the block
nsresult nsresult
nsBlockFrame::FindTextRuns(nsBlockReflowState& aState) nsBlockFrame::FindTextRuns(nsBlockReflowState& aState)
@@ -2262,17 +2238,15 @@ nsBlockFrame::FindTextRuns(nsBlockReflowState& aState)
nsIFrame* frame = line->mFirstChild; nsIFrame* frame = line->mFirstChild;
PRInt32 n = line->mChildCount; PRInt32 n = line->mChildCount;
while (--n >= 0) { while (--n >= 0) {
nsIInlineReflow* inlineReflow; nsIHTMLReflow* hr;
if (NS_OK == frame->QueryInterface(kIInlineReflowIID, if (NS_OK == frame->QueryInterface(kIHTMLReflowIID, (void**)&hr)) {
(void**)&inlineReflow)) { nsresult rv = hr->FindTextRuns(aState.mLineLayout);
nsresult rv = inlineReflow->FindTextRuns(aState.mLineLayout,
aState.reflowCommand);
if (NS_OK != rv) { if (NS_OK != rv) {
return rv; return rv;
} }
} }
else { else {
// A frame that doesn't implement nsIInlineReflow isn't text // A frame that doesn't implement nsIHTMLReflow isn't text
// therefore it will end an open text run. // therefore it will end an open text run.
aState.mLineLayout.EndTextRun(); aState.mLineLayout.EndTextRun();
} }
@@ -2293,7 +2267,6 @@ nsBlockFrame::FindTextRuns(nsBlockReflowState& aState)
return NS_OK; return NS_OK;
} }
#endif
nsresult nsresult
nsBlockFrame::FrameInsertedReflow(nsBlockReflowState& aState) nsBlockFrame::FrameInsertedReflow(nsBlockReflowState& aState)

View File

@@ -314,9 +314,7 @@ public:
nsresult StyleChangedReflow(nsBlockReflowState& aState); nsresult StyleChangedReflow(nsBlockReflowState& aState);
#if 0
nsresult FindTextRuns(nsBlockReflowState& aState); nsresult FindTextRuns(nsBlockReflowState& aState);
#endif
nsresult ChildIncrementalReflow(nsBlockReflowState& aState); nsresult ChildIncrementalReflow(nsBlockReflowState& aState);
@@ -414,10 +412,6 @@ public:
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const; NS_IMETHOD List(FILE* out, PRInt32 aIndent) const;
// nsIHTMLReflow // nsIHTMLReflow
#if 0
NS_IMETHOD FindTextRuns(nsLineLayout& aLineLayout,
nsIReflowCommand* aReflowCommand);
#endif
NS_IMETHOD Reflow(nsIPresContext& aPresContext, NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aMetrics, nsHTMLReflowMetrics& aMetrics,
const nsHTMLReflowState& aReflowState, const nsHTMLReflowState& aReflowState,
@@ -847,16 +841,6 @@ BulletFrame::Reflow(nsIPresContext& aPresContext,
return NS_OK; return NS_OK;
} }
#if 0
NS_IMETHODIMP
BulletFrame::FindTextRuns(nsLineLayout& aLineLayout,
nsIReflowCommand* aReflowCommand)
{
aLineLayout.EndTextRun();
return NS_OK;
}
#endif
//---------------------------------------------------------------------- //----------------------------------------------------------------------
#define LINE_IS_DIRTY 0x1 #define LINE_IS_DIRTY 0x1
@@ -1304,7 +1288,6 @@ nsBlockReflowState::nsBlockReflowState(nsIPresContext& aPresContext,
// coordinate system origin for later. // coordinate system origin for later.
mSpaceManager->Translate(mBorderPadding.left, mBorderPadding.top); mSpaceManager->Translate(mBorderPadding.left, mBorderPadding.top);
mSpaceManager->GetTranslation(mSpaceManagerX, mSpaceManagerY); mSpaceManager->GetTranslation(mSpaceManagerX, mSpaceManagerY);
frame->ListTag(stdout); printf(": BEGIN: BP=%d,%d,%d,%d spaceManager=%d,%d\n", mBorderPadding, mSpaceManagerX, mSpaceManagerY);
mPresContext = aPresContext; mPresContext = aPresContext;
mBlock = (nsBlockFrame*) frame; mBlock = (nsBlockFrame*) frame;
@@ -1371,7 +1354,6 @@ frame->ListTag(stdout); printf(": BEGIN: BP=%d,%d,%d,%d spaceManager=%d,%d\n", m
nsBlockReflowState::~nsBlockReflowState() nsBlockReflowState::~nsBlockReflowState()
{ {
frame->ListTag(stdout); printf(": END\n");
// Restore the coordinate system // Restore the coordinate system
mSpaceManager->Translate(-mBorderPadding.left, -mBorderPadding.top); mSpaceManager->Translate(-mBorderPadding.left, -mBorderPadding.top);
@@ -1415,7 +1397,6 @@ nsBlockReflowState::GetAvailableSpace()
// Compute the bounding rect of the available space, i.e. space // Compute the bounding rect of the available space, i.e. space
// between any left and right floaters. // between any left and right floaters.
mCurrentBand.ComputeAvailSpaceRect(); mCurrentBand.ComputeAvailSpaceRect();
mBlock->ListTag(stdout); printf(": availSpace=%d,%d,%d,%d\n", mCurrentBand.availSpace);
NS_FRAME_LOG(NS_FRAME_TRACE_CALLS, NS_FRAME_LOG(NS_FRAME_TRACE_CALLS,
("nsBlockReflowState::GetAvailableSpace: band={%d,%d,%d,%d} count=%d", ("nsBlockReflowState::GetAvailableSpace: band={%d,%d,%d,%d} count=%d",
@@ -2122,13 +2103,11 @@ nsBlockFrame::AppendNewFrames(nsIPresContext& aPresContext,
nsresult nsresult
nsBlockFrame::InitialReflow(nsBlockReflowState& aState) nsBlockFrame::InitialReflow(nsBlockReflowState& aState)
{ {
#if 0
// Generate text-run information // Generate text-run information
nsresult rv = FindTextRuns(aState); nsresult rv = FindTextRuns(aState);
if (NS_OK != rv) { if (NS_OK != rv) {
return rv; return rv;
} }
#endif
// Reflow everything // Reflow everything
aState.GetAvailableSpace(); aState.GetAvailableSpace();
@@ -2182,13 +2161,11 @@ nsBlockFrame::FrameAppendedReflow(nsBlockReflowState& aState)
// impacted line will be marked dirty // impacted line will be marked dirty
AppendNewFrames(aState.mPresContext, firstAppendedFrame); AppendNewFrames(aState.mPresContext, firstAppendedFrame);
#if 0
// Generate text-run information // Generate text-run information
rv = FindTextRuns(aState); rv = FindTextRuns(aState);
if (NS_OK != rv) { if (NS_OK != rv) {
return rv; return rv;
} }
#endif
// Recover our reflow state // Recover our reflow state
LineData* firstDirtyLine = mLines; LineData* firstDirtyLine = mLines;
@@ -2245,7 +2222,6 @@ nsBlockFrame::FrameAppendedReflow(nsBlockReflowState& aState)
return ReflowLinesAt(aState, firstDirtyLine); return ReflowLinesAt(aState, firstDirtyLine);
} }
#if 0
// XXX keep the text-run data in the first-in-flow of the block // XXX keep the text-run data in the first-in-flow of the block
nsresult nsresult
nsBlockFrame::FindTextRuns(nsBlockReflowState& aState) nsBlockFrame::FindTextRuns(nsBlockReflowState& aState)
@@ -2262,17 +2238,15 @@ nsBlockFrame::FindTextRuns(nsBlockReflowState& aState)
nsIFrame* frame = line->mFirstChild; nsIFrame* frame = line->mFirstChild;
PRInt32 n = line->mChildCount; PRInt32 n = line->mChildCount;
while (--n >= 0) { while (--n >= 0) {
nsIInlineReflow* inlineReflow; nsIHTMLReflow* hr;
if (NS_OK == frame->QueryInterface(kIInlineReflowIID, if (NS_OK == frame->QueryInterface(kIHTMLReflowIID, (void**)&hr)) {
(void**)&inlineReflow)) { nsresult rv = hr->FindTextRuns(aState.mLineLayout);
nsresult rv = inlineReflow->FindTextRuns(aState.mLineLayout,
aState.reflowCommand);
if (NS_OK != rv) { if (NS_OK != rv) {
return rv; return rv;
} }
} }
else { else {
// A frame that doesn't implement nsIInlineReflow isn't text // A frame that doesn't implement nsIHTMLReflow isn't text
// therefore it will end an open text run. // therefore it will end an open text run.
aState.mLineLayout.EndTextRun(); aState.mLineLayout.EndTextRun();
} }
@@ -2293,7 +2267,6 @@ nsBlockFrame::FindTextRuns(nsBlockReflowState& aState)
return NS_OK; return NS_OK;
} }
#endif
nsresult nsresult
nsBlockFrame::FrameInsertedReflow(nsBlockReflowState& aState) nsBlockFrame::FrameInsertedReflow(nsBlockReflowState& aState)

View File

@@ -314,9 +314,7 @@ public:
nsresult StyleChangedReflow(nsBlockReflowState& aState); nsresult StyleChangedReflow(nsBlockReflowState& aState);
#if 0
nsresult FindTextRuns(nsBlockReflowState& aState); nsresult FindTextRuns(nsBlockReflowState& aState);
#endif
nsresult ChildIncrementalReflow(nsBlockReflowState& aState); nsresult ChildIncrementalReflow(nsBlockReflowState& aState);
@@ -414,10 +412,6 @@ public:
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const; NS_IMETHOD List(FILE* out, PRInt32 aIndent) const;
// nsIHTMLReflow // nsIHTMLReflow
#if 0
NS_IMETHOD FindTextRuns(nsLineLayout& aLineLayout,
nsIReflowCommand* aReflowCommand);
#endif
NS_IMETHOD Reflow(nsIPresContext& aPresContext, NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aMetrics, nsHTMLReflowMetrics& aMetrics,
const nsHTMLReflowState& aReflowState, const nsHTMLReflowState& aReflowState,
@@ -847,16 +841,6 @@ BulletFrame::Reflow(nsIPresContext& aPresContext,
return NS_OK; return NS_OK;
} }
#if 0
NS_IMETHODIMP
BulletFrame::FindTextRuns(nsLineLayout& aLineLayout,
nsIReflowCommand* aReflowCommand)
{
aLineLayout.EndTextRun();
return NS_OK;
}
#endif
//---------------------------------------------------------------------- //----------------------------------------------------------------------
#define LINE_IS_DIRTY 0x1 #define LINE_IS_DIRTY 0x1
@@ -1304,7 +1288,6 @@ nsBlockReflowState::nsBlockReflowState(nsIPresContext& aPresContext,
// coordinate system origin for later. // coordinate system origin for later.
mSpaceManager->Translate(mBorderPadding.left, mBorderPadding.top); mSpaceManager->Translate(mBorderPadding.left, mBorderPadding.top);
mSpaceManager->GetTranslation(mSpaceManagerX, mSpaceManagerY); mSpaceManager->GetTranslation(mSpaceManagerX, mSpaceManagerY);
frame->ListTag(stdout); printf(": BEGIN: BP=%d,%d,%d,%d spaceManager=%d,%d\n", mBorderPadding, mSpaceManagerX, mSpaceManagerY);
mPresContext = aPresContext; mPresContext = aPresContext;
mBlock = (nsBlockFrame*) frame; mBlock = (nsBlockFrame*) frame;
@@ -1371,7 +1354,6 @@ frame->ListTag(stdout); printf(": BEGIN: BP=%d,%d,%d,%d spaceManager=%d,%d\n", m
nsBlockReflowState::~nsBlockReflowState() nsBlockReflowState::~nsBlockReflowState()
{ {
frame->ListTag(stdout); printf(": END\n");
// Restore the coordinate system // Restore the coordinate system
mSpaceManager->Translate(-mBorderPadding.left, -mBorderPadding.top); mSpaceManager->Translate(-mBorderPadding.left, -mBorderPadding.top);
@@ -1415,7 +1397,6 @@ nsBlockReflowState::GetAvailableSpace()
// Compute the bounding rect of the available space, i.e. space // Compute the bounding rect of the available space, i.e. space
// between any left and right floaters. // between any left and right floaters.
mCurrentBand.ComputeAvailSpaceRect(); mCurrentBand.ComputeAvailSpaceRect();
mBlock->ListTag(stdout); printf(": availSpace=%d,%d,%d,%d\n", mCurrentBand.availSpace);
NS_FRAME_LOG(NS_FRAME_TRACE_CALLS, NS_FRAME_LOG(NS_FRAME_TRACE_CALLS,
("nsBlockReflowState::GetAvailableSpace: band={%d,%d,%d,%d} count=%d", ("nsBlockReflowState::GetAvailableSpace: band={%d,%d,%d,%d} count=%d",
@@ -2122,13 +2103,11 @@ nsBlockFrame::AppendNewFrames(nsIPresContext& aPresContext,
nsresult nsresult
nsBlockFrame::InitialReflow(nsBlockReflowState& aState) nsBlockFrame::InitialReflow(nsBlockReflowState& aState)
{ {
#if 0
// Generate text-run information // Generate text-run information
nsresult rv = FindTextRuns(aState); nsresult rv = FindTextRuns(aState);
if (NS_OK != rv) { if (NS_OK != rv) {
return rv; return rv;
} }
#endif
// Reflow everything // Reflow everything
aState.GetAvailableSpace(); aState.GetAvailableSpace();
@@ -2182,13 +2161,11 @@ nsBlockFrame::FrameAppendedReflow(nsBlockReflowState& aState)
// impacted line will be marked dirty // impacted line will be marked dirty
AppendNewFrames(aState.mPresContext, firstAppendedFrame); AppendNewFrames(aState.mPresContext, firstAppendedFrame);
#if 0
// Generate text-run information // Generate text-run information
rv = FindTextRuns(aState); rv = FindTextRuns(aState);
if (NS_OK != rv) { if (NS_OK != rv) {
return rv; return rv;
} }
#endif
// Recover our reflow state // Recover our reflow state
LineData* firstDirtyLine = mLines; LineData* firstDirtyLine = mLines;
@@ -2245,7 +2222,6 @@ nsBlockFrame::FrameAppendedReflow(nsBlockReflowState& aState)
return ReflowLinesAt(aState, firstDirtyLine); return ReflowLinesAt(aState, firstDirtyLine);
} }
#if 0
// XXX keep the text-run data in the first-in-flow of the block // XXX keep the text-run data in the first-in-flow of the block
nsresult nsresult
nsBlockFrame::FindTextRuns(nsBlockReflowState& aState) nsBlockFrame::FindTextRuns(nsBlockReflowState& aState)
@@ -2262,17 +2238,15 @@ nsBlockFrame::FindTextRuns(nsBlockReflowState& aState)
nsIFrame* frame = line->mFirstChild; nsIFrame* frame = line->mFirstChild;
PRInt32 n = line->mChildCount; PRInt32 n = line->mChildCount;
while (--n >= 0) { while (--n >= 0) {
nsIInlineReflow* inlineReflow; nsIHTMLReflow* hr;
if (NS_OK == frame->QueryInterface(kIInlineReflowIID, if (NS_OK == frame->QueryInterface(kIHTMLReflowIID, (void**)&hr)) {
(void**)&inlineReflow)) { nsresult rv = hr->FindTextRuns(aState.mLineLayout);
nsresult rv = inlineReflow->FindTextRuns(aState.mLineLayout,
aState.reflowCommand);
if (NS_OK != rv) { if (NS_OK != rv) {
return rv; return rv;
} }
} }
else { else {
// A frame that doesn't implement nsIInlineReflow isn't text // A frame that doesn't implement nsIHTMLReflow isn't text
// therefore it will end an open text run. // therefore it will end an open text run.
aState.mLineLayout.EndTextRun(); aState.mLineLayout.EndTextRun();
} }
@@ -2293,7 +2267,6 @@ nsBlockFrame::FindTextRuns(nsBlockReflowState& aState)
return NS_OK; return NS_OK;
} }
#endif
nsresult nsresult
nsBlockFrame::FrameInsertedReflow(nsBlockReflowState& aState) nsBlockFrame::FrameInsertedReflow(nsBlockReflowState& aState)

View File

@@ -16,6 +16,7 @@
* Reserved. * Reserved.
*/ */
#include "nsFrame.h" #include "nsFrame.h"
#include "nsLineLayout.h"
#include "nsIContent.h" #include "nsIContent.h"
#include "nsIAtom.h" #include "nsIAtom.h"
#include "nsString.h" #include "nsString.h"
@@ -303,7 +304,7 @@ NS_IMETHODIMP nsFrame::Init(nsIPresContext& aPresContext, nsIFrame* aChildList)
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::DeleteFrame(nsIPresContext& aPresContext) NS_IMETHODIMP nsFrame::DeleteFrame(nsIPresContext& aPresContext)
{ {
//XXX Why is this done in nsFrame instead of some frame class //XXX Why is this done in nsFrame instead of some frame class
// that actually loads images? // that actually loads images?
@@ -336,7 +337,7 @@ nsFrame::SizeOfWithoutThis(nsISizeOfHandler* aHandler) const
// support // support
} }
NS_METHOD nsFrame::GetContent(nsIContent*& aContent) const NS_IMETHODIMP nsFrame::GetContent(nsIContent*& aContent) const
{ {
if (nsnull != mContent) { if (nsnull != mContent) {
NS_ADDREF(mContent); NS_ADDREF(mContent);
@@ -345,7 +346,7 @@ NS_METHOD nsFrame::GetContent(nsIContent*& aContent) const
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::GetStyleContext(nsIPresContext* aPresContext, NS_IMETHODIMP nsFrame::GetStyleContext(nsIPresContext* aPresContext,
nsIStyleContext*& aStyleContext) nsIStyleContext*& aStyleContext)
{ {
if ((nsnull == mStyleContext) && (nsnull != aPresContext)) { if ((nsnull == mStyleContext) && (nsnull != aPresContext)) {
@@ -359,7 +360,7 @@ NS_METHOD nsFrame::GetStyleContext(nsIPresContext* aPresContext,
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::SetStyleContext(nsIPresContext* aPresContext,nsIStyleContext* aContext) NS_IMETHODIMP nsFrame::SetStyleContext(nsIPresContext* aPresContext,nsIStyleContext* aContext)
{ {
NS_PRECONDITION(nsnull != aContext, "null ptr"); NS_PRECONDITION(nsnull != aContext, "null ptr");
if (aContext != mStyleContext) { if (aContext != mStyleContext) {
@@ -375,12 +376,12 @@ NS_METHOD nsFrame::SetStyleContext(nsIPresContext* aPresContext,nsIStyleContext*
} }
// Subclass hook for style post processing // Subclass hook for style post processing
NS_METHOD nsFrame::DidSetStyleContext(nsIPresContext* aPresContext) NS_IMETHODIMP nsFrame::DidSetStyleContext(nsIPresContext* aPresContext)
{ {
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::GetStyleData(nsStyleStructID aSID, const nsStyleStruct*& aStyleStruct) const NS_IMETHODIMP nsFrame::GetStyleData(nsStyleStructID aSID, const nsStyleStruct*& aStyleStruct) const
{ {
NS_ASSERTION(mStyleContext!=nsnull,"null style context"); NS_ASSERTION(mStyleContext!=nsnull,"null style context");
if (mStyleContext) { if (mStyleContext) {
@@ -393,25 +394,25 @@ NS_METHOD nsFrame::GetStyleData(nsStyleStructID aSID, const nsStyleStruct*& aSty
// Geometric and content parent member functions // Geometric and content parent member functions
NS_METHOD nsFrame::GetContentParent(nsIFrame*& aParent) const NS_IMETHODIMP nsFrame::GetContentParent(nsIFrame*& aParent) const
{ {
aParent = mContentParent; aParent = mContentParent;
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::SetContentParent(const nsIFrame* aParent) NS_IMETHODIMP nsFrame::SetContentParent(const nsIFrame* aParent)
{ {
mContentParent = (nsIFrame*)aParent; mContentParent = (nsIFrame*)aParent;
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::GetGeometricParent(nsIFrame*& aParent) const NS_IMETHODIMP nsFrame::GetGeometricParent(nsIFrame*& aParent) const
{ {
aParent = mGeometricParent; aParent = mGeometricParent;
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::SetGeometricParent(const nsIFrame* aParent) NS_IMETHODIMP nsFrame::SetGeometricParent(const nsIFrame* aParent)
{ {
mGeometricParent = (nsIFrame*)aParent; mGeometricParent = (nsIFrame*)aParent;
return NS_OK; return NS_OK;
@@ -419,34 +420,34 @@ NS_METHOD nsFrame::SetGeometricParent(const nsIFrame* aParent)
// Bounding rect member functions // Bounding rect member functions
NS_METHOD nsFrame::GetRect(nsRect& aRect) const NS_IMETHODIMP nsFrame::GetRect(nsRect& aRect) const
{ {
aRect = mRect; aRect = mRect;
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::GetOrigin(nsPoint& aPoint) const NS_IMETHODIMP nsFrame::GetOrigin(nsPoint& aPoint) const
{ {
aPoint.x = mRect.x; aPoint.x = mRect.x;
aPoint.y = mRect.y; aPoint.y = mRect.y;
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::GetSize(nsSize& aSize) const NS_IMETHODIMP nsFrame::GetSize(nsSize& aSize) const
{ {
aSize.width = mRect.width; aSize.width = mRect.width;
aSize.height = mRect.height; aSize.height = mRect.height;
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::SetRect(const nsRect& aRect) NS_IMETHODIMP nsFrame::SetRect(const nsRect& aRect)
{ {
MoveTo(aRect.x, aRect.y); MoveTo(aRect.x, aRect.y);
SizeTo(aRect.width, aRect.height); SizeTo(aRect.width, aRect.height);
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::MoveTo(nscoord aX, nscoord aY) NS_IMETHODIMP nsFrame::MoveTo(nscoord aX, nscoord aY)
{ {
mRect.x = aX; mRect.x = aX;
mRect.y = aY; mRect.y = aY;
@@ -467,7 +468,7 @@ NS_METHOD nsFrame::MoveTo(nscoord aX, nscoord aY)
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::SizeTo(nscoord aWidth, nscoord aHeight) NS_IMETHODIMP nsFrame::SizeTo(nscoord aWidth, nscoord aHeight)
{ {
mRect.width = aWidth; mRect.width = aWidth;
mRect.height = aHeight; mRect.height = aHeight;
@@ -484,7 +485,7 @@ NS_METHOD nsFrame::SizeTo(nscoord aWidth, nscoord aHeight)
// Child frame enumeration // Child frame enumeration
NS_METHOD nsFrame::FirstChild(nsIFrame*& aFirstChild) const NS_IMETHODIMP nsFrame::FirstChild(nsIFrame*& aFirstChild) const
{ {
aFirstChild = nsnull; aFirstChild = nsnull;
return NS_OK; return NS_OK;
@@ -511,7 +512,7 @@ PRBool nsFrame::DisplaySelection(nsIPresContext& aPresContext, PRBool isOkToTurn
return result; return result;
} }
NS_METHOD nsFrame::Paint(nsIPresContext& aPresContext, NS_IMETHODIMP nsFrame::Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext, nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect) const nsRect& aDirtyRect)
{ {
@@ -571,7 +572,7 @@ NS_METHOD nsFrame::Paint(nsIPresContext& aPresContext,
/** /**
* *
*/ */
NS_METHOD nsFrame::HandleEvent(nsIPresContext& aPresContext, NS_IMETHODIMP nsFrame::HandleEvent(nsIPresContext& aPresContext,
nsGUIEvent* aEvent, nsGUIEvent* aEvent,
nsEventStatus& aEventStatus) nsEventStatus& aEventStatus)
{ {
@@ -618,7 +619,7 @@ NS_METHOD nsFrame::HandleEvent(nsIPresContext& aPresContext,
/** /**
* Handles the Mouse Press Event for the frame * Handles the Mouse Press Event for the frame
*/ */
NS_METHOD nsFrame::HandlePress(nsIPresContext& aPresContext, NS_IMETHODIMP nsFrame::HandlePress(nsIPresContext& aPresContext,
nsGUIEvent* aEvent, nsGUIEvent* aEvent,
nsEventStatus& aEventStatus) nsEventStatus& aEventStatus)
{ {
@@ -804,7 +805,7 @@ NS_METHOD nsFrame::HandlePress(nsIPresContext& aPresContext,
} }
NS_METHOD nsFrame::HandleDrag(nsIPresContext& aPresContext, NS_IMETHODIMP nsFrame::HandleDrag(nsIPresContext& aPresContext,
nsGUIEvent* aEvent, nsGUIEvent* aEvent,
nsEventStatus& aEventStatus) nsEventStatus& aEventStatus)
{ {
@@ -928,7 +929,7 @@ NS_METHOD nsFrame::HandleDrag(nsIPresContext& aPresContext,
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::HandleRelease(nsIPresContext& aPresContext, NS_IMETHODIMP nsFrame::HandleRelease(nsIPresContext& aPresContext,
nsGUIEvent* aEvent, nsGUIEvent* aEvent,
nsEventStatus& aEventStatus) nsEventStatus& aEventStatus)
{ {
@@ -1069,7 +1070,7 @@ void nsFrame::AdjustPointsInSameContent(nsIPresContext& aPresContext,
//} //}
} }
NS_METHOD nsFrame::GetCursorAndContentAt(nsIPresContext& aPresContext, NS_IMETHODIMP nsFrame::GetCursorAndContentAt(nsIPresContext& aPresContext,
const nsPoint& aPoint, const nsPoint& aPoint,
nsIFrame** aFrame, nsIFrame** aFrame,
nsIContent** aContent, nsIContent** aContent,
@@ -1081,14 +1082,14 @@ NS_METHOD nsFrame::GetCursorAndContentAt(nsIPresContext& aPresContext,
} }
// Resize and incremental reflow // Resize and incremental reflow
NS_METHOD NS_IMETHODIMP
nsFrame::GetFrameState(nsFrameState& aResult) nsFrame::GetFrameState(nsFrameState& aResult)
{ {
aResult = mState; aResult = mState;
return NS_OK; return NS_OK;
} }
NS_METHOD NS_IMETHODIMP
nsFrame::SetFrameState(nsFrameState aNewState) nsFrame::SetFrameState(nsFrameState aNewState)
{ {
mState = aNewState; mState = aNewState;
@@ -1097,7 +1098,7 @@ nsFrame::SetFrameState(nsFrameState aNewState)
// nsIHTMLReflow member functions // nsIHTMLReflow member functions
NS_METHOD NS_IMETHODIMP
nsFrame::WillReflow(nsIPresContext& aPresContext) nsFrame::WillReflow(nsIPresContext& aPresContext)
{ {
NS_FRAME_TRACE_MSG(NS_FRAME_TRACE_CALLS, NS_FRAME_TRACE_MSG(NS_FRAME_TRACE_CALLS,
@@ -1106,7 +1107,7 @@ nsFrame::WillReflow(nsIPresContext& aPresContext)
return NS_OK; return NS_OK;
} }
NS_METHOD NS_IMETHODIMP
nsFrame::DidReflow(nsIPresContext& aPresContext, nsFrame::DidReflow(nsIPresContext& aPresContext,
nsDidReflowStatus aStatus) nsDidReflowStatus aStatus)
{ {
@@ -1131,10 +1132,11 @@ nsFrame::DidReflow(nsIPresContext& aPresContext,
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::Reflow(nsIPresContext& aPresContext, NS_IMETHODIMP
nsHTMLReflowMetrics& aDesiredSize, nsFrame::Reflow(nsIPresContext& aPresContext,
const nsHTMLReflowState& aReflowState, nsHTMLReflowMetrics& aDesiredSize,
nsReflowStatus& aStatus) const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{ {
aDesiredSize.width = 0; aDesiredSize.width = 0;
aDesiredSize.height = 0; aDesiredSize.height = 0;
@@ -1153,8 +1155,9 @@ NS_METHOD nsFrame::Reflow(nsIPresContext& aPresContext,
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::GetReflowMetrics(nsIPresContext& aPresContext, NS_IMETHODIMP
nsHTMLReflowMetrics& aMetrics) nsFrame::GetReflowMetrics(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aMetrics)
{ {
aMetrics.width = mRect.width; aMetrics.width = mRect.width;
aMetrics.height = mRect.height; aMetrics.height = mRect.height;
@@ -1163,7 +1166,14 @@ NS_METHOD nsFrame::GetReflowMetrics(nsIPresContext& aPresContext,
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::ContentChanged(nsIPresContext* aPresContext, NS_IMETHODIMP
nsFrame::FindTextRuns(nsLineLayout& aLineLayout)
{
aLineLayout.EndTextRun();
return NS_OK;
}
NS_IMETHODIMP nsFrame::ContentChanged(nsIPresContext* aPresContext,
nsIContent* aChild, nsIContent* aChild,
nsISupports* aSubContent) nsISupports* aSubContent)
{ {
@@ -1180,13 +1190,13 @@ NS_IMETHODIMP nsFrame::AttributeChanged(nsIPresContext* aPresContext,
// Flow member functions // Flow member functions
NS_METHOD nsFrame::IsSplittable(nsSplittableType& aIsSplittable) const NS_IMETHODIMP nsFrame::IsSplittable(nsSplittableType& aIsSplittable) const
{ {
aIsSplittable = NS_FRAME_NOT_SPLITTABLE; aIsSplittable = NS_FRAME_NOT_SPLITTABLE;
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::CreateContinuingFrame(nsIPresContext& aPresContext, NS_IMETHODIMP nsFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
nsIFrame* aParent, nsIFrame* aParent,
nsIStyleContext* aStyleContext, nsIStyleContext* aStyleContext,
nsIFrame*& aContinuingFrame) nsIFrame*& aContinuingFrame)
@@ -1196,68 +1206,68 @@ NS_METHOD nsFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
return NS_ERROR_NOT_IMPLEMENTED; return NS_ERROR_NOT_IMPLEMENTED;
} }
NS_METHOD nsFrame::GetPrevInFlow(nsIFrame*& aPrevInFlow) const NS_IMETHODIMP nsFrame::GetPrevInFlow(nsIFrame*& aPrevInFlow) const
{ {
aPrevInFlow = nsnull; aPrevInFlow = nsnull;
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::SetPrevInFlow(nsIFrame*) NS_IMETHODIMP nsFrame::SetPrevInFlow(nsIFrame*)
{ {
NS_ERROR("not splittable"); NS_ERROR("not splittable");
return NS_ERROR_NOT_IMPLEMENTED; return NS_ERROR_NOT_IMPLEMENTED;
} }
NS_METHOD nsFrame::GetNextInFlow(nsIFrame*& aNextInFlow) const NS_IMETHODIMP nsFrame::GetNextInFlow(nsIFrame*& aNextInFlow) const
{ {
aNextInFlow = nsnull; aNextInFlow = nsnull;
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::SetNextInFlow(nsIFrame*) NS_IMETHODIMP nsFrame::SetNextInFlow(nsIFrame*)
{ {
NS_ERROR("not splittable"); NS_ERROR("not splittable");
return NS_ERROR_NOT_IMPLEMENTED; return NS_ERROR_NOT_IMPLEMENTED;
} }
NS_METHOD nsFrame::AppendToFlow(nsIFrame* aAfterFrame) NS_IMETHODIMP nsFrame::AppendToFlow(nsIFrame* aAfterFrame)
{ {
NS_ERROR("not splittable"); NS_ERROR("not splittable");
return NS_ERROR_NOT_IMPLEMENTED; return NS_ERROR_NOT_IMPLEMENTED;
} }
NS_METHOD nsFrame::PrependToFlow(nsIFrame* aBeforeFrame) NS_IMETHODIMP nsFrame::PrependToFlow(nsIFrame* aBeforeFrame)
{ {
NS_ERROR("not splittable"); NS_ERROR("not splittable");
return NS_ERROR_NOT_IMPLEMENTED; return NS_ERROR_NOT_IMPLEMENTED;
} }
NS_METHOD nsFrame::RemoveFromFlow() NS_IMETHODIMP nsFrame::RemoveFromFlow()
{ {
NS_ERROR("not splittable"); NS_ERROR("not splittable");
return NS_ERROR_NOT_IMPLEMENTED; return NS_ERROR_NOT_IMPLEMENTED;
} }
NS_METHOD nsFrame::BreakFromPrevFlow() NS_IMETHODIMP nsFrame::BreakFromPrevFlow()
{ {
NS_ERROR("not splittable"); NS_ERROR("not splittable");
return NS_ERROR_NOT_IMPLEMENTED; return NS_ERROR_NOT_IMPLEMENTED;
} }
NS_METHOD nsFrame::BreakFromNextFlow() NS_IMETHODIMP nsFrame::BreakFromNextFlow()
{ {
NS_ERROR("not splittable"); NS_ERROR("not splittable");
return NS_ERROR_NOT_IMPLEMENTED; return NS_ERROR_NOT_IMPLEMENTED;
} }
// Associated view object // Associated view object
NS_METHOD nsFrame::GetView(nsIView*& aView) const NS_IMETHODIMP nsFrame::GetView(nsIView*& aView) const
{ {
aView = mView; aView = mView;
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::SetView(nsIView* aView) NS_IMETHODIMP nsFrame::SetView(nsIView* aView)
{ {
nsresult rv; nsresult rv;
@@ -1273,7 +1283,7 @@ NS_METHOD nsFrame::SetView(nsIView* aView)
} }
// Find the first geometric parent that has a view // Find the first geometric parent that has a view
NS_METHOD nsFrame::GetParentWithView(nsIFrame*& aParent) const NS_IMETHODIMP nsFrame::GetParentWithView(nsIFrame*& aParent) const
{ {
aParent = mGeometricParent; aParent = mGeometricParent;
@@ -1292,7 +1302,7 @@ NS_METHOD nsFrame::GetParentWithView(nsIFrame*& aParent) const
// Returns the offset from this frame to the closest geometric parent that // Returns the offset from this frame to the closest geometric parent that
// has a view. Also returns the containing view or null in case of error // has a view. Also returns the containing view or null in case of error
NS_METHOD nsFrame::GetOffsetFromView(nsPoint& aOffset, nsIView*& aView) const NS_IMETHODIMP nsFrame::GetOffsetFromView(nsPoint& aOffset, nsIView*& aView) const
{ {
nsIFrame* frame = (nsIFrame*)this; nsIFrame* frame = (nsIFrame*)this;
@@ -1311,7 +1321,7 @@ NS_METHOD nsFrame::GetOffsetFromView(nsPoint& aOffset, nsIView*& aView) const
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::GetWindow(nsIWidget*& aWindow) const NS_IMETHODIMP nsFrame::GetWindow(nsIWidget*& aWindow) const
{ {
nsIFrame* frame = (nsIFrame*)this; nsIFrame* frame = (nsIFrame*)this;
@@ -1359,7 +1369,7 @@ nsFrame::Invalidate(const nsRect& aDamageRect,
} }
// Style sizing methods // Style sizing methods
NS_METHOD nsFrame::IsPercentageBase(PRBool& aBase) const NS_IMETHODIMP nsFrame::IsPercentageBase(PRBool& aBase) const
{ {
const nsStylePosition* position; const nsStylePosition* position;
GetStyleData(eStyleStruct_Position, (const nsStyleStruct*&)position); GetStyleData(eStyleStruct_Position, (const nsStyleStruct*&)position);
@@ -1380,7 +1390,7 @@ NS_METHOD nsFrame::IsPercentageBase(PRBool& aBase) const
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::GetAutoMarginSize(PRUint8 aSide, nscoord& aSize) const NS_IMETHODIMP nsFrame::GetAutoMarginSize(PRUint8 aSide, nscoord& aSize) const
{ {
aSize = 0; // XXX probably not right, subclass override? aSize = 0; // XXX probably not right, subclass override?
return NS_OK; return NS_OK;
@@ -1389,27 +1399,27 @@ NS_METHOD nsFrame::GetAutoMarginSize(PRUint8 aSide, nscoord& aSize) const
// Sibling pointer used to link together frames // Sibling pointer used to link together frames
NS_METHOD nsFrame::GetNextSibling(nsIFrame*& aNextSibling) const NS_IMETHODIMP nsFrame::GetNextSibling(nsIFrame*& aNextSibling) const
{ {
aNextSibling = mNextSibling; aNextSibling = mNextSibling;
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::SetNextSibling(nsIFrame* aNextSibling) NS_IMETHODIMP nsFrame::SetNextSibling(nsIFrame* aNextSibling)
{ {
mNextSibling = aNextSibling; mNextSibling = aNextSibling;
return NS_OK; return NS_OK;
} }
// Transparency query // Transparency query
NS_METHOD nsFrame::IsTransparent(PRBool& aTransparent) const NS_IMETHODIMP nsFrame::IsTransparent(PRBool& aTransparent) const
{ {
//XXX this needs to be overridden in just about every leaf class? MMP //XXX this needs to be overridden in just about every leaf class? MMP
aTransparent = PR_TRUE; aTransparent = PR_TRUE;
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::Scrolled(nsIView *aView) NS_IMETHODIMP nsFrame::Scrolled(nsIView *aView)
{ {
return NS_OK; return NS_OK;
} }
@@ -1435,7 +1445,7 @@ PRInt32 nsFrame::ContentIndexInContainer(const nsIFrame* aFrame)
} }
// Debugging // Debugging
NS_METHOD nsFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const NS_IMETHODIMP nsFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const
{ {
// if a filter is present, only output this frame if the filter says we should // if a filter is present, only output this frame if the filter says we should
nsIAtom* tag; nsIAtom* tag;
@@ -1467,7 +1477,7 @@ NS_METHOD nsFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) cons
} }
// Output the frame's tag // Output the frame's tag
NS_METHOD nsFrame::ListTag(FILE* out) const NS_IMETHODIMP nsFrame::ListTag(FILE* out) const
{ {
nsIAtom* tag; nsIAtom* tag;
mContent->GetTag(tag); mContent->GetTag(tag);
@@ -1482,7 +1492,7 @@ NS_METHOD nsFrame::ListTag(FILE* out) const
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::VerifyTree() const NS_IMETHODIMP nsFrame::VerifyTree() const
{ {
NS_ASSERTION(0 == (mState & NS_FRAME_IN_REFLOW), "frame is in reflow"); NS_ASSERTION(0 == (mState & NS_FRAME_IN_REFLOW), "frame is in reflow");
return NS_OK; return NS_OK;

View File

@@ -187,6 +187,7 @@ public:
nsDidReflowStatus aStatus); nsDidReflowStatus aStatus);
NS_IMETHOD GetReflowMetrics(nsIPresContext& aPresContext, NS_IMETHOD GetReflowMetrics(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aMetrics); nsHTMLReflowMetrics& aMetrics);
NS_IMETHOD FindTextRuns(nsLineLayout& aLineLayout);
// Selection Methods // Selection Methods
// XXX Doc me... // XXX Doc me...

View File

@@ -68,10 +68,7 @@ public:
nsIFrame*& aContinuingFrame); nsIFrame*& aContinuingFrame);
// nsIHTMLReflow // nsIHTMLReflow
#if 0 NS_IMETHOD FindTextRuns(nsLineLayout& aLineLayout);
NS_IMETHOD FindTextRuns(nsLineLayout& aLineLayout,
nsIReflowCommand* aReflowCommand);
#endif
NS_IMETHOD Reflow(nsIPresContext& aPresContext, NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize, nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState, const nsHTMLReflowState& aReflowState,
@@ -237,10 +234,8 @@ nsInlineFrame::CreateContinuingFrame(nsIPresContext& aCX,
return NS_OK; return NS_OK;
} }
#if 0
NS_IMETHODIMP NS_IMETHODIMP
nsInlineFrame::FindTextRuns(nsLineLayout& aLineLayout, nsInlineFrame::FindTextRuns(nsLineLayout& aLineLayout)
nsIReflowCommand* aReflowCommand)
{ {
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS, NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
("enter nsInlineFrame::FindTextRuns")); ("enter nsInlineFrame::FindTextRuns"));
@@ -252,16 +247,15 @@ nsInlineFrame::FindTextRuns(nsLineLayout& aLineLayout,
// Ask each child frame for its text runs // Ask each child frame for its text runs
nsIFrame* frame = mFirstChild; nsIFrame* frame = mFirstChild;
while (nsnull != frame) { while (nsnull != frame) {
nsIInlineReflow* inlineReflow; nsIHTMLReflow* hr;
if (NS_OK == frame->QueryInterface(kIInlineReflowIID, if (NS_OK == frame->QueryInterface(kIHTMLReflowIID, (void**)&hr)) {
(void**)&inlineReflow)) { rv = hr->FindTextRuns(aLineLayout);
rv = inlineReflow->FindTextRuns(aLineLayout, aReflowCommand);
if (NS_OK != rv) { if (NS_OK != rv) {
return rv; return rv;
} }
} }
else { else {
// A frame that doesn't implement nsIInlineReflow isn't text // A frame that doesn't implement nsIHTMLReflow isn't text
// therefore it will end an open text run. // therefore it will end an open text run.
aLineLayout.EndTextRun(); aLineLayout.EndTextRun();
} }
@@ -272,7 +266,6 @@ nsInlineFrame::FindTextRuns(nsLineLayout& aLineLayout,
("exit nsInlineFrame::FindTextRuns rv=%x", rv)); ("exit nsInlineFrame::FindTextRuns rv=%x", rv));
return rv; return rv;
} }
#endif
void void
nsInlineFrame::InsertNewFrame(nsIPresContext& aPresContext, nsInlineFrame::InsertNewFrame(nsIPresContext& aPresContext,
@@ -352,7 +345,6 @@ nsInlineFrame::Reflow(nsIPresContext& aPresContext,
NS_ASSERTION(nsnull != aReflowState.spaceManager, "no space manager"); NS_ASSERTION(nsnull != aReflowState.spaceManager, "no space manager");
aReflowState.spaceManager->Translate(state.mBorderPadding.left, aReflowState.spaceManager->Translate(state.mBorderPadding.left,
state.mBorderPadding.top); state.mBorderPadding.top);
nscoord sx, sy; aReflowState.spaceManager->GetTranslation(sx, sy); ListTag(stdout); printf(": BEGIN: BP=%d,%d,%d,%d spaceManager=%d,%d\n", state.mBorderPadding, sx, sy);
// Based on the type of reflow, switch out to the appropriate // Based on the type of reflow, switch out to the appropriate
// routine. // routine.
@@ -413,13 +405,11 @@ nscoord sx, sy; aReflowState.spaceManager->GetTranslation(sx, sy); ListTag(stdou
aStatus = ResizeReflow(state, inlineReflow); aStatus = ResizeReflow(state, inlineReflow);
} }
ComputeFinalSize(state, inlineReflow, aMetrics); ComputeFinalSize(state, inlineReflow, aMetrics);
// ListTag(stdout); printf(": exit carriedMargins=%d,%d\n", aMetrics.mCarriedOutTopMargin, aMetrics.mCarriedOutBottomMargin);
// Now translate in by our border and padding // Now translate in by our border and padding
aReflowState.lineLayout->PopInline(); aReflowState.lineLayout->PopInline();
aReflowState.spaceManager->Translate(-state.mBorderPadding.left, aReflowState.spaceManager->Translate(-state.mBorderPadding.left,
-state.mBorderPadding.top); -state.mBorderPadding.top);
ListTag(stdout); printf(": END\n");
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS, NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
("exit nsInlineFrame::InlineReflow size=%d,%d status=%x nif=%p", ("exit nsInlineFrame::InlineReflow size=%d,%d status=%x nif=%p",
@@ -771,7 +761,6 @@ nsInlineFrame::ReflowFrame(nsInlineReflowState& aState,
} }
} }
ListTag(stdout); printf(": child="); aFrame->ListTag(stdout); printf(": reflowStatus=%x\n", aReflowStatus);
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS, NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
("nsInlineFrame::ReflowMapped: frame=%p reflowStatus=%x", ("nsInlineFrame::ReflowMapped: frame=%p reflowStatus=%x",
aFrame, aReflowStatus)); aFrame, aReflowStatus));

View File

@@ -56,16 +56,6 @@ nsPlaceholderFrame::~nsPlaceholderFrame()
{ {
} }
#if 0
NS_IMETHODIMP
nsPlaceholderFrame::FindTextRuns(nsLineLayout& aLineLayout,
nsIReflowCommand* aReflowCommand)
{
aLineLayout.EndTextRun();
return NS_OK;
}
#endif
NS_IMETHODIMP NS_IMETHODIMP
nsPlaceholderFrame::Reflow(nsIPresContext& aPresContext, nsPlaceholderFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize, nsHTMLReflowMetrics& aDesiredSize,

View File

@@ -37,10 +37,6 @@ public:
SpacerFrame(nsIContent* aContent, nsIFrame* aParentFrame); SpacerFrame(nsIContent* aContent, nsIFrame* aParentFrame);
// nsIHTMLReflow // nsIHTMLReflow
#if 0
NS_IMETHOD FindTextRuns(nsLineLayout& aLineLayout,
nsIReflowCommand* aReflowCommand);
#endif
NS_IMETHOD Reflow(nsIPresContext& aPresContext, NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize, nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState, const nsHTMLReflowState& aReflowState,
@@ -150,16 +146,6 @@ SpacerFrame::Reflow(nsIPresContext& aPresContext,
return NS_OK; return NS_OK;
} }
#if 0
NS_IMETHODIMP
SpacerFrame::FindTextRuns(nsLineLayout& aLineLayout,
nsIReflowCommand* aReflowCommand)
{
aLineLayout.EndTextRun();
return NS_OK;
}
#endif
PRUint8 PRUint8
SpacerFrame::GetType() SpacerFrame::GetType()
{ {

View File

@@ -145,10 +145,7 @@ public:
PRInt32& aOffset); PRInt32& aOffset);
// nsIHTMLReflow // nsIHTMLReflow
#if 0 NS_IMETHOD FindTextRuns(nsLineLayout& aLineLayout);
NS_IMETHOD FindTextRuns(nsLineLayout& aLineLayout,
nsIReflowCommand* aReflowCommand);
#endif
NS_IMETHOD Reflow(nsIPresContext& aPresContext, NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aMetrics, nsHTMLReflowMetrics& aMetrics,
const nsHTMLReflowState& aReflowState, const nsHTMLReflowState& aReflowState,
@@ -1192,17 +1189,14 @@ TextFrame::PaintAsciiText(nsIPresContext& aPresContext,
NS_RELEASE(doc); NS_RELEASE(doc);
} }
#if 0
NS_IMETHODIMP NS_IMETHODIMP
TextFrame::FindTextRuns(nsLineLayout& aLineLayout, TextFrame::FindTextRuns(nsLineLayout& aLineLayout)
nsIReflowCommand* aReflowCommand)
{ {
if (nsnull == mPrevInFlow) { if (nsnull == mPrevInFlow) {
aLineLayout.AddText(this); aLineLayout.AddText(this);
} }
return NS_OK; return NS_OK;
} }
#endif
//--------------------------------------------------- //---------------------------------------------------
// Uses a binary search for find where the cursor falls in the line of text // Uses a binary search for find where the cursor falls in the line of text

View File

@@ -36,10 +36,6 @@ public:
const nsRect& aDirtyRect); const nsRect& aDirtyRect);
// nsIHTMLReflow // nsIHTMLReflow
#if 0
NS_IMETHOD FindTextRuns(nsLineLayout& aLineLayout,
nsIReflowCommand* aReflowCommand);
#endif
NS_IMETHOD Reflow(nsIPresContext& aPresContext, NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize, nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState, const nsHTMLReflowState& aReflowState,
@@ -85,16 +81,6 @@ BRFrame::Paint(nsIPresContext& aPresContext,
return NS_OK; return NS_OK;
} }
#if 0
NS_IMETHODIMP
BRFrame::FindTextRuns(nsLineLayout& aLineLayout,
nsIReflowCommand* aReflowCommand)
{
aLineLayout.EndTextRun();
return NS_OK;
}
#endif
NS_IMETHODIMP NS_IMETHODIMP
BRFrame::Reflow(nsIPresContext& aPresContext, BRFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aMetrics, nsHTMLReflowMetrics& aMetrics,

View File

@@ -314,9 +314,7 @@ public:
nsresult StyleChangedReflow(nsBlockReflowState& aState); nsresult StyleChangedReflow(nsBlockReflowState& aState);
#if 0
nsresult FindTextRuns(nsBlockReflowState& aState); nsresult FindTextRuns(nsBlockReflowState& aState);
#endif
nsresult ChildIncrementalReflow(nsBlockReflowState& aState); nsresult ChildIncrementalReflow(nsBlockReflowState& aState);
@@ -414,10 +412,6 @@ public:
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const; NS_IMETHOD List(FILE* out, PRInt32 aIndent) const;
// nsIHTMLReflow // nsIHTMLReflow
#if 0
NS_IMETHOD FindTextRuns(nsLineLayout& aLineLayout,
nsIReflowCommand* aReflowCommand);
#endif
NS_IMETHOD Reflow(nsIPresContext& aPresContext, NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aMetrics, nsHTMLReflowMetrics& aMetrics,
const nsHTMLReflowState& aReflowState, const nsHTMLReflowState& aReflowState,
@@ -847,16 +841,6 @@ BulletFrame::Reflow(nsIPresContext& aPresContext,
return NS_OK; return NS_OK;
} }
#if 0
NS_IMETHODIMP
BulletFrame::FindTextRuns(nsLineLayout& aLineLayout,
nsIReflowCommand* aReflowCommand)
{
aLineLayout.EndTextRun();
return NS_OK;
}
#endif
//---------------------------------------------------------------------- //----------------------------------------------------------------------
#define LINE_IS_DIRTY 0x1 #define LINE_IS_DIRTY 0x1
@@ -1304,7 +1288,6 @@ nsBlockReflowState::nsBlockReflowState(nsIPresContext& aPresContext,
// coordinate system origin for later. // coordinate system origin for later.
mSpaceManager->Translate(mBorderPadding.left, mBorderPadding.top); mSpaceManager->Translate(mBorderPadding.left, mBorderPadding.top);
mSpaceManager->GetTranslation(mSpaceManagerX, mSpaceManagerY); mSpaceManager->GetTranslation(mSpaceManagerX, mSpaceManagerY);
frame->ListTag(stdout); printf(": BEGIN: BP=%d,%d,%d,%d spaceManager=%d,%d\n", mBorderPadding, mSpaceManagerX, mSpaceManagerY);
mPresContext = aPresContext; mPresContext = aPresContext;
mBlock = (nsBlockFrame*) frame; mBlock = (nsBlockFrame*) frame;
@@ -1371,7 +1354,6 @@ frame->ListTag(stdout); printf(": BEGIN: BP=%d,%d,%d,%d spaceManager=%d,%d\n", m
nsBlockReflowState::~nsBlockReflowState() nsBlockReflowState::~nsBlockReflowState()
{ {
frame->ListTag(stdout); printf(": END\n");
// Restore the coordinate system // Restore the coordinate system
mSpaceManager->Translate(-mBorderPadding.left, -mBorderPadding.top); mSpaceManager->Translate(-mBorderPadding.left, -mBorderPadding.top);
@@ -1415,7 +1397,6 @@ nsBlockReflowState::GetAvailableSpace()
// Compute the bounding rect of the available space, i.e. space // Compute the bounding rect of the available space, i.e. space
// between any left and right floaters. // between any left and right floaters.
mCurrentBand.ComputeAvailSpaceRect(); mCurrentBand.ComputeAvailSpaceRect();
mBlock->ListTag(stdout); printf(": availSpace=%d,%d,%d,%d\n", mCurrentBand.availSpace);
NS_FRAME_LOG(NS_FRAME_TRACE_CALLS, NS_FRAME_LOG(NS_FRAME_TRACE_CALLS,
("nsBlockReflowState::GetAvailableSpace: band={%d,%d,%d,%d} count=%d", ("nsBlockReflowState::GetAvailableSpace: band={%d,%d,%d,%d} count=%d",
@@ -2122,13 +2103,11 @@ nsBlockFrame::AppendNewFrames(nsIPresContext& aPresContext,
nsresult nsresult
nsBlockFrame::InitialReflow(nsBlockReflowState& aState) nsBlockFrame::InitialReflow(nsBlockReflowState& aState)
{ {
#if 0
// Generate text-run information // Generate text-run information
nsresult rv = FindTextRuns(aState); nsresult rv = FindTextRuns(aState);
if (NS_OK != rv) { if (NS_OK != rv) {
return rv; return rv;
} }
#endif
// Reflow everything // Reflow everything
aState.GetAvailableSpace(); aState.GetAvailableSpace();
@@ -2182,13 +2161,11 @@ nsBlockFrame::FrameAppendedReflow(nsBlockReflowState& aState)
// impacted line will be marked dirty // impacted line will be marked dirty
AppendNewFrames(aState.mPresContext, firstAppendedFrame); AppendNewFrames(aState.mPresContext, firstAppendedFrame);
#if 0
// Generate text-run information // Generate text-run information
rv = FindTextRuns(aState); rv = FindTextRuns(aState);
if (NS_OK != rv) { if (NS_OK != rv) {
return rv; return rv;
} }
#endif
// Recover our reflow state // Recover our reflow state
LineData* firstDirtyLine = mLines; LineData* firstDirtyLine = mLines;
@@ -2245,7 +2222,6 @@ nsBlockFrame::FrameAppendedReflow(nsBlockReflowState& aState)
return ReflowLinesAt(aState, firstDirtyLine); return ReflowLinesAt(aState, firstDirtyLine);
} }
#if 0
// XXX keep the text-run data in the first-in-flow of the block // XXX keep the text-run data in the first-in-flow of the block
nsresult nsresult
nsBlockFrame::FindTextRuns(nsBlockReflowState& aState) nsBlockFrame::FindTextRuns(nsBlockReflowState& aState)
@@ -2262,17 +2238,15 @@ nsBlockFrame::FindTextRuns(nsBlockReflowState& aState)
nsIFrame* frame = line->mFirstChild; nsIFrame* frame = line->mFirstChild;
PRInt32 n = line->mChildCount; PRInt32 n = line->mChildCount;
while (--n >= 0) { while (--n >= 0) {
nsIInlineReflow* inlineReflow; nsIHTMLReflow* hr;
if (NS_OK == frame->QueryInterface(kIInlineReflowIID, if (NS_OK == frame->QueryInterface(kIHTMLReflowIID, (void**)&hr)) {
(void**)&inlineReflow)) { nsresult rv = hr->FindTextRuns(aState.mLineLayout);
nsresult rv = inlineReflow->FindTextRuns(aState.mLineLayout,
aState.reflowCommand);
if (NS_OK != rv) { if (NS_OK != rv) {
return rv; return rv;
} }
} }
else { else {
// A frame that doesn't implement nsIInlineReflow isn't text // A frame that doesn't implement nsIHTMLReflow isn't text
// therefore it will end an open text run. // therefore it will end an open text run.
aState.mLineLayout.EndTextRun(); aState.mLineLayout.EndTextRun();
} }
@@ -2293,7 +2267,6 @@ nsBlockFrame::FindTextRuns(nsBlockReflowState& aState)
return NS_OK; return NS_OK;
} }
#endif
nsresult nsresult
nsBlockFrame::FrameInsertedReflow(nsBlockReflowState& aState) nsBlockFrame::FrameInsertedReflow(nsBlockReflowState& aState)

View File

@@ -314,9 +314,7 @@ public:
nsresult StyleChangedReflow(nsBlockReflowState& aState); nsresult StyleChangedReflow(nsBlockReflowState& aState);
#if 0
nsresult FindTextRuns(nsBlockReflowState& aState); nsresult FindTextRuns(nsBlockReflowState& aState);
#endif
nsresult ChildIncrementalReflow(nsBlockReflowState& aState); nsresult ChildIncrementalReflow(nsBlockReflowState& aState);
@@ -414,10 +412,6 @@ public:
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const; NS_IMETHOD List(FILE* out, PRInt32 aIndent) const;
// nsIHTMLReflow // nsIHTMLReflow
#if 0
NS_IMETHOD FindTextRuns(nsLineLayout& aLineLayout,
nsIReflowCommand* aReflowCommand);
#endif
NS_IMETHOD Reflow(nsIPresContext& aPresContext, NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aMetrics, nsHTMLReflowMetrics& aMetrics,
const nsHTMLReflowState& aReflowState, const nsHTMLReflowState& aReflowState,
@@ -847,16 +841,6 @@ BulletFrame::Reflow(nsIPresContext& aPresContext,
return NS_OK; return NS_OK;
} }
#if 0
NS_IMETHODIMP
BulletFrame::FindTextRuns(nsLineLayout& aLineLayout,
nsIReflowCommand* aReflowCommand)
{
aLineLayout.EndTextRun();
return NS_OK;
}
#endif
//---------------------------------------------------------------------- //----------------------------------------------------------------------
#define LINE_IS_DIRTY 0x1 #define LINE_IS_DIRTY 0x1
@@ -1304,7 +1288,6 @@ nsBlockReflowState::nsBlockReflowState(nsIPresContext& aPresContext,
// coordinate system origin for later. // coordinate system origin for later.
mSpaceManager->Translate(mBorderPadding.left, mBorderPadding.top); mSpaceManager->Translate(mBorderPadding.left, mBorderPadding.top);
mSpaceManager->GetTranslation(mSpaceManagerX, mSpaceManagerY); mSpaceManager->GetTranslation(mSpaceManagerX, mSpaceManagerY);
frame->ListTag(stdout); printf(": BEGIN: BP=%d,%d,%d,%d spaceManager=%d,%d\n", mBorderPadding, mSpaceManagerX, mSpaceManagerY);
mPresContext = aPresContext; mPresContext = aPresContext;
mBlock = (nsBlockFrame*) frame; mBlock = (nsBlockFrame*) frame;
@@ -1371,7 +1354,6 @@ frame->ListTag(stdout); printf(": BEGIN: BP=%d,%d,%d,%d spaceManager=%d,%d\n", m
nsBlockReflowState::~nsBlockReflowState() nsBlockReflowState::~nsBlockReflowState()
{ {
frame->ListTag(stdout); printf(": END\n");
// Restore the coordinate system // Restore the coordinate system
mSpaceManager->Translate(-mBorderPadding.left, -mBorderPadding.top); mSpaceManager->Translate(-mBorderPadding.left, -mBorderPadding.top);
@@ -1415,7 +1397,6 @@ nsBlockReflowState::GetAvailableSpace()
// Compute the bounding rect of the available space, i.e. space // Compute the bounding rect of the available space, i.e. space
// between any left and right floaters. // between any left and right floaters.
mCurrentBand.ComputeAvailSpaceRect(); mCurrentBand.ComputeAvailSpaceRect();
mBlock->ListTag(stdout); printf(": availSpace=%d,%d,%d,%d\n", mCurrentBand.availSpace);
NS_FRAME_LOG(NS_FRAME_TRACE_CALLS, NS_FRAME_LOG(NS_FRAME_TRACE_CALLS,
("nsBlockReflowState::GetAvailableSpace: band={%d,%d,%d,%d} count=%d", ("nsBlockReflowState::GetAvailableSpace: band={%d,%d,%d,%d} count=%d",
@@ -2122,13 +2103,11 @@ nsBlockFrame::AppendNewFrames(nsIPresContext& aPresContext,
nsresult nsresult
nsBlockFrame::InitialReflow(nsBlockReflowState& aState) nsBlockFrame::InitialReflow(nsBlockReflowState& aState)
{ {
#if 0
// Generate text-run information // Generate text-run information
nsresult rv = FindTextRuns(aState); nsresult rv = FindTextRuns(aState);
if (NS_OK != rv) { if (NS_OK != rv) {
return rv; return rv;
} }
#endif
// Reflow everything // Reflow everything
aState.GetAvailableSpace(); aState.GetAvailableSpace();
@@ -2182,13 +2161,11 @@ nsBlockFrame::FrameAppendedReflow(nsBlockReflowState& aState)
// impacted line will be marked dirty // impacted line will be marked dirty
AppendNewFrames(aState.mPresContext, firstAppendedFrame); AppendNewFrames(aState.mPresContext, firstAppendedFrame);
#if 0
// Generate text-run information // Generate text-run information
rv = FindTextRuns(aState); rv = FindTextRuns(aState);
if (NS_OK != rv) { if (NS_OK != rv) {
return rv; return rv;
} }
#endif
// Recover our reflow state // Recover our reflow state
LineData* firstDirtyLine = mLines; LineData* firstDirtyLine = mLines;
@@ -2245,7 +2222,6 @@ nsBlockFrame::FrameAppendedReflow(nsBlockReflowState& aState)
return ReflowLinesAt(aState, firstDirtyLine); return ReflowLinesAt(aState, firstDirtyLine);
} }
#if 0
// XXX keep the text-run data in the first-in-flow of the block // XXX keep the text-run data in the first-in-flow of the block
nsresult nsresult
nsBlockFrame::FindTextRuns(nsBlockReflowState& aState) nsBlockFrame::FindTextRuns(nsBlockReflowState& aState)
@@ -2262,17 +2238,15 @@ nsBlockFrame::FindTextRuns(nsBlockReflowState& aState)
nsIFrame* frame = line->mFirstChild; nsIFrame* frame = line->mFirstChild;
PRInt32 n = line->mChildCount; PRInt32 n = line->mChildCount;
while (--n >= 0) { while (--n >= 0) {
nsIInlineReflow* inlineReflow; nsIHTMLReflow* hr;
if (NS_OK == frame->QueryInterface(kIInlineReflowIID, if (NS_OK == frame->QueryInterface(kIHTMLReflowIID, (void**)&hr)) {
(void**)&inlineReflow)) { nsresult rv = hr->FindTextRuns(aState.mLineLayout);
nsresult rv = inlineReflow->FindTextRuns(aState.mLineLayout,
aState.reflowCommand);
if (NS_OK != rv) { if (NS_OK != rv) {
return rv; return rv;
} }
} }
else { else {
// A frame that doesn't implement nsIInlineReflow isn't text // A frame that doesn't implement nsIHTMLReflow isn't text
// therefore it will end an open text run. // therefore it will end an open text run.
aState.mLineLayout.EndTextRun(); aState.mLineLayout.EndTextRun();
} }
@@ -2293,7 +2267,6 @@ nsBlockFrame::FindTextRuns(nsBlockReflowState& aState)
return NS_OK; return NS_OK;
} }
#endif
nsresult nsresult
nsBlockFrame::FrameInsertedReflow(nsBlockReflowState& aState) nsBlockFrame::FrameInsertedReflow(nsBlockReflowState& aState)

View File

@@ -314,9 +314,7 @@ public:
nsresult StyleChangedReflow(nsBlockReflowState& aState); nsresult StyleChangedReflow(nsBlockReflowState& aState);
#if 0
nsresult FindTextRuns(nsBlockReflowState& aState); nsresult FindTextRuns(nsBlockReflowState& aState);
#endif
nsresult ChildIncrementalReflow(nsBlockReflowState& aState); nsresult ChildIncrementalReflow(nsBlockReflowState& aState);
@@ -414,10 +412,6 @@ public:
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const; NS_IMETHOD List(FILE* out, PRInt32 aIndent) const;
// nsIHTMLReflow // nsIHTMLReflow
#if 0
NS_IMETHOD FindTextRuns(nsLineLayout& aLineLayout,
nsIReflowCommand* aReflowCommand);
#endif
NS_IMETHOD Reflow(nsIPresContext& aPresContext, NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aMetrics, nsHTMLReflowMetrics& aMetrics,
const nsHTMLReflowState& aReflowState, const nsHTMLReflowState& aReflowState,
@@ -847,16 +841,6 @@ BulletFrame::Reflow(nsIPresContext& aPresContext,
return NS_OK; return NS_OK;
} }
#if 0
NS_IMETHODIMP
BulletFrame::FindTextRuns(nsLineLayout& aLineLayout,
nsIReflowCommand* aReflowCommand)
{
aLineLayout.EndTextRun();
return NS_OK;
}
#endif
//---------------------------------------------------------------------- //----------------------------------------------------------------------
#define LINE_IS_DIRTY 0x1 #define LINE_IS_DIRTY 0x1
@@ -1304,7 +1288,6 @@ nsBlockReflowState::nsBlockReflowState(nsIPresContext& aPresContext,
// coordinate system origin for later. // coordinate system origin for later.
mSpaceManager->Translate(mBorderPadding.left, mBorderPadding.top); mSpaceManager->Translate(mBorderPadding.left, mBorderPadding.top);
mSpaceManager->GetTranslation(mSpaceManagerX, mSpaceManagerY); mSpaceManager->GetTranslation(mSpaceManagerX, mSpaceManagerY);
frame->ListTag(stdout); printf(": BEGIN: BP=%d,%d,%d,%d spaceManager=%d,%d\n", mBorderPadding, mSpaceManagerX, mSpaceManagerY);
mPresContext = aPresContext; mPresContext = aPresContext;
mBlock = (nsBlockFrame*) frame; mBlock = (nsBlockFrame*) frame;
@@ -1371,7 +1354,6 @@ frame->ListTag(stdout); printf(": BEGIN: BP=%d,%d,%d,%d spaceManager=%d,%d\n", m
nsBlockReflowState::~nsBlockReflowState() nsBlockReflowState::~nsBlockReflowState()
{ {
frame->ListTag(stdout); printf(": END\n");
// Restore the coordinate system // Restore the coordinate system
mSpaceManager->Translate(-mBorderPadding.left, -mBorderPadding.top); mSpaceManager->Translate(-mBorderPadding.left, -mBorderPadding.top);
@@ -1415,7 +1397,6 @@ nsBlockReflowState::GetAvailableSpace()
// Compute the bounding rect of the available space, i.e. space // Compute the bounding rect of the available space, i.e. space
// between any left and right floaters. // between any left and right floaters.
mCurrentBand.ComputeAvailSpaceRect(); mCurrentBand.ComputeAvailSpaceRect();
mBlock->ListTag(stdout); printf(": availSpace=%d,%d,%d,%d\n", mCurrentBand.availSpace);
NS_FRAME_LOG(NS_FRAME_TRACE_CALLS, NS_FRAME_LOG(NS_FRAME_TRACE_CALLS,
("nsBlockReflowState::GetAvailableSpace: band={%d,%d,%d,%d} count=%d", ("nsBlockReflowState::GetAvailableSpace: band={%d,%d,%d,%d} count=%d",
@@ -2122,13 +2103,11 @@ nsBlockFrame::AppendNewFrames(nsIPresContext& aPresContext,
nsresult nsresult
nsBlockFrame::InitialReflow(nsBlockReflowState& aState) nsBlockFrame::InitialReflow(nsBlockReflowState& aState)
{ {
#if 0
// Generate text-run information // Generate text-run information
nsresult rv = FindTextRuns(aState); nsresult rv = FindTextRuns(aState);
if (NS_OK != rv) { if (NS_OK != rv) {
return rv; return rv;
} }
#endif
// Reflow everything // Reflow everything
aState.GetAvailableSpace(); aState.GetAvailableSpace();
@@ -2182,13 +2161,11 @@ nsBlockFrame::FrameAppendedReflow(nsBlockReflowState& aState)
// impacted line will be marked dirty // impacted line will be marked dirty
AppendNewFrames(aState.mPresContext, firstAppendedFrame); AppendNewFrames(aState.mPresContext, firstAppendedFrame);
#if 0
// Generate text-run information // Generate text-run information
rv = FindTextRuns(aState); rv = FindTextRuns(aState);
if (NS_OK != rv) { if (NS_OK != rv) {
return rv; return rv;
} }
#endif
// Recover our reflow state // Recover our reflow state
LineData* firstDirtyLine = mLines; LineData* firstDirtyLine = mLines;
@@ -2245,7 +2222,6 @@ nsBlockFrame::FrameAppendedReflow(nsBlockReflowState& aState)
return ReflowLinesAt(aState, firstDirtyLine); return ReflowLinesAt(aState, firstDirtyLine);
} }
#if 0
// XXX keep the text-run data in the first-in-flow of the block // XXX keep the text-run data in the first-in-flow of the block
nsresult nsresult
nsBlockFrame::FindTextRuns(nsBlockReflowState& aState) nsBlockFrame::FindTextRuns(nsBlockReflowState& aState)
@@ -2262,17 +2238,15 @@ nsBlockFrame::FindTextRuns(nsBlockReflowState& aState)
nsIFrame* frame = line->mFirstChild; nsIFrame* frame = line->mFirstChild;
PRInt32 n = line->mChildCount; PRInt32 n = line->mChildCount;
while (--n >= 0) { while (--n >= 0) {
nsIInlineReflow* inlineReflow; nsIHTMLReflow* hr;
if (NS_OK == frame->QueryInterface(kIInlineReflowIID, if (NS_OK == frame->QueryInterface(kIHTMLReflowIID, (void**)&hr)) {
(void**)&inlineReflow)) { nsresult rv = hr->FindTextRuns(aState.mLineLayout);
nsresult rv = inlineReflow->FindTextRuns(aState.mLineLayout,
aState.reflowCommand);
if (NS_OK != rv) { if (NS_OK != rv) {
return rv; return rv;
} }
} }
else { else {
// A frame that doesn't implement nsIInlineReflow isn't text // A frame that doesn't implement nsIHTMLReflow isn't text
// therefore it will end an open text run. // therefore it will end an open text run.
aState.mLineLayout.EndTextRun(); aState.mLineLayout.EndTextRun();
} }
@@ -2293,7 +2267,6 @@ nsBlockFrame::FindTextRuns(nsBlockReflowState& aState)
return NS_OK; return NS_OK;
} }
#endif
nsresult nsresult
nsBlockFrame::FrameInsertedReflow(nsBlockReflowState& aState) nsBlockFrame::FrameInsertedReflow(nsBlockReflowState& aState)

View File

@@ -16,6 +16,7 @@
* Reserved. * Reserved.
*/ */
#include "nsFrame.h" #include "nsFrame.h"
#include "nsLineLayout.h"
#include "nsIContent.h" #include "nsIContent.h"
#include "nsIAtom.h" #include "nsIAtom.h"
#include "nsString.h" #include "nsString.h"
@@ -303,7 +304,7 @@ NS_IMETHODIMP nsFrame::Init(nsIPresContext& aPresContext, nsIFrame* aChildList)
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::DeleteFrame(nsIPresContext& aPresContext) NS_IMETHODIMP nsFrame::DeleteFrame(nsIPresContext& aPresContext)
{ {
//XXX Why is this done in nsFrame instead of some frame class //XXX Why is this done in nsFrame instead of some frame class
// that actually loads images? // that actually loads images?
@@ -336,7 +337,7 @@ nsFrame::SizeOfWithoutThis(nsISizeOfHandler* aHandler) const
// support // support
} }
NS_METHOD nsFrame::GetContent(nsIContent*& aContent) const NS_IMETHODIMP nsFrame::GetContent(nsIContent*& aContent) const
{ {
if (nsnull != mContent) { if (nsnull != mContent) {
NS_ADDREF(mContent); NS_ADDREF(mContent);
@@ -345,7 +346,7 @@ NS_METHOD nsFrame::GetContent(nsIContent*& aContent) const
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::GetStyleContext(nsIPresContext* aPresContext, NS_IMETHODIMP nsFrame::GetStyleContext(nsIPresContext* aPresContext,
nsIStyleContext*& aStyleContext) nsIStyleContext*& aStyleContext)
{ {
if ((nsnull == mStyleContext) && (nsnull != aPresContext)) { if ((nsnull == mStyleContext) && (nsnull != aPresContext)) {
@@ -359,7 +360,7 @@ NS_METHOD nsFrame::GetStyleContext(nsIPresContext* aPresContext,
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::SetStyleContext(nsIPresContext* aPresContext,nsIStyleContext* aContext) NS_IMETHODIMP nsFrame::SetStyleContext(nsIPresContext* aPresContext,nsIStyleContext* aContext)
{ {
NS_PRECONDITION(nsnull != aContext, "null ptr"); NS_PRECONDITION(nsnull != aContext, "null ptr");
if (aContext != mStyleContext) { if (aContext != mStyleContext) {
@@ -375,12 +376,12 @@ NS_METHOD nsFrame::SetStyleContext(nsIPresContext* aPresContext,nsIStyleContext*
} }
// Subclass hook for style post processing // Subclass hook for style post processing
NS_METHOD nsFrame::DidSetStyleContext(nsIPresContext* aPresContext) NS_IMETHODIMP nsFrame::DidSetStyleContext(nsIPresContext* aPresContext)
{ {
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::GetStyleData(nsStyleStructID aSID, const nsStyleStruct*& aStyleStruct) const NS_IMETHODIMP nsFrame::GetStyleData(nsStyleStructID aSID, const nsStyleStruct*& aStyleStruct) const
{ {
NS_ASSERTION(mStyleContext!=nsnull,"null style context"); NS_ASSERTION(mStyleContext!=nsnull,"null style context");
if (mStyleContext) { if (mStyleContext) {
@@ -393,25 +394,25 @@ NS_METHOD nsFrame::GetStyleData(nsStyleStructID aSID, const nsStyleStruct*& aSty
// Geometric and content parent member functions // Geometric and content parent member functions
NS_METHOD nsFrame::GetContentParent(nsIFrame*& aParent) const NS_IMETHODIMP nsFrame::GetContentParent(nsIFrame*& aParent) const
{ {
aParent = mContentParent; aParent = mContentParent;
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::SetContentParent(const nsIFrame* aParent) NS_IMETHODIMP nsFrame::SetContentParent(const nsIFrame* aParent)
{ {
mContentParent = (nsIFrame*)aParent; mContentParent = (nsIFrame*)aParent;
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::GetGeometricParent(nsIFrame*& aParent) const NS_IMETHODIMP nsFrame::GetGeometricParent(nsIFrame*& aParent) const
{ {
aParent = mGeometricParent; aParent = mGeometricParent;
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::SetGeometricParent(const nsIFrame* aParent) NS_IMETHODIMP nsFrame::SetGeometricParent(const nsIFrame* aParent)
{ {
mGeometricParent = (nsIFrame*)aParent; mGeometricParent = (nsIFrame*)aParent;
return NS_OK; return NS_OK;
@@ -419,34 +420,34 @@ NS_METHOD nsFrame::SetGeometricParent(const nsIFrame* aParent)
// Bounding rect member functions // Bounding rect member functions
NS_METHOD nsFrame::GetRect(nsRect& aRect) const NS_IMETHODIMP nsFrame::GetRect(nsRect& aRect) const
{ {
aRect = mRect; aRect = mRect;
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::GetOrigin(nsPoint& aPoint) const NS_IMETHODIMP nsFrame::GetOrigin(nsPoint& aPoint) const
{ {
aPoint.x = mRect.x; aPoint.x = mRect.x;
aPoint.y = mRect.y; aPoint.y = mRect.y;
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::GetSize(nsSize& aSize) const NS_IMETHODIMP nsFrame::GetSize(nsSize& aSize) const
{ {
aSize.width = mRect.width; aSize.width = mRect.width;
aSize.height = mRect.height; aSize.height = mRect.height;
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::SetRect(const nsRect& aRect) NS_IMETHODIMP nsFrame::SetRect(const nsRect& aRect)
{ {
MoveTo(aRect.x, aRect.y); MoveTo(aRect.x, aRect.y);
SizeTo(aRect.width, aRect.height); SizeTo(aRect.width, aRect.height);
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::MoveTo(nscoord aX, nscoord aY) NS_IMETHODIMP nsFrame::MoveTo(nscoord aX, nscoord aY)
{ {
mRect.x = aX; mRect.x = aX;
mRect.y = aY; mRect.y = aY;
@@ -467,7 +468,7 @@ NS_METHOD nsFrame::MoveTo(nscoord aX, nscoord aY)
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::SizeTo(nscoord aWidth, nscoord aHeight) NS_IMETHODIMP nsFrame::SizeTo(nscoord aWidth, nscoord aHeight)
{ {
mRect.width = aWidth; mRect.width = aWidth;
mRect.height = aHeight; mRect.height = aHeight;
@@ -484,7 +485,7 @@ NS_METHOD nsFrame::SizeTo(nscoord aWidth, nscoord aHeight)
// Child frame enumeration // Child frame enumeration
NS_METHOD nsFrame::FirstChild(nsIFrame*& aFirstChild) const NS_IMETHODIMP nsFrame::FirstChild(nsIFrame*& aFirstChild) const
{ {
aFirstChild = nsnull; aFirstChild = nsnull;
return NS_OK; return NS_OK;
@@ -511,7 +512,7 @@ PRBool nsFrame::DisplaySelection(nsIPresContext& aPresContext, PRBool isOkToTurn
return result; return result;
} }
NS_METHOD nsFrame::Paint(nsIPresContext& aPresContext, NS_IMETHODIMP nsFrame::Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext, nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect) const nsRect& aDirtyRect)
{ {
@@ -571,7 +572,7 @@ NS_METHOD nsFrame::Paint(nsIPresContext& aPresContext,
/** /**
* *
*/ */
NS_METHOD nsFrame::HandleEvent(nsIPresContext& aPresContext, NS_IMETHODIMP nsFrame::HandleEvent(nsIPresContext& aPresContext,
nsGUIEvent* aEvent, nsGUIEvent* aEvent,
nsEventStatus& aEventStatus) nsEventStatus& aEventStatus)
{ {
@@ -618,7 +619,7 @@ NS_METHOD nsFrame::HandleEvent(nsIPresContext& aPresContext,
/** /**
* Handles the Mouse Press Event for the frame * Handles the Mouse Press Event for the frame
*/ */
NS_METHOD nsFrame::HandlePress(nsIPresContext& aPresContext, NS_IMETHODIMP nsFrame::HandlePress(nsIPresContext& aPresContext,
nsGUIEvent* aEvent, nsGUIEvent* aEvent,
nsEventStatus& aEventStatus) nsEventStatus& aEventStatus)
{ {
@@ -804,7 +805,7 @@ NS_METHOD nsFrame::HandlePress(nsIPresContext& aPresContext,
} }
NS_METHOD nsFrame::HandleDrag(nsIPresContext& aPresContext, NS_IMETHODIMP nsFrame::HandleDrag(nsIPresContext& aPresContext,
nsGUIEvent* aEvent, nsGUIEvent* aEvent,
nsEventStatus& aEventStatus) nsEventStatus& aEventStatus)
{ {
@@ -928,7 +929,7 @@ NS_METHOD nsFrame::HandleDrag(nsIPresContext& aPresContext,
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::HandleRelease(nsIPresContext& aPresContext, NS_IMETHODIMP nsFrame::HandleRelease(nsIPresContext& aPresContext,
nsGUIEvent* aEvent, nsGUIEvent* aEvent,
nsEventStatus& aEventStatus) nsEventStatus& aEventStatus)
{ {
@@ -1069,7 +1070,7 @@ void nsFrame::AdjustPointsInSameContent(nsIPresContext& aPresContext,
//} //}
} }
NS_METHOD nsFrame::GetCursorAndContentAt(nsIPresContext& aPresContext, NS_IMETHODIMP nsFrame::GetCursorAndContentAt(nsIPresContext& aPresContext,
const nsPoint& aPoint, const nsPoint& aPoint,
nsIFrame** aFrame, nsIFrame** aFrame,
nsIContent** aContent, nsIContent** aContent,
@@ -1081,14 +1082,14 @@ NS_METHOD nsFrame::GetCursorAndContentAt(nsIPresContext& aPresContext,
} }
// Resize and incremental reflow // Resize and incremental reflow
NS_METHOD NS_IMETHODIMP
nsFrame::GetFrameState(nsFrameState& aResult) nsFrame::GetFrameState(nsFrameState& aResult)
{ {
aResult = mState; aResult = mState;
return NS_OK; return NS_OK;
} }
NS_METHOD NS_IMETHODIMP
nsFrame::SetFrameState(nsFrameState aNewState) nsFrame::SetFrameState(nsFrameState aNewState)
{ {
mState = aNewState; mState = aNewState;
@@ -1097,7 +1098,7 @@ nsFrame::SetFrameState(nsFrameState aNewState)
// nsIHTMLReflow member functions // nsIHTMLReflow member functions
NS_METHOD NS_IMETHODIMP
nsFrame::WillReflow(nsIPresContext& aPresContext) nsFrame::WillReflow(nsIPresContext& aPresContext)
{ {
NS_FRAME_TRACE_MSG(NS_FRAME_TRACE_CALLS, NS_FRAME_TRACE_MSG(NS_FRAME_TRACE_CALLS,
@@ -1106,7 +1107,7 @@ nsFrame::WillReflow(nsIPresContext& aPresContext)
return NS_OK; return NS_OK;
} }
NS_METHOD NS_IMETHODIMP
nsFrame::DidReflow(nsIPresContext& aPresContext, nsFrame::DidReflow(nsIPresContext& aPresContext,
nsDidReflowStatus aStatus) nsDidReflowStatus aStatus)
{ {
@@ -1131,10 +1132,11 @@ nsFrame::DidReflow(nsIPresContext& aPresContext,
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::Reflow(nsIPresContext& aPresContext, NS_IMETHODIMP
nsHTMLReflowMetrics& aDesiredSize, nsFrame::Reflow(nsIPresContext& aPresContext,
const nsHTMLReflowState& aReflowState, nsHTMLReflowMetrics& aDesiredSize,
nsReflowStatus& aStatus) const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{ {
aDesiredSize.width = 0; aDesiredSize.width = 0;
aDesiredSize.height = 0; aDesiredSize.height = 0;
@@ -1153,8 +1155,9 @@ NS_METHOD nsFrame::Reflow(nsIPresContext& aPresContext,
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::GetReflowMetrics(nsIPresContext& aPresContext, NS_IMETHODIMP
nsHTMLReflowMetrics& aMetrics) nsFrame::GetReflowMetrics(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aMetrics)
{ {
aMetrics.width = mRect.width; aMetrics.width = mRect.width;
aMetrics.height = mRect.height; aMetrics.height = mRect.height;
@@ -1163,7 +1166,14 @@ NS_METHOD nsFrame::GetReflowMetrics(nsIPresContext& aPresContext,
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::ContentChanged(nsIPresContext* aPresContext, NS_IMETHODIMP
nsFrame::FindTextRuns(nsLineLayout& aLineLayout)
{
aLineLayout.EndTextRun();
return NS_OK;
}
NS_IMETHODIMP nsFrame::ContentChanged(nsIPresContext* aPresContext,
nsIContent* aChild, nsIContent* aChild,
nsISupports* aSubContent) nsISupports* aSubContent)
{ {
@@ -1180,13 +1190,13 @@ NS_IMETHODIMP nsFrame::AttributeChanged(nsIPresContext* aPresContext,
// Flow member functions // Flow member functions
NS_METHOD nsFrame::IsSplittable(nsSplittableType& aIsSplittable) const NS_IMETHODIMP nsFrame::IsSplittable(nsSplittableType& aIsSplittable) const
{ {
aIsSplittable = NS_FRAME_NOT_SPLITTABLE; aIsSplittable = NS_FRAME_NOT_SPLITTABLE;
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::CreateContinuingFrame(nsIPresContext& aPresContext, NS_IMETHODIMP nsFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
nsIFrame* aParent, nsIFrame* aParent,
nsIStyleContext* aStyleContext, nsIStyleContext* aStyleContext,
nsIFrame*& aContinuingFrame) nsIFrame*& aContinuingFrame)
@@ -1196,68 +1206,68 @@ NS_METHOD nsFrame::CreateContinuingFrame(nsIPresContext& aPresContext,
return NS_ERROR_NOT_IMPLEMENTED; return NS_ERROR_NOT_IMPLEMENTED;
} }
NS_METHOD nsFrame::GetPrevInFlow(nsIFrame*& aPrevInFlow) const NS_IMETHODIMP nsFrame::GetPrevInFlow(nsIFrame*& aPrevInFlow) const
{ {
aPrevInFlow = nsnull; aPrevInFlow = nsnull;
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::SetPrevInFlow(nsIFrame*) NS_IMETHODIMP nsFrame::SetPrevInFlow(nsIFrame*)
{ {
NS_ERROR("not splittable"); NS_ERROR("not splittable");
return NS_ERROR_NOT_IMPLEMENTED; return NS_ERROR_NOT_IMPLEMENTED;
} }
NS_METHOD nsFrame::GetNextInFlow(nsIFrame*& aNextInFlow) const NS_IMETHODIMP nsFrame::GetNextInFlow(nsIFrame*& aNextInFlow) const
{ {
aNextInFlow = nsnull; aNextInFlow = nsnull;
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::SetNextInFlow(nsIFrame*) NS_IMETHODIMP nsFrame::SetNextInFlow(nsIFrame*)
{ {
NS_ERROR("not splittable"); NS_ERROR("not splittable");
return NS_ERROR_NOT_IMPLEMENTED; return NS_ERROR_NOT_IMPLEMENTED;
} }
NS_METHOD nsFrame::AppendToFlow(nsIFrame* aAfterFrame) NS_IMETHODIMP nsFrame::AppendToFlow(nsIFrame* aAfterFrame)
{ {
NS_ERROR("not splittable"); NS_ERROR("not splittable");
return NS_ERROR_NOT_IMPLEMENTED; return NS_ERROR_NOT_IMPLEMENTED;
} }
NS_METHOD nsFrame::PrependToFlow(nsIFrame* aBeforeFrame) NS_IMETHODIMP nsFrame::PrependToFlow(nsIFrame* aBeforeFrame)
{ {
NS_ERROR("not splittable"); NS_ERROR("not splittable");
return NS_ERROR_NOT_IMPLEMENTED; return NS_ERROR_NOT_IMPLEMENTED;
} }
NS_METHOD nsFrame::RemoveFromFlow() NS_IMETHODIMP nsFrame::RemoveFromFlow()
{ {
NS_ERROR("not splittable"); NS_ERROR("not splittable");
return NS_ERROR_NOT_IMPLEMENTED; return NS_ERROR_NOT_IMPLEMENTED;
} }
NS_METHOD nsFrame::BreakFromPrevFlow() NS_IMETHODIMP nsFrame::BreakFromPrevFlow()
{ {
NS_ERROR("not splittable"); NS_ERROR("not splittable");
return NS_ERROR_NOT_IMPLEMENTED; return NS_ERROR_NOT_IMPLEMENTED;
} }
NS_METHOD nsFrame::BreakFromNextFlow() NS_IMETHODIMP nsFrame::BreakFromNextFlow()
{ {
NS_ERROR("not splittable"); NS_ERROR("not splittable");
return NS_ERROR_NOT_IMPLEMENTED; return NS_ERROR_NOT_IMPLEMENTED;
} }
// Associated view object // Associated view object
NS_METHOD nsFrame::GetView(nsIView*& aView) const NS_IMETHODIMP nsFrame::GetView(nsIView*& aView) const
{ {
aView = mView; aView = mView;
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::SetView(nsIView* aView) NS_IMETHODIMP nsFrame::SetView(nsIView* aView)
{ {
nsresult rv; nsresult rv;
@@ -1273,7 +1283,7 @@ NS_METHOD nsFrame::SetView(nsIView* aView)
} }
// Find the first geometric parent that has a view // Find the first geometric parent that has a view
NS_METHOD nsFrame::GetParentWithView(nsIFrame*& aParent) const NS_IMETHODIMP nsFrame::GetParentWithView(nsIFrame*& aParent) const
{ {
aParent = mGeometricParent; aParent = mGeometricParent;
@@ -1292,7 +1302,7 @@ NS_METHOD nsFrame::GetParentWithView(nsIFrame*& aParent) const
// Returns the offset from this frame to the closest geometric parent that // Returns the offset from this frame to the closest geometric parent that
// has a view. Also returns the containing view or null in case of error // has a view. Also returns the containing view or null in case of error
NS_METHOD nsFrame::GetOffsetFromView(nsPoint& aOffset, nsIView*& aView) const NS_IMETHODIMP nsFrame::GetOffsetFromView(nsPoint& aOffset, nsIView*& aView) const
{ {
nsIFrame* frame = (nsIFrame*)this; nsIFrame* frame = (nsIFrame*)this;
@@ -1311,7 +1321,7 @@ NS_METHOD nsFrame::GetOffsetFromView(nsPoint& aOffset, nsIView*& aView) const
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::GetWindow(nsIWidget*& aWindow) const NS_IMETHODIMP nsFrame::GetWindow(nsIWidget*& aWindow) const
{ {
nsIFrame* frame = (nsIFrame*)this; nsIFrame* frame = (nsIFrame*)this;
@@ -1359,7 +1369,7 @@ nsFrame::Invalidate(const nsRect& aDamageRect,
} }
// Style sizing methods // Style sizing methods
NS_METHOD nsFrame::IsPercentageBase(PRBool& aBase) const NS_IMETHODIMP nsFrame::IsPercentageBase(PRBool& aBase) const
{ {
const nsStylePosition* position; const nsStylePosition* position;
GetStyleData(eStyleStruct_Position, (const nsStyleStruct*&)position); GetStyleData(eStyleStruct_Position, (const nsStyleStruct*&)position);
@@ -1380,7 +1390,7 @@ NS_METHOD nsFrame::IsPercentageBase(PRBool& aBase) const
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::GetAutoMarginSize(PRUint8 aSide, nscoord& aSize) const NS_IMETHODIMP nsFrame::GetAutoMarginSize(PRUint8 aSide, nscoord& aSize) const
{ {
aSize = 0; // XXX probably not right, subclass override? aSize = 0; // XXX probably not right, subclass override?
return NS_OK; return NS_OK;
@@ -1389,27 +1399,27 @@ NS_METHOD nsFrame::GetAutoMarginSize(PRUint8 aSide, nscoord& aSize) const
// Sibling pointer used to link together frames // Sibling pointer used to link together frames
NS_METHOD nsFrame::GetNextSibling(nsIFrame*& aNextSibling) const NS_IMETHODIMP nsFrame::GetNextSibling(nsIFrame*& aNextSibling) const
{ {
aNextSibling = mNextSibling; aNextSibling = mNextSibling;
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::SetNextSibling(nsIFrame* aNextSibling) NS_IMETHODIMP nsFrame::SetNextSibling(nsIFrame* aNextSibling)
{ {
mNextSibling = aNextSibling; mNextSibling = aNextSibling;
return NS_OK; return NS_OK;
} }
// Transparency query // Transparency query
NS_METHOD nsFrame::IsTransparent(PRBool& aTransparent) const NS_IMETHODIMP nsFrame::IsTransparent(PRBool& aTransparent) const
{ {
//XXX this needs to be overridden in just about every leaf class? MMP //XXX this needs to be overridden in just about every leaf class? MMP
aTransparent = PR_TRUE; aTransparent = PR_TRUE;
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::Scrolled(nsIView *aView) NS_IMETHODIMP nsFrame::Scrolled(nsIView *aView)
{ {
return NS_OK; return NS_OK;
} }
@@ -1435,7 +1445,7 @@ PRInt32 nsFrame::ContentIndexInContainer(const nsIFrame* aFrame)
} }
// Debugging // Debugging
NS_METHOD nsFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const NS_IMETHODIMP nsFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const
{ {
// if a filter is present, only output this frame if the filter says we should // if a filter is present, only output this frame if the filter says we should
nsIAtom* tag; nsIAtom* tag;
@@ -1467,7 +1477,7 @@ NS_METHOD nsFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) cons
} }
// Output the frame's tag // Output the frame's tag
NS_METHOD nsFrame::ListTag(FILE* out) const NS_IMETHODIMP nsFrame::ListTag(FILE* out) const
{ {
nsIAtom* tag; nsIAtom* tag;
mContent->GetTag(tag); mContent->GetTag(tag);
@@ -1482,7 +1492,7 @@ NS_METHOD nsFrame::ListTag(FILE* out) const
return NS_OK; return NS_OK;
} }
NS_METHOD nsFrame::VerifyTree() const NS_IMETHODIMP nsFrame::VerifyTree() const
{ {
NS_ASSERTION(0 == (mState & NS_FRAME_IN_REFLOW), "frame is in reflow"); NS_ASSERTION(0 == (mState & NS_FRAME_IN_REFLOW), "frame is in reflow");
return NS_OK; return NS_OK;

View File

@@ -187,6 +187,7 @@ public:
nsDidReflowStatus aStatus); nsDidReflowStatus aStatus);
NS_IMETHOD GetReflowMetrics(nsIPresContext& aPresContext, NS_IMETHOD GetReflowMetrics(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aMetrics); nsHTMLReflowMetrics& aMetrics);
NS_IMETHOD FindTextRuns(nsLineLayout& aLineLayout);
// Selection Methods // Selection Methods
// XXX Doc me... // XXX Doc me...

View File

@@ -213,6 +213,10 @@ struct nsHTMLReflowState : nsReflowState {
*/ */
class nsIHTMLReflow : public nsIFrameReflow<nsHTMLReflowState, nsHTMLReflowMetrics> class nsIHTMLReflow : public nsIFrameReflow<nsHTMLReflowState, nsHTMLReflowMetrics>
{ {
public:
// Helper method used by block reflow to identify runs of text so that
// proper word-breaking can be done.
NS_IMETHOD FindTextRuns(nsLineLayout& aLineLayout) = 0;
}; };
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@@ -68,10 +68,7 @@ public:
nsIFrame*& aContinuingFrame); nsIFrame*& aContinuingFrame);
// nsIHTMLReflow // nsIHTMLReflow
#if 0 NS_IMETHOD FindTextRuns(nsLineLayout& aLineLayout);
NS_IMETHOD FindTextRuns(nsLineLayout& aLineLayout,
nsIReflowCommand* aReflowCommand);
#endif
NS_IMETHOD Reflow(nsIPresContext& aPresContext, NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize, nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState, const nsHTMLReflowState& aReflowState,
@@ -237,10 +234,8 @@ nsInlineFrame::CreateContinuingFrame(nsIPresContext& aCX,
return NS_OK; return NS_OK;
} }
#if 0
NS_IMETHODIMP NS_IMETHODIMP
nsInlineFrame::FindTextRuns(nsLineLayout& aLineLayout, nsInlineFrame::FindTextRuns(nsLineLayout& aLineLayout)
nsIReflowCommand* aReflowCommand)
{ {
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS, NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
("enter nsInlineFrame::FindTextRuns")); ("enter nsInlineFrame::FindTextRuns"));
@@ -252,16 +247,15 @@ nsInlineFrame::FindTextRuns(nsLineLayout& aLineLayout,
// Ask each child frame for its text runs // Ask each child frame for its text runs
nsIFrame* frame = mFirstChild; nsIFrame* frame = mFirstChild;
while (nsnull != frame) { while (nsnull != frame) {
nsIInlineReflow* inlineReflow; nsIHTMLReflow* hr;
if (NS_OK == frame->QueryInterface(kIInlineReflowIID, if (NS_OK == frame->QueryInterface(kIHTMLReflowIID, (void**)&hr)) {
(void**)&inlineReflow)) { rv = hr->FindTextRuns(aLineLayout);
rv = inlineReflow->FindTextRuns(aLineLayout, aReflowCommand);
if (NS_OK != rv) { if (NS_OK != rv) {
return rv; return rv;
} }
} }
else { else {
// A frame that doesn't implement nsIInlineReflow isn't text // A frame that doesn't implement nsIHTMLReflow isn't text
// therefore it will end an open text run. // therefore it will end an open text run.
aLineLayout.EndTextRun(); aLineLayout.EndTextRun();
} }
@@ -272,7 +266,6 @@ nsInlineFrame::FindTextRuns(nsLineLayout& aLineLayout,
("exit nsInlineFrame::FindTextRuns rv=%x", rv)); ("exit nsInlineFrame::FindTextRuns rv=%x", rv));
return rv; return rv;
} }
#endif
void void
nsInlineFrame::InsertNewFrame(nsIPresContext& aPresContext, nsInlineFrame::InsertNewFrame(nsIPresContext& aPresContext,
@@ -352,7 +345,6 @@ nsInlineFrame::Reflow(nsIPresContext& aPresContext,
NS_ASSERTION(nsnull != aReflowState.spaceManager, "no space manager"); NS_ASSERTION(nsnull != aReflowState.spaceManager, "no space manager");
aReflowState.spaceManager->Translate(state.mBorderPadding.left, aReflowState.spaceManager->Translate(state.mBorderPadding.left,
state.mBorderPadding.top); state.mBorderPadding.top);
nscoord sx, sy; aReflowState.spaceManager->GetTranslation(sx, sy); ListTag(stdout); printf(": BEGIN: BP=%d,%d,%d,%d spaceManager=%d,%d\n", state.mBorderPadding, sx, sy);
// Based on the type of reflow, switch out to the appropriate // Based on the type of reflow, switch out to the appropriate
// routine. // routine.
@@ -413,13 +405,11 @@ nscoord sx, sy; aReflowState.spaceManager->GetTranslation(sx, sy); ListTag(stdou
aStatus = ResizeReflow(state, inlineReflow); aStatus = ResizeReflow(state, inlineReflow);
} }
ComputeFinalSize(state, inlineReflow, aMetrics); ComputeFinalSize(state, inlineReflow, aMetrics);
// ListTag(stdout); printf(": exit carriedMargins=%d,%d\n", aMetrics.mCarriedOutTopMargin, aMetrics.mCarriedOutBottomMargin);
// Now translate in by our border and padding // Now translate in by our border and padding
aReflowState.lineLayout->PopInline(); aReflowState.lineLayout->PopInline();
aReflowState.spaceManager->Translate(-state.mBorderPadding.left, aReflowState.spaceManager->Translate(-state.mBorderPadding.left,
-state.mBorderPadding.top); -state.mBorderPadding.top);
ListTag(stdout); printf(": END\n");
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS, NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
("exit nsInlineFrame::InlineReflow size=%d,%d status=%x nif=%p", ("exit nsInlineFrame::InlineReflow size=%d,%d status=%x nif=%p",
@@ -771,7 +761,6 @@ nsInlineFrame::ReflowFrame(nsInlineReflowState& aState,
} }
} }
ListTag(stdout); printf(": child="); aFrame->ListTag(stdout); printf(": reflowStatus=%x\n", aReflowStatus);
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS, NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
("nsInlineFrame::ReflowMapped: frame=%p reflowStatus=%x", ("nsInlineFrame::ReflowMapped: frame=%p reflowStatus=%x",
aFrame, aReflowStatus)); aFrame, aReflowStatus));

View File

@@ -62,7 +62,6 @@ nsInlineReflow::~nsInlineReflow()
void void
nsInlineReflow::Init(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight) nsInlineReflow::Init(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight)
{ {
mOuterFrame->ListTag(stdout); printf(": IR: init: %d,%d,%d,%d\n", aX, aY, aWidth, aHeight);
mLeftEdge = aX; mLeftEdge = aX;
mX = aX; mX = aX;
if (NS_UNCONSTRAINEDSIZE == aWidth) { if (NS_UNCONSTRAINEDSIZE == aWidth) {
@@ -99,7 +98,6 @@ nsInlineReflow::UpdateBand(nscoord aX, nscoord aY,
nscoord aWidth, nscoord aHeight, nscoord aWidth, nscoord aHeight,
PRBool aPlacedLeftFloater) PRBool aPlacedLeftFloater)
{ {
mOuterFrame->ListTag(stdout); printf(": IR: update: %d,%d,%d,%d\n", aX, aY, aWidth, aHeight, aPlacedLeftFloater ? "left" : "right");
NS_PRECONDITION(mX == mLeftEdge, "update-band called after place-frame"); NS_PRECONDITION(mX == mLeftEdge, "update-band called after place-frame");
mLeftEdge = aX; mLeftEdge = aX;

View File

@@ -56,16 +56,6 @@ nsPlaceholderFrame::~nsPlaceholderFrame()
{ {
} }
#if 0
NS_IMETHODIMP
nsPlaceholderFrame::FindTextRuns(nsLineLayout& aLineLayout,
nsIReflowCommand* aReflowCommand)
{
aLineLayout.EndTextRun();
return NS_OK;
}
#endif
NS_IMETHODIMP NS_IMETHODIMP
nsPlaceholderFrame::Reflow(nsIPresContext& aPresContext, nsPlaceholderFrame::Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize, nsHTMLReflowMetrics& aDesiredSize,

View File

@@ -37,10 +37,6 @@ public:
SpacerFrame(nsIContent* aContent, nsIFrame* aParentFrame); SpacerFrame(nsIContent* aContent, nsIFrame* aParentFrame);
// nsIHTMLReflow // nsIHTMLReflow
#if 0
NS_IMETHOD FindTextRuns(nsLineLayout& aLineLayout,
nsIReflowCommand* aReflowCommand);
#endif
NS_IMETHOD Reflow(nsIPresContext& aPresContext, NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize, nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState, const nsHTMLReflowState& aReflowState,
@@ -150,16 +146,6 @@ SpacerFrame::Reflow(nsIPresContext& aPresContext,
return NS_OK; return NS_OK;
} }
#if 0
NS_IMETHODIMP
SpacerFrame::FindTextRuns(nsLineLayout& aLineLayout,
nsIReflowCommand* aReflowCommand)
{
aLineLayout.EndTextRun();
return NS_OK;
}
#endif
PRUint8 PRUint8
SpacerFrame::GetType() SpacerFrame::GetType()
{ {

View File

@@ -145,10 +145,7 @@ public:
PRInt32& aOffset); PRInt32& aOffset);
// nsIHTMLReflow // nsIHTMLReflow
#if 0 NS_IMETHOD FindTextRuns(nsLineLayout& aLineLayout);
NS_IMETHOD FindTextRuns(nsLineLayout& aLineLayout,
nsIReflowCommand* aReflowCommand);
#endif
NS_IMETHOD Reflow(nsIPresContext& aPresContext, NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aMetrics, nsHTMLReflowMetrics& aMetrics,
const nsHTMLReflowState& aReflowState, const nsHTMLReflowState& aReflowState,
@@ -1192,17 +1189,14 @@ TextFrame::PaintAsciiText(nsIPresContext& aPresContext,
NS_RELEASE(doc); NS_RELEASE(doc);
} }
#if 0
NS_IMETHODIMP NS_IMETHODIMP
TextFrame::FindTextRuns(nsLineLayout& aLineLayout, TextFrame::FindTextRuns(nsLineLayout& aLineLayout)
nsIReflowCommand* aReflowCommand)
{ {
if (nsnull == mPrevInFlow) { if (nsnull == mPrevInFlow) {
aLineLayout.AddText(this); aLineLayout.AddText(this);
} }
return NS_OK; return NS_OK;
} }
#endif
//--------------------------------------------------- //---------------------------------------------------
// Uses a binary search for find where the cursor falls in the line of text // Uses a binary search for find where the cursor falls in the line of text